You are here

public function WSDataBlock::blockForm in Web Service Data 8

Same name and namespace in other branches
  1. 2.0.x modules/wsdata_block/src/Plugin/Block/WSDataBlock.php \Drupal\wsdata_block\Plugin\Block\WSDataBlock::blockForm()

Overrides BlockPluginTrait::blockForm

File

modules/wsdata_block/src/Plugin/Block/WSDataBlock.php, line 63

Class

WSDataBlock
Provides a 'Green House Gas Emissions' block.

Namespace

Drupal\wsdata_block\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $wscall = $this->configuration['wscall'];

  // This can return a subfomstate and not a form_state interface.
  if ($form_state instanceof SubformState) {
    $form_state = $form_state
      ->getCompleteFormState();
  }
  $form_state_wscall = $form_state
    ->getValue('settings');
  if (isset($form_state_wscall['wscall'])) {
    $wscall = $form_state_wscall['wscall'];
  }
  $elements = $this->wsdata
    ->wscallForm($this->configuration, $wscall);
  $form = array_merge($form, $elements);
  return $form;
}