/** * {@inheritdoc} */ public function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); $operations['edit']['title'] = $this->t('Edit items'); return $operations; }
/** * {@inheritdoc} */ public function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); if (isset($operations['edit'])) { $operations['edit']['query']['destination'] = 'admin/structure/block/block-content'; } return $operations; }
/** * {@inheritdoc} */ protected function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); if ($entity->access('update') && $entity->hasLinkTemplate('reassign-form')) { $operations['reassign'] = array('title' => $this->t('Reassign'), 'weight' => 20, 'url' => $entity->toUrl('reassign-form')); } return $operations; }
/** * {@inheritdoc} */ public function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); if (isset($operations['edit'])) { $operations['edit']['query']['destination'] = $entity->url('collection'); } return $operations; }
/** * {@inheritdoc} */ public function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); if (isset($operations['edit'])) { $operations['edit']['title'] = t('Edit'); } $operations['view'] = array('title' => t('View'), 'url' => $entity->toUrl()); return $operations; }
/** * {@inheritdoc} */ public function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); foreach (array_keys($operations) as $operation) { // This is a translation UI for translators. Show the translation // operation only. if (!($operation == 'translate')) { unset($operations[$operation]); } } return $operations; }
/** * {@inheritdoc} */ protected function getDefaultOperations(EntityInterface $entity) { /** @var \Drupal\tmgmt_local\Entity\LocalTaskItem $entity */ $operations = parent::getDefaultOperations($entity); if ($entity->access('view', \Drupal::currentUser()) && $entity->getTask()->getAssignee()->id() == \Drupal::currentUser()->id()) { if ($entity->isPending()) { $operations['translate'] = ['url' => $entity->urlInfo(), 'title' => t('Translate'), 'weight' => 0]; } else { $operations['view'] = ['url' => $entity->urlInfo(), 'title' => t('View'), 'weight' => 0]; } } return $operations; }
/** * {@inheritdoc} */ protected function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); if ($entity->isSubmittable() && $entity->access('submit')) { $operations['submit'] = array('url' => $entity->urlInfo()->setOption('query', array('destination' => Url::fromRoute('<current>')->getInternalPath())), 'title' => t('Submit'), 'weight' => -10); } else { $operations['manage'] = array('url' => $entity->urlInfo()->setOption('query', array('destination' => Url::fromRoute('<current>')->getInternalPath())), 'title' => t('Manage'), 'weight' => -10); } if ($entity->isAbortable() && $entity->access('submit')) { $operations['abort'] = array('url' => $entity->urlInfo('abort-form')->setOption('query', array('destination' => Url::fromRoute('<current>')->getInternalPath())), 'title' => t('Abort'), 'weight' => 10); } return $operations; }
/** * {@inheritdoc} */ public function getDefaultOperations(EntityInterface $entity) { /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */ $operations = parent::getDefaultOperations($entity); if ($this->entityType->hasKey('status')) { if (!$entity->status() && $entity->hasLinkTemplate('enable')) { $operations['enable'] = array('title' => t('Enable'), 'weight' => -10, 'url' => $entity->urlInfo('enable')); } elseif ($entity->hasLinkTemplate('disable')) { $operations['disable'] = array('title' => t('Disable'), 'weight' => 40, 'url' => $entity->urlInfo('disable')); } } return $operations; }
/** * {@inheritdoc} */ protected function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); if ($entity->getCountTranslated() > 0 && $entity->access('accept')) { $operations['review'] = array('url' => $entity->urlInfo(), 'title' => t('Review')); } elseif (!$entity->getJob()->isUnprocessed()) { $operations['view'] = array('url' => $entity->urlInfo(), 'title' => t('View')); } // Display abort button on active or needs review job items. if ($entity->isActive() || $entity->isNeedsReview()) { $operations['abort'] = array('url' => $entity->urlInfo('abort-form')->setOption('query', array('destination' => Url::fromRoute('<current>')->getInternalPath())), 'title' => t('Abort'), 'weight' => 10); } return $operations; }
/** * {@inheritdoc} */ public function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); if (isset($operations['edit'])) { $operations['edit']['query']['destination'] = $entity->url('collection'); } if (isset($operations['delete'])) { $operations['delete']['query']['destination'] = $entity->url('collection'); } if ($entity->access('version-history') && $entity->hasLinkTemplate('version-history')) { $operations['version-history'] = ['title' => $this->t('Version history'), 'weight' => 10, 'url' => $entity->urlInfo('version-history')]; } return $operations; }
/** * {@inheritdoc} */ public function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); /* @var $transition WorkflowTransitionInterface */ $transition = $entity; if (isset($operations['edit'])) { $destination = \Drupal::destination()->getAsArray(); $operations['edit']['query'] = $destination; } return $operations; }
/** * {@inheritdoc} */ protected function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); $destination = $this->redirectDestination->getAsArray(); foreach ($operations as $key => $operation) { $operations[$key]['query'] = $destination; } return $operations; }
/** * {@inheritdoc} */ protected function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); $operations['edit']['weight'] = 0; if ($entity->access('import') && $entity->hasLinkTemplate('import-form')) { $operations['import'] = ['title' => $this->t('Import'), 'weight' => 2, 'url' => $entity->urlInfo('import-form')]; } if ($entity->access('clear') && $entity->hasLinkTemplate('clear-form')) { $operations['clear'] = ['title' => $this->t('Delete items'), 'weight' => 3, 'url' => $entity->urlInfo('clear-form')]; } $destination = $this->redirectDestination->getAsArray(); foreach ($operations as $key => $operation) { $operations[$key]['query'] = $destination; } return $operations; }
/** * {@inheritdoc} */ protected function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); if ($entity->access('view') && $entity->hasLinkTemplate('canonical')) { $operations['view'] = array('title' => $this->t('View'), 'weight' => 0, 'url' => $entity->urlInfo('canonical')); } return $operations; }
/** * {@inheritdoc} */ protected function getDefaultOperations(EntityInterface $entity) { $destination = $this->redirectDestination->get(); $operations = parent::getDefaultOperations($entity); foreach ($operations as &$operation) { $operation['query']['destination'] = $destination; } if ($entity->access('view')) { $operations['view'] = array('title' => $this->t('View'), 'weight' => -10, 'url' => $entity->urlInfo()); } if ($entity->access('update_status')) { $operations['update_status'] = array('title' => $this->t('Update status'), 'attributes' => array('class' => array('use-ajax'), 'data-accepts' => 'application/vnd.drupal-modal'), 'query' => array('destination' => $destination), 'url' => $entity->urlInfo('update-status-form')); } if ($entity->access('capture')) { $operations['capture'] = array('title' => $this->t('Capture'), 'attributes' => array('class' => array('use-ajax'), 'data-accepts' => 'application/vnd.drupal-modal'), 'query' => array('destination' => $destination), 'url' => $entity->urlInfo('capture-form')); } if ($entity->access('refund')) { $operations['refund'] = array('title' => $this->t('Refund'), 'attributes' => array('class' => array('use-ajax'), 'data-accepts' => 'application/vnd.drupal-modal'), 'query' => array('destination' => $destination), 'url' => $entity->urlInfo('refund-form')); } if ($entity->access('complete')) { $operations['complete'] = array('title' => $this->t('Complete'), 'url' => $entity->urlInfo('complete')); } return $operations; }
/** * {@inheritdoc} */ protected function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); $destination = drupal_get_destination(); foreach ($operations as $key => $operation) { $operations[$key]['query'] = $destination; } return $operations; }