/** * Constructs an InlineJS plugin. * * @param @todo * @param @todo * @param @todo */ public function __construct(array $configuration, $plugin_id, $plugin_definition, ModuleHandlerInterface $module_handler, MessengerInterface $messenger, Drupal7 $drupal7) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->moduleHandler = $module_handler; $this->messenger = $messenger; $this->drupal7 = $drupal7; }
/** * {@inheritdoc} */ public function optionsToObjects() { $import = parent::optionsToObjects(); if ($select = $this->getOption('select')) { $select = Openlayers::load('interaction', $select); $import = array_merge($select->getCollection()->getFlatList(), $import); } return $import; }
/** * {@inheritdoc} */ public function optionsToObjects() { $import = parent::optionsToObjects(); if ($style = $this->getOption('style')) { $style = Openlayers::load('style', $style); // This style is a dependency of the current one, // we need a lighter weight. $this->setWeight($style->getWeight() + 1); $import = array_merge($style->getCollection()->getFlatList(), $import); } return $import; }