You are here

function template_preprocess_insert_icon_link in Insert 6

Same name and namespace in other branches
  1. 8.2 insert.module \template_preprocess_insert_icon_link()
  2. 8 insert.module \template_preprocess_insert_icon_link()
  3. 7 includes/insert.inc \template_preprocess_insert_icon_link()

Preprocess variables for the insert-icon-link.tpl.php file.

File

includes/insert.inc, line 69
Insert support for generic files.

Code

function template_preprocess_insert_icon_link(&$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'] : '';
  $vars['name'] = $vars['item']['filename'];
  $vars['type'] = $vars['item']['filemime'] . '; length=' . $vars['item']['filesize'];
  $vars['icon'] = theme('filefield_icon', $vars['item']);
}