You are here

function views_skinr_form_index_handler in Skinr 6.2

Same name and namespace in other branches
  1. 6 modules/views.skinr.inc \views_skinr_form_index_handler()

Skinr form index handler.

Parameters

$op: What kind of action is being performed. Possible values:

  • "form": the form elements for Skinr are being inserted in a form
  • "submit": the form has been submitted.

&$form:

  • For "form", passes in the $form parameter from hook_form_alter().
  • For "submit", passes in the $form parameter from hook_form_submit().

$form_state:

  • For "form", passes in the $form_state parameter from hook_form_alter().
  • For "submit", passes in the $form_state parameter from hook_form_submit().

Return value

The index where we can find our values in Skinrs data structure.

Related topics

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

File

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

Code

function views_skinr_form_index_handler($op, &$form, $form_state) {
  switch ($op) {
    case 'form':
      $default = $form_state['view']->display_handler
        ->is_defaulted('style_options');
      if ($default) {
        return 'view-' . $form_state['view']->name . '-display-default';
      }
      else {
        return 'view-' . $form_state['view']->name . '-display-' . $form_state['view']->current_display;
      }
    case 'submit':

      // Can't use display_handler->is_defaulted('style_options') on submit
      $default = $form_state['#section'] == 'default-style_options';
      if ($default) {
        return 'view-' . $form_state['view']->name . '-display-default';
      }
      else {
        return 'view-' . $form_state['view']->name . '-display-' . $form_state['display_id'];
      }
  }
}