Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 protected function initializePlugin($instance_id)
 {
     // Filters have a 1:1 relationship to text formats and can be added and
     // instantiated at any time.
     // @todo $configuration is the whole filter plugin instance configuration,
     //   as contained in the text format configuration. The default
     //   configuration is the filter plugin definition. Configuration should not
     //   be contained in definitions. Move into a FilterBase::init() method.
     $configuration = $this->manager->getDefinition($instance_id);
     // Merge the actual configuration into the default configuration.
     if (isset($this->configurations[$instance_id])) {
         $configuration = NestedArray::mergeDeep($configuration, $this->configurations[$instance_id]);
     }
     $this->configurations[$instance_id] = $configuration;
     parent::initializePlugin($instance_id);
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 protected function initializePlugin($display_id)
 {
     // Retrieve and initialize the new display handler with data.
     $display =& $this->view->storage->getDisplay($display_id);
     try {
         $this->configurations[$display_id] = $display;
         parent::initializePlugin($display_id);
     } catch (PluginException $e) {
         $message = $e->getMessage();
         drupal_set_message(t('!message', array('!message' => $message)), 'warning');
     }
     // If no plugin instance has been created, return NULL.
     if (empty($this->pluginInstances[$display_id])) {
         return NULL;
     }
     $this->pluginInstances[$display_id]->initDisplay($this->view, $display);
     // If this is not the default display handler, let it know which is since
     // it may well utilize some data from the default.
     if ($display_id != 'default') {
         $this->pluginInstances[$display_id]->default_display = $this->pluginInstances['default'];
     }
 }