openlayers-8.x-4.x-dev/src/Plugin/Component/BootstrapjsAlert/BootstrapjsAlert.php
src/Plugin/Component/BootstrapjsAlert/BootstrapjsAlert.php
<?php
namespace Drupal\openlayers\Plugin\Component\BootstrapjsAlert;
use Drupal\Core\Form\FormStateInterface;
use Drupal\openlayers\Types\Component;
/**
* FIX - Insert short comment here.
*
* @OpenlayersPlugin(
* id = "ol_component_bootstrapjsalert",
* label = @Translation("Bootstrap JS Alert"),
* description = @Translation("TODO..."),
* service = "openlayers.Component:BootstrapjsAlert",
* library = "openlayers-plugin-component-bootstrapjsalert",
* is_configurable = "true",
* type = "component"
* )
*/
class BootstrapjsAlert extends Component {
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form['options']['message'] = array(
'#type' => 'textarea',
'#title' => t('Text to display'),
'#default_value' => $this->getOption('message'),
);
return $form;
}
/**
* {@inheritdoc}
*/
public function attached() {
$attached = parent::attached();
$attached['libraries_load'][] = array('bootstrap');
return $attached;
}
/**
* {@inheritdoc}
*/
public function dependencies() {
return array(
'bootstrap_library',
);
}
}
