You are here

function views_ui_add_add_button in Views (for Drupal 7) 5

Add the 'add' button for a section into the form

1 call to views_ui_add_add_button()
views_edit_view in ./views_ui.module
Display all the guts of a view in a form for editing.

File

./views_ui.module, line 1220

Code

function views_ui_add_add_button(&$form, $section, $options, $label) {
  $form[$section]['add'] = array(
    '#tree' => true,
    '#parents' => array(
      $section,
      'add',
    ),
  );
  $form[$section]['add']['id'] = array(
    '#type' => 'select',
    '#options' => $options,
  );
  $form[$section]['add']['button'] = array(
    '#type' => 'button',
    '#value' => $label,
  );
  views_ui_build_form($form[$section]['add']);
}