You are here

function views_ui_pre_render_move_argument_options in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 8.3 views_ui/admin.inc \views_ui_pre_render_move_argument_options()

Moves argument options into their place.

When configuring the default argument behavior, almost each of the radio buttons has its own fieldset shown bellow it when the radio button is clicked. That fieldset is created through a custom form process callback. Each element that has #argument_option defined and pointing to a default behavior gets moved to the appropriate fieldset. So if #argument_option is specified as 'default', the element is moved to the 'default_options' fieldset.

1 string reference to 'views_ui_pre_render_move_argument_options'
views_handler_argument::options_form in handlers/views_handler_argument.inc
Build the options form.

File

includes/admin.inc, line 2034
Provides the Views' administrative interface.

Code

function views_ui_pre_render_move_argument_options($form) {
  foreach (element_children($form) as $key) {
    $element = $form[$key];
    if (!empty($element['#argument_option'])) {
      $container_name = $element['#argument_option'] . '_options';
      if (isset($form['no_argument']['default_action'][$container_name])) {
        $form['no_argument']['default_action'][$container_name][$key] = $element;
      }

      // Remove the original element this duplicates.
      unset($form[$key]);
    }
  }
  return $form;
}