Commit ff4c9250 authored by frjo's avatar frjo
Browse files

Issue #1081546: Fixing the call to theme_colorbox_insert_image() and added in...

Issue #1081546: Fixing the call to theme_colorbox_insert_image() and added in the CSS classes from insert module.
parent 2c9ce36c
......@@ -8,7 +8,8 @@
* - $item: The complete item being inserted.
* - $image_path: The URL to the image.
* - $link_path: The URL to the image that Colorbox should open.
* - $style_name: The ImageCache preset being used.
* - $class: A set of classes assigned to this image (if any).
* - $style_name: The Image style being used.
* - $gallery_id: The ID of the Colorbox gallery.
*
* Note that ALT and Title fields should not be filled in here, instead they
......@@ -21,4 +22,4 @@
* - __description__: A description of the image, sometimes used as a caption.
*/
?>
<a href="<?php print $link_path; ?>" title="__title__" class="colorbox colorbox-insert-image" rel="<?php print $gallery_id; ?>"><img src="<?php print $image_path; ?>" alt="__alt__" title="__title__" class="imagecache imagecache-<?php print $style_name; ?>" /></a>
\ No newline at end of file
<a href="<?php print $link_path; ?>" title="__title__" class="colorbox colorbox-insert-image" rel="<?php print $gallery_id; ?>"><img typeof="foaf:Image" src="<?php print $image_path; ?>" alt="__alt__" title="__title__" class="<?php print $class; ?>" /></a>
\ No newline at end of file
......@@ -446,5 +446,5 @@ function colorbox_insert_styles() {
*/
function colorbox_insert_content($item, $style, $widget) {
list($item['module_name'], $item['style_name']) = explode('__', $style['name'], 2);
return theme('colorbox_insert_image', $item, $widget);
return theme('colorbox_insert_image', array('item' => $item, 'widget' => $widget));
}
......@@ -116,16 +116,19 @@ function theme_colorbox_imagefield($variables) {
* Preprocess variables for the colorbox-insert-image.tpl.php file.
*/
function template_preprocess_colorbox_insert_image(&$variables) {
$variables['file'] = file_load($variables['fid']);
$variables['image_path'] = image_style_url($variables['style_name'], $variables['file']->uri);
$file = file_load($variables['item']['fid']);
$variables['image_path'] = image_style_url($variables['item']['style_name'], $file->uri);
if ($style_name = variable_get('colorbox_image_style', '')) {
$variables['link_path'] = image_style_url($style_name, $variables['file']->uri);
$variables['link_path'] = image_style_url($style_name, $file->uri);
}
else {
$variables['link_path'] = file_create_url($variables['file']->uri);
$variables['link_path'] = file_create_url($file->uri);
}
$variables['class'] = $variables['widget']['settings']['insert_class'];
$variables['gallery_id'] = '';
switch (variable_get('colorbox_insert_gallery', 0)) {
case 0:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment