/**
  * {@inheritdoc}
  */
 public function getConfiguration()
 {
     $configuration = parent::getConfiguration();
     // Remove configuration if it matches the defaults.
     foreach ($configuration as $instance_id => $instance_config) {
         $default_config = array();
         $default_config['id'] = $instance_id;
         $default_config += $this->get($instance_id)->defaultConfiguration();
         if ($default_config === $instance_config) {
             unset($configuration[$instance_id]);
         }
     }
     return $configuration;
 }
 /**
  * {@inheritdoc}
  */
 public function getConfiguration()
 {
     $configuration = parent::getConfiguration();
     // Remove configuration if it matches the defaults. In self::getAll(), we
     // load all available filters, in addition to the enabled filters stored in
     // configuration. In order to prevent those from bleeding through to the
     // stored configuration, remove all filters that match the default values.
     // Because filters are disabled by default, this will never remove the
     // configuration of an enabled filter.
     foreach ($configuration as $instance_id => $instance_config) {
         $default_config = array();
         $default_config['id'] = $instance_id;
         $default_config += $this->get($instance_id)->defaultConfiguration();
         if ($default_config === $instance_config) {
             unset($configuration[$instance_id]);
         }
     }
     return $configuration;
 }
示例#3
0
 /**
  * @return \Drupal\layout\Plugin\LayoutRegion\LayoutRegionInterface
  */
 public function current()
 {
     return parent::current();
 }
 /**
  * Overrides \Drupal\Component\Plugin\PluginBag::remove().
  */
 public function remove($instance_id)
 {
     $this->get($instance_id)->remove();
     parent::remove($instance_id);
 }
 /**
  * {@inheritdoc}
  *
  * @return \Drupal\image\ImageEffectInterface
  */
 public function &get($instance_id)
 {
     return parent::get($instance_id);
 }
示例#6
0
 /**
  * {@inheritdoc}
  */
 public function sortHelper($aID, $bID)
 {
     $a = $this->get($aID);
     $b = $this->get($bID);
     if ($a->status != $b->status) {
         return !empty($a->status) ? -1 : 1;
     }
     if ($a->weight != $b->weight) {
         return $a->weight < $b->weight ? -1 : 1;
     }
     if ($a->provider != $b->provider) {
         return strnatcasecmp($a->provider, $b->provider);
     }
     return parent::sortHelper($aID, $bID);
 }