Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Issue forks
colorbox-3127345
Commits
3f6b2640
Commit
3f6b2640
authored
Oct 01, 2015
by
podarok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#155588
by frjo, benjy, znerol
parent
5c27b83d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
colorbox.theme.inc
colorbox.theme.inc
+11
-0
No files found.
colorbox.theme.inc
View file @
3f6b2640
...
...
@@ -17,6 +17,7 @@
* @ingroup themeable
*/
function
theme_colorbox_image_formatter
(
$variables
)
{
static
$gallery_token
=
NULL
;
$item
=
$variables
[
'item'
];
$entity_type
=
$variables
[
'entity_type'
];
$entity
=
$variables
[
'entity'
];
...
...
@@ -123,6 +124,16 @@ function theme_colorbox_image_formatter($variables) {
$gallery_id
=
''
;
}
// If gallery id is not empty add unique per-request token to avoid images being added manually to galleries.
if
(
!
empty
(
$gallery_id
))
{
// Check if gallery token has alrady been set, we need to reuse the token for the whole request.
if
(
is_null
(
$gallery_token
))
{
// We use a short token since randomness is not critical.
$gallery_token
=
drupal_random_key
(
8
);
}
$gallery_id
=
$gallery_id
.
'-'
.
$gallery_token
;
}
if
(
$style_name
=
$settings
[
'colorbox_image_style'
])
{
$path
=
image_style_url
(
$style_name
,
$image
[
'path'
]);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment