You are here

public function SocialPostPostForm::buildOptionsForm in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php \Drupal\social_post\Plugin\views\area\SocialPostPostForm::buildOptionsForm()
  2. 8.2 modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php \Drupal\social_post\Plugin\views\area\SocialPostPostForm::buildOptionsForm()
  3. 8.3 modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php \Drupal\social_post\Plugin\views\area\SocialPostPostForm::buildOptionsForm()
  4. 8.4 modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php \Drupal\social_post\Plugin\views\area\SocialPostPostForm::buildOptionsForm()
  5. 8.5 modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php \Drupal\social_post\Plugin\views\area\SocialPostPostForm::buildOptionsForm()
  6. 8.6 modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php \Drupal\social_post\Plugin\views\area\SocialPostPostForm::buildOptionsForm()
  7. 8.7 modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php \Drupal\social_post\Plugin\views\area\SocialPostPostForm::buildOptionsForm()
  8. 8.8 modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php \Drupal\social_post\Plugin\views\area\SocialPostPostForm::buildOptionsForm()
  9. 10.3.x modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php \Drupal\social_post\Plugin\views\area\SocialPostPostForm::buildOptionsForm()
  10. 10.0.x modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php \Drupal\social_post\Plugin\views\area\SocialPostPostForm::buildOptionsForm()
  11. 10.1.x modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php \Drupal\social_post\Plugin\views\area\SocialPostPostForm::buildOptionsForm()
  12. 10.2.x modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php \Drupal\social_post\Plugin\views\area\SocialPostPostForm::buildOptionsForm()

Provide a form to edit options for this plugin.

Overrides AreaPluginBase::buildOptionsForm

File

modules/social_features/social_post/src/Plugin/views/area/SocialPostPostForm.php, line 57

Class

SocialPostPostForm
Provides an area handler which renders a block entity in a certain view mode.

Namespace

Drupal\social_post\Plugin\views\area

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $options = [];

  /** @var \Drupal\block_field\BlockFieldManagerInterface $block_field_manager */
  $definitions = $this
    ->getBlockDefinitions();
  foreach ($definitions as $id => $definition) {

    // If allowed plugin ids are set then check that this block should be
    // included.
    $category = (string) $definition['category'];
    $options[$category][$id] = $definition['admin_label'];
  }
  $form['block_id'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Block'),
    '#options' => $options,
    '#empty_option' => $this
      ->t('Please select'),
    '#default_value' => $this->options['block_id'],
  ];
}