function ViewsUiNodeViewsWizard::build_form_style

Overrides ViewsUiBaseViewsWizard::build_form_style

File

plugins/views_wizard/views_ui_node_views_wizard.class.php, line 29

Class

ViewsUiNodeViewsWizard
Tests creating node 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 'full_posts':
        case 'teasers':
            $style_form['row_options']['links'] = array(
                '#type' => 'select',
                '#title_display' => 'invisible',
                '#title' => t('Should links be displayed below each node'),
                '#options' => array(
                    1 => t('with links (allow users to add comments, etc.)'),
                    0 => t('without links'),
                ),
                '#default_value' => 1,
            );
            $style_form['row_options']['comments'] = array(
                '#type' => 'select',
                '#title_display' => 'invisible',
                '#title' => t('Should comments be displayed below each node'),
                '#options' => array(
                    1 => t('with comments'),
                    0 => t('without comments'),
                ),
                '#default_value' => 0,
            );
            break;
    }
}