1 views_ui_comment_views_wizard.php protected ViewsUiCommentViewsWizard::build_form_style(&$form, &$form_state, $type)

Build the part of the form that builds the display format options.

Overrides ViewsUiBaseViewsWizard::build_form_style

File

core/modules/views_ui/wizards/views_ui_comment_views_wizard.php, line 20
Definition of ViewsUiCommentViewsWizard.

Class

ViewsUiCommentViewsWizard
Tests creating comment views with the wizard.

Code

protected function build_form_style(&$form, &$form_state, $type) {
  parent::build_form_style($form, $form_state, $type);
  $style_form = &$form['displays'][$type]['options']['style'];
  // Some style plugins don't support row plugins so stop here if that's the
  // case.
  if (!isset($style_form['row_plugin']['#default_value'])) {
    return;
  }
  $row_plugin = $style_form['row_plugin']['#default_value'];
  switch ($row_plugin) {
    case 'comment':
      $style_form['row_options']['links'] = array(
        '#type' => 'select',
        '#title_display' => 'invisible',
        '#title' => t('Should links be displayed below each comment'),
        '#options' => array(
          1 => t('with links (allow users to reply to the comment, etc.)'),
          0 => t('without links'),
        ),
        '#default_value' => 1,
      );
      break;
  }
}