You are here

function asset_widget_preprocess_asset_wrapper in Asset 7

Preprocess variables for asset-wrapper.tpl.php.

See also

asset-wrapper.tpl.php

File

modules/asset_widget/asset_widget.module, line 879
Code for the Asset widget module.

Code

function asset_widget_preprocess_asset_wrapper(&$vars) {
  $element = $vars['element'];

  // Add custom suggestion for our view mode.
  if ($element['#view_mode'] == 'widget_search') {
    $asset = $element['#entity'];
    $base = 'asset_wrapper';
    if (!empty($asset->in_editor)) {
      $base = 'asset_editor_wrapper';
    }

    // Add suggestion for common template.
    $vars['theme_hook_suggestions'][] = $base . '__widget_search';
  }
}