public function WSDataBlock::blockForm in Web Service Data 2.0.x
Same name and namespace in other branches
- 8 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\BlockCode
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;
}