You are here

function views_fusion_apply_preprocess_hook_callback in Fusion Accelerator 7.2

Same name and namespace in other branches
  1. 7 fusion_apply/modules/views.fusion.inc \views_fusion_apply_preprocess_hook_callback()

Fusion Apply form preprocess hook callback.

Parameters

&$form: Passes in the $form parameter from hook_form_alter().

$form_state: Passes in the $form_state parameter from hook_form_alter().

Return value

An array of preprocess hooks we wish to use.

Related topics

1 string reference to 'views_fusion_apply_preprocess_hook_callback'
views_fusion_apply_config_info in fusion_apply/modules/views.fusion.inc
Implements hook_fusion_apply_config_info().

File

fusion_apply/modules/views.fusion.inc, line 44
Provide skins handling for views.module

Code

function views_fusion_apply_preprocess_hook_callback(&$form, $form_state) {
  $preprocess_hooks = array(
    'views_view',
  );
  if (!empty($form_state['view']) && !empty($form_state['view']->name)) {
    $view = $form_state['view'];
  }
  elseif (isset($form['fusion_apply']['element']['#value'])) {
    list($element_info['view'], $element_info['display']) = explode('__', $form['fusion_apply']['element']['#value'], 2);
    if ($view = views_get_view($element_info['view'])) {
      $view
        ->execute_display($element_info['display']);
    }
  }
  if (!empty($view)) {
    $display = $view->display[$view->current_display];

    // Create list of suggested templates.
    $preprocess_hooks = views_theme_functions('views_view', $view, $display);

    // Fetch additional style based suggested templates.
    $additional_hooks = views_theme_functions($display->display_plugin, $view, $display);
    $preprocess_hooks = array_merge($additional_hooks, $preprocess_hooks);
  }
  return $preprocess_hooks;
}