You are here

public function BrokenHandlerTrait::buildOptionsForm in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/BrokenHandlerTrait.php \Drupal\views\Plugin\views\BrokenHandlerTrait::buildOptionsForm()

Provides a form to edit options for this plugin.

See also

\Drupal\views\Plugin\views\PluginBase::defineOptions().

File

core/modules/views/src/Plugin/views/BrokenHandlerTrait.php, line 58
Contains \Drupal\views\Plugin\views\BrokenHandlerTrait.

Class

BrokenHandlerTrait
A Trait for Views broken handlers.

Namespace

Drupal\views\Plugin\views

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  $description_top = t('The handler for this item is broken or missing. The following details are available:');
  foreach ($this->definition['original_configuration'] as $key => $value) {
    if (is_scalar($value)) {
      $items[] = SafeMarkup::format('@key: @value', array(
        '@key' => $key,
        '@value' => $value,
      ));
    }
  }
  $description_bottom = t('Enabling the appropriate module will may solve this issue. Otherwise, check to see if there is a module update available.');
  $form['description'] = array(
    '#type' => 'container',
    '#attributes' => array(
      'class' => array(
        'js-form-item',
        'form-item',
        'description',
      ),
    ),
    'description_top' => array(
      '#markup' => '<p>' . $description_top . '</p>',
    ),
    'detail_list' => array(
      '#theme' => 'item_list',
      '#items' => $items,
    ),
    'description_bottom' => array(
      '#markup' => '<p>' . $description_bottom . '</p>',
    ),
  );
}