Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function getLabel()
 {
     if (!empty($this->configuration['action_id'])) {
         $definition = $this->actionManager->getDefinition($this->configuration['action_id']);
         return $this->t('Action: @label', ['@label' => $definition['label']]);
     }
     return parent::getLabel();
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function getContextDefinition($name)
 {
     // Pass up the context definitions from the action plugin.
     $definition = $this->actionManager->getDefinition($this->configuration['action_id']);
     if (empty($definition['context'][$name])) {
         throw new ContextException(sprintf("The %s context is not a valid context.", $name));
     }
     return $definition['context'][$name];
 }