function views_ui_remove_display_form

Form to remove a display from a view.

2 string references to 'views_ui_remove_display_form'
template_preprocess_views_ui_edit_tab in includes/admin.inc
views_ui_ajax_forms in includes/admin.inc

File

includes/admin.inc, line 1950

Code

function views_ui_remove_display_form(&$form_state) {
    $view =& $form_state['view'];
    $display_id = $form_state['display_id'];
    if (empty($view->display[$display_id]->deleted)) {
        $form['display'] = array(
            '#prefix' => '<div class="display-button remove-display">',
            '#suffix' => '</div>',
        );
        $form['remove_display'] = array(
            '#type' => 'submit',
            '#value' => t('Remove display'),
            '#submit' => array(
                'views_ui_remove_display_form_submit',
            ),
        );
    }
    else {
        $form['display'] = array(
            '#prefix' => '<div class="display-button restore-display">',
            '#suffix' => '</div>',
        );
        $form['restore_display'] = array(
            '#type' => 'submit',
            '#value' => t('Restore display'),
            '#submit' => array(
                'views_ui_remove_display_form_restore',
            ),
        );
    }
    $form['#action'] = url("admin/build/views/nojs/remove-display/{$view->name}/{$display_id}");
    $form['#attributes'] = array(
        'class' => 'views-ajax-form',
    );
    return $form;
}