You are here

function template_preprocess_asset_widget_wrapper in Asset 7

Preprocess variables for asset-widget-wrapper.tpl.php.

See also

asset-widget-wrapper.tpl.php

File

modules/asset_widget/theme/theme.inc, line 12
Module related preprocesses and theme overrides.

Code

function template_preprocess_asset_widget_wrapper(&$vars) {
  $vars['tab_links'] = array();
  foreach (asset_widget_get_tabs_info() as $tab_id => $info) {
    $classes = array(
      $tab_id . '-tab',
    );
    if (!empty($info['classes'])) {
      $classes = array_merge($classes, $info['classes']);
    }
    $vars['tab_links'][$tab_id] = array(
      'href' => 'javascript:void(0)',
      'title' => '<span class="ico"></span>',
      'external' => TRUE,
      'html' => TRUE,
      'attributes' => array(
        'class' => $classes,
        'title' => isset($info['title']) ? t($info['title']) : '',
      ),
    );
  }
  $vars['tabs_count'] = count($vars['tab_links']);
  $vars['loader'] = theme('image', array(
    'path' => ASSET_WIDGET_MODULE_PATH . '/images/content/loader.gif',
    'attributes' => array(
      'alt' => t('Loading...'),
    ),
  ));
}