You are here

function views_skinr_preprocess_hook_callback in Skinr 6.2

Skinr 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

The preprocess_hook we wish to use.

Related topics

1 string reference to 'views_skinr_preprocess_hook_callback'
views_skinr_config in modules/views.skinr.inc
Implementation of hook_skinr_config().

File

modules/views.skinr.inc, line 304
Provide skinr handling for node.module

Code

function views_skinr_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['skinr']['sid']['#value'])) {
    $sidinfo = _views_skinr_sidinfo($form['skinr']['sid']['#value']);
    if ($view = views_get_view($sidinfo['view'])) {
      $view
        ->execute_display($sidinfo['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($view->style_plugin->definition['theme'], $view, $display);
    $preprocess_hooks = array_merge($additional_hooks, $preprocess_hooks);
  }
  return $preprocess_hooks;
}