public function EditDetails::buildForm

Implements \Drupal\Core\Form\FormInterface::buildForm().

Overrides FormInterface::buildForm

File

drupal/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/EditDetails.php, line 35
Contains \Drupal\views_ui\Form\Ajax\EditDetails.

Class

EditDetails
Provides a form for editing the details of a View.

Namespace

Drupal\views_ui\Form\Ajax

Code

public function buildForm(array $form, array &$form_state) {
  $view =& $form_state['view'];
  $form['#title'] = t('View name and description');
  $form['#section'] = 'details';
  $form['details'] = array(
    '#theme_wrappers' => array(
      'container',
    ),
    '#attributes' => array(
      'class' => array(
        'scroll',
      ),
    ),
  );
  $form['details']['label'] = array(
    '#type' => 'textfield',
    '#title' => t('Human-readable name'),
    '#description' => t('A descriptive human-readable name for this view. Spaces are allowed'),
    '#default_value' => $view
      ->label(),
  );
  $form['details']['langcode'] = array(
    '#type' => 'language_select',
    '#title' => t('View language'),
    '#description' => t('Language of labels and other textual elements in this view.'),
    '#default_value' => $view
      ->get('langcode'),
  );
  $form['details']['tag'] = array(
    '#type' => 'textfield',
    '#title' => t('View tag'),
    '#description' => t('Optionally, enter a comma delimited list of tags for this view to use in filtering and sorting views on the administrative page.'),
    '#default_value' => $view
      ->get('tag'),
    '#autocomplete_path' => 'admin/views/ajax/autocomplete/tag',
  );
  $form['details']['description'] = array(
    '#type' => 'textfield',
    '#title' => t('View description'),
    '#description' => t('This description will appear on the Views administrative UI to tell you what the view is about.'),
    '#default_value' => $view
      ->get('description'),
  );
  $view
    ->getStandardButtons($form, $form_state, 'views_ui_edit_details_form');
  return $form;
}