Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Issue forks
colorbox-3127345
Commits
de169a20
Commit
de169a20
authored
Jan 21, 2010
by
jdwfly
Browse files
rudimentary imagefield support.
parent
62842663
Changes
2
Hide whitespace changes
Inline
Side-by-side
colorbox.js
View file @
de169a20
...
...
@@ -10,6 +10,7 @@ if (jQuery().colorbox) {
// Colorbox it
});
$
(
"
a[rel='testing1']
"
).
colorbox
();
$
(
"
a[rel='testing2']
"
).
colorbox
();
$
(
'
.colorbox
'
).
colorbox
();
};
}
colorbox.module
View file @
de169a20
...
...
@@ -77,4 +77,42 @@ function colorbox_link_alter(&$links, $node) {
$links
[
'image_size_'
.
$size
][
'href'
]
=
$node
->
images
[
$size
];
unset
(
$links
[
'image_size_'
.
$size
][
'query'
]);
}
}
/**
* Implementation of CCK hook_field_formatter_info().
*/
function
colorbox_field_formatter_info
()
{
return
array
(
'colorbox_slideshow'
=>
array
(
'label'
=>
t
(
'Colorbox Slideshow'
),
'field types'
=>
array
(
'filefield'
),
'description'
=>
t
(
'Adds a colorbox slideshow to images'
),
),
);
}
/**
* Implmentation of hook_theme().
*/
function
colorbox_theme
()
{
$theme
=
array
(
'colorbox_formatter_colorbox_slideshow'
=>
array
(
'arguments'
=>
array
(
'element'
=>
NULL
),
),
);
return
$theme
;
}
/**
* Theme function for our video formatter
*/
function
theme_colorbox_formatter_colorbox_slideshow
(
$element
)
{
// Inside a view $element may contain null data. In that case, just return.
if
(
empty
(
$element
[
'#item'
][
'fid'
]))
{
return
''
;
}
$item
=
$element
[
'#item'
];
$imagetag
=
theme
(
'imagefield_formatter_image_plain'
,
$element
);
$original_image_url
=
file_create_url
(
$item
[
'filepath'
]);
$class
=
'imagefield imagefield-imagelink imagefield-'
.
$element
[
'#field_name'
];
return
l
(
$imagetag
,
$original_image_url
,
array
(
'attributes'
=>
array
(
'class'
=>
$class
,
'rel'
=>
'testing2'
),
'html'
=>
TRUE
));
}
\ No newline at end of file
Write
Preview
Supports
Markdown
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