function views_ui_config_item_group_form

Form to config_item items in the views UI.

1 string reference to 'views_ui_config_item_group_form'
views_ui_ajax_forms in drupal/core/modules/views/views_ui/admin.inc
Returns information about subforms for editing the pieces of a view.

File

drupal/core/modules/views/views_ui/admin.inc, line 1637
Provides the Views' administrative interface.

Code

function views_ui_config_item_group_form($type, &$form_state) {
  $view =& $form_state['view'];
  $display_id = $form_state['display_id'];
  $type = $form_state['type'];
  $id = $form_state['id'];
  $form = array(
    'options' => array(
      '#tree' => TRUE,
      '#theme_wrappers' => array(
        'container',
      ),
      '#attributes' => array(
        'class' => array(
          'scroll',
        ),
      ),
    ),
  );
  $executable = $view
    ->get('executable');
  if (!$executable
    ->setDisplay($display_id)) {
    views_ajax_render(t('Invalid display id @display', array(
      '@display' => $display_id,
    )));
  }
  $executable
    ->initQuery();
  $item = $executable
    ->getItem($display_id, $type, $id);
  if ($item) {
    $handler = $executable->display_handler
      ->getHandler($type, $id);
    if (empty($handler)) {
      $form['markup'] = array(
        '#markup' => t("Error: handler for @table > @field doesn't exist!", array(
          '@table' => $item['table'],
          '@field' => $item['field'],
        )),
      );
    }
    else {
      $handler
        ->init($view, $item);
      $types = ViewExecutable::viewsHandlerTypes();
      $form['#title'] = t('Configure group settings for @type %item', array(
        '@type' => $types[$type]['lstitle'],
        '%item' => $handler
          ->adminLabel(),
      ));
      $handler
        ->buildGroupByForm($form['options'], $form_state);
      $form_state['handler'] =& $handler;
    }
    $view
      ->getStandardButtons($form, $form_state, 'views_ui_config_item_group_form');
  }
  return $form;
}