function _insert_default_vars in Insert 7
Aggregates default variables to be sent to every template.
Parameters
array $vars:
Return value
array
4 calls to _insert_default_vars()
- template_preprocess_insert_audio in includes/
insert.inc - Preprocess variables for the insert-audio.tpl.php file.
- template_preprocess_insert_icon_link in includes/
insert.inc - Preprocess variables for the insert-icon-link.tpl.php file.
- template_preprocess_insert_link in includes/
insert.inc - Preprocess variables for the insert-link.tpl.php file.
- template_preprocess_insert_video in includes/
insert.inc - Preprocess variables for the insert-video.tpl.php file.
File
- includes/
insert.inc, line 125 - Insert support for generic files.
Code
function _insert_default_vars(array $vars) {
$vars['file'] = file_load($vars['item']['fid']);
$absolute = isset($vars['widget']['settings']['insert_absolute']) ? $vars['widget']['settings']['insert_absolute'] : NULL;
$vars['url'] = insert_create_url($vars['file']->uri, $absolute);
$vars['class'] = !empty($vars['widget']['settings']['insert_class']) ? $vars['widget']['settings']['insert_class'] : '';
return $vars;
}