class Analyze

Displays analysis information for a view.

Hierarchy

Expanded class hierarchy of Analyze

File

drupal/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Analyze.php, line 17
Contains \Drupal\views_ui\Form\Ajax\Analyze.

Namespace

Drupal\views_ui\Form\Ajax
View source
class Analyze extends ViewsFormBase {

  /**
   * Implements \Drupal\views_ui\Form\Ajax\ViewsFormInterface::getFormKey().
   */
  public function getFormKey() {
    return 'analyze';
  }

  /**
   * Implements \Drupal\Core\Form\FormInterface::getFormID().
   */
  public function getFormID() {
    return 'views_ui_analyze_view_form';
  }

  /**
   * Implements \Drupal\Core\Form\FormInterface::buildForm().
   */
  public function buildForm(array $form, array &$form_state) {
    $view =& $form_state['view'];
    $form['#title'] = t('View analysis');
    $form['#section'] = 'analyze';
    $analyzer = Views::analyzer();
    $messages = $analyzer
      ->getMessages($view
      ->get('executable'));
    $form['analysis'] = array(
      '#prefix' => '<div class="form-item">',
      '#suffix' => '</div>',
      '#markup' => $analyzer
        ->formatMessages($messages),
    );

    // Inform the standard button function that we want an OK button.
    $form_state['ok_button'] = TRUE;
    $view
      ->getStandardButtons($form, $form_state, 'views_ui_analyze_view_form');
    return $form;
  }

  /**
   * Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::submitForm().
   */
  public function submitForm(array &$form, array &$form_state) {
    $form_state['redirect'] = 'admin/structure/views/view/' . $form_state['view']
      ->id() . '/edit';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Analyze::buildForm public function Implements \Drupal\Core\Form\FormInterface::buildForm(). Overrides FormInterface::buildForm
Analyze::getFormID public function Implements \Drupal\Core\Form\FormInterface::getFormID(). Overrides FormInterface::getFormID
Analyze::getFormKey public function Implements \Drupal\views_ui\Form\Ajax\ViewsFormInterface::getFormKey(). Overrides ViewsFormInterface::getFormKey
Analyze::submitForm public function Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::submitForm(). Overrides ViewsFormBase::submitForm
ViewsFormBase::$id protected property The ID of the item this form is manipulating.
ViewsFormBase::$type protected property The type of item this form is manipulating.
ViewsFormBase::getForm public function Implements \Drupal\views_ui\Form\Ajax\ViewsFormInterface::getForm(). Overrides ViewsFormInterface::getForm 6
ViewsFormBase::getFormState public function Implements \Drupal\views_ui\Form\Ajax\ViewsFormInterface::getFormState(). Overrides ViewsFormInterface::getFormState 1
ViewsFormBase::setID protected function Sets the ID for this form.
ViewsFormBase::setType protected function Sets the type for this form.
ViewsFormBase::validateForm public function Implements \Drupal\Core\Form\FormInterface::validateForm(). Overrides FormInterface::validateForm 3