function template_preprocess_insert_image in Insert 6
Same name and namespace in other branches
- 8.2 insert.module \template_preprocess_insert_image()
- 8 insert.module \template_preprocess_insert_image()
- 7 includes/insert.inc \template_preprocess_insert_image()
Preprocess variables for the insert-image.tpl.php file.
File
- includes/
insert.inc, line 47 - Insert support for generic files.
Code
function template_preprocess_insert_image(&$vars) {
$absolute = isset($vars['widget']['insert_absolute']) ? $vars['widget']['insert_absolute'] : NULL;
$vars['url'] = insert_create_url($vars['item']['filepath'], $absolute);
$vars['class'] = !empty($vars['widget']['insert_class']) ? $vars['widget']['insert_class'] : '';
$image_info = @image_get_info($vars['item']['filepath']);
$vars['width'] = isset($image_info['width']) ? $image_info['width'] : '';
$vars['height'] = isset($image_info['height']) ? $image_info['height'] : '';
}