示例#1
0
  /**
   * {@inheritdoc}
   */
  public function getDefaultOperations(EntityInterface $entity) {
    $operations = parent::getDefaultOperations($entity);

    if (isset($operations['edit'])) {
      $operations['edit']['title'] = t('Edit profile');
    }

    $operations['matchers'] = [
      'title' => t('Manage matchers'),
      'weight' => 10,
      'url' => Url::fromRoute('linkit.matchers', [
        'linkit_profile' => $entity->id()
      ]),
    ];

    $operations['attributes'] = [
      'title' => t('Manage attributes'),
      'weight' => 20,
      'url' => Url::fromRoute('linkit.attributes', [
        'linkit_profile' => $entity->id()
      ]),
    ];

    return $operations;
  }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\commerce_tax\Entity\TaxRateInterface $entity */
     $operations = parent::getDefaultOperations($entity);
     $operations['rate_amounts'] = ['title' => $this->t('View rate amounts'), 'url' => Url::fromRoute('entity.commerce_tax_rate_amount.collection', ['commerce_tax_rate' => $entity->id()])];
     return $operations;
 }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
     $operations = parent::getDefaultOperations($entity);
     $operations['set_default'] = array('title' => t('Set Default'), 'weight' => -10, 'url' => $entity->urlInfo('set-default'));
     return $operations;
 }
 /**
  * Defines the default operations.
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     // Add an operation for adding a new entity object of this type.
     $url = new Url('mymodule.myentity.add', array('myentity_type' => $entity->id()));
     $operations['add_new'] = array('title' => $this->t('Add new My Entity'), 'weight' => 11, 'url' => $url);
     return $operations;
 }
 /**
  * Gets this list's default operations.
  *
  * @param \Drupal\Core\Entity\EntityInterface $entity
  *   The entity the operations are for.
  *
  * @return array
  *   The array structure is identical to the return value of
  *   self::getOperations().
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity->access('backups') && $entity->hasLinkTemplate('backups')) {
         $operations['backups'] = array('title' => $this->t('List Backups'), 'weight' => 100, 'url' => $entity->toUrl('backups'));
     }
     return $operations;
 }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['title'] = t('Edit grade letter set');
     }
     $operations['list'] = array('title' => t('List grade letters'), 'url' => $entity->toUrl('list-form'));
     return $operations;
 }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $ops = parent::getDefaultOperations($entity);
     // Do not allow deletion of the default configuration.
     if ($entity->id() == 'default') {
         unset($ops['delete']);
     }
     return $ops;
 }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\field\FieldInstanceConfigInterface $entity */
     $operations = parent::getDefaultOperations($entity);
     $operations['storage-settings'] = array('title' => $this->t('Field settings'), 'weight' => 20, 'attributes' => array('title' => $this->t('Edit field settings.'))) + $entity->urlInfo('storage-edit-form')->toArray();
     $operations['edit']['attributes']['title'] = $this->t('Edit instance settings.');
     $operations['delete']['attributes']['title'] = $this->t('Delete instance.');
     return $operations;
 }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\field\FieldConfigInterface $entity */
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['weight'] = 30;
     }
     return $operations;
 }
示例#10
0
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['title'] = t('Edit shortcut set');
     }
     $operations['list'] = array('title' => t('List links'), 'url' => $entity->urlInfo('customize-form'));
     return $operations;
 }
示例#11
0
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity instanceof IndexInterface) {
         $route_parameters['search_api_index'] = $entity->id();
         $operations['fields'] = array('title' => $this->t('Fields'), 'weight' => 20, 'url' => new Url('entity.search_api_index.fields', $route_parameters));
         $operations['processors'] = array('title' => $this->t('Processors'), 'weight' => 30, 'url' => new Url('entity.search_api_index.processors', $route_parameters));
     }
     return $operations;
 }
示例#12
0
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
     $operations = parent::getDefaultOperations($entity);
     $ratesRoute = Url::fromRoute('entity.commerce_tax_rate.collection', ['commerce_tax_type' => $entity->getId()]);
     $addRateRoute = Url::fromRoute('entity.commerce_tax_rate.add_form', ['commerce_tax_type' => $entity->getId()]);
     $operations['rates'] = ['title' => $this->t('View rates'), 'url' => $ratesRoute];
     $operations['add_rate'] = ['title' => $this->t('Add rate'), 'url' => $addRateRoute];
     return $operations;
 }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     // Place the edit operation after the operations added by field_ui.module
     // which have the weights 15, 20, 25.
     if (isset($operations['edit'])) {
         $operations['edit']['weight'] = 30;
     }
     return $operations;
 }
示例#14
0
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
     $operations = parent::getDefaultOperations($entity);
     $message = 'Set Default';
     if ($entity->getServiceDefault()) {
         $message = 'Unset Default';
     }
     $operations['set_default'] = array('title' => t($message), 'weight' => 10, 'url' => $entity->urlInfo('set-default'));
     return $operations;
 }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity->hasLinkTemplate('edit-form')) {
         $operations['edit'] = array('title' => t('Edit schedule'), 'weight' => 20, 'url' => $entity->urlInfo('edit-form'));
     }
     if ($entity->hasLinkTemplate('delete-form')) {
         $operations['delete'] = array('title' => t('Delete schedule'), 'weight' => 30, 'url' => $entity->urlInfo('delete-form'));
     }
     return $operations;
 }
示例#16
0
 /**
  * {@inheritDoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $mollom_form = $entity->initialize();
     $operations = parent::getDefaultOperations($entity);
     if (!empty($mollom_form['orphan'])) {
         drupal_set_message(t("%module module's %form_id form no longer exists.", ['%form_id' => $entity->id(), '%module' => $entity->module]), 'warning');
         unset($operations['edit']);
     }
     $operations['delete']['title'] = t('Unprotect');
     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;
 }
示例#18
0
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['title'] = t('Edit menu');
         $operations['add'] = array('title' => t('Add link'), 'weight' => 20) + $entity->urlInfo('add-link-form')->toArray();
     }
     if (isset($operations['delete'])) {
         $operations['delete']['title'] = t('Delete menu');
     }
     return $operations;
 }
示例#19
0
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity instanceof FacetInterface) {
         if ($entity->access('update') && $entity->hasLinkTemplate('edit-form')) {
             $operations['edit'] = array('title' => $this->t('Edit'), 'weight' => 10, 'url' => $entity->toUrl('edit-form'));
         }
         if ($entity->access('update') && $entity->hasLinkTemplate('settings-form')) {
             $operations['settings'] = array('title' => $this->t('Facet settings'), 'weight' => 20, 'url' => $entity->toUrl('settings-form'));
         }
         if ($entity->access('delete') && $entity->hasLinkTemplate('delete-form')) {
             $operations['delete'] = array('title' => $this->t('Delete'), 'weight' => 100, 'url' => $entity->toUrl('delete-form'));
         }
     }
     return $operations;
 }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\rng\EventTypeInterface $entity **/
     $operations = parent::getDefaultOperations($entity);
     if ($this->moduleHandler->moduleExists('field_ui')) {
         $entity_type = \Drupal::entityManager()->getDefinition($entity->getEventEntityTypeId());
         if ($entity_type->get('field_ui_base_route')) {
             $options = [];
             if ($entity_type->getBundleEntityType() !== 'bundle') {
                 $options[$entity_type->getBundleEntityType()] = $entity->getEventBundle();
             }
             $operations['manage-fields'] = ['title' => t('Event setting defaults'), 'weight' => 15, 'url' => Url::fromRoute("entity." . $entity->getEventEntityTypeId() . ".field_ui_fields", $options)];
         }
     }
     return $operations;
 }
示例#21
0
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     /* @var $workflow \Drupal\workflow\Entity\Workflow */
     $workflow = $entity;
     // Do not delete a Workflow if it contains content.
     if (isset($operations['delete']) && !$workflow->isDeletable()) {
         unset($operations['delete']);
     }
     /**
      * Allow modules to insert their own workflow operations to the list.
      */
     // This is what EntityListBuilder::getOperations() does:
     // $operations = $this->getDefaultOperations($entity);
     // $operations += $this->moduleHandler()->invokeAll('entity_operation', array($entity));
     // $this->moduleHandler->alter('entity_operation', $operations, $entity);
     // In D8, the interface of below hook_workflow_operations has changed a bit.
     // @see EntityListBuilder::getOperations, workflow_operations, workflow.api.php.
     $operations += $this->moduleHandler()->invokeAll('workflow_operations', array('workflow', $workflow));
     return $operations;
 }
 /**
  * {@inheritDoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     $operations['delete']['title'] = t('Unprotect');
     return $operations;
 }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     $operations['duplicate'] = array('title' => t('Duplicate'), 'weight' => 15, 'url' => $entity->urlInfo('duplicate-form'));
     return $operations;
 }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(MigrationInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     $migration_group = $entity->get('migration_group');
     if (!$migration_group) {
         $migration_group = 'default';
     }
     //    $this->addGroupParameter($operations['edit']['url'], $migration_group);
     $this->addGroupParameter($operations['delete']['url'], $migration_group);
     return $operations;
 }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['title'] = $this->t('Configure');
     }
     return $operations;
 }
示例#26
0
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity->hasLinkTemplate('duplicate-form')) {
         $operations['duplicate'] = array('title' => $this->t('Duplicate'), 'weight' => 15, 'url' => $entity->urlInfo('duplicate-form'));
     }
     // Add AJAX functionality to enable/disable operations.
     foreach (array('enable', 'disable') as $op) {
         if (isset($operations[$op])) {
             $operations[$op]['url'] = $entity->urlInfo($op);
             // Enable and disable operations should use AJAX.
             $operations[$op]['attributes']['class'][] = 'use-ajax';
         }
     }
     return $operations;
 }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $flush = array('title' => t('Flush'), 'weight' => 200) + $entity->urlInfo('flush-form')->toArray();
     return parent::getDefaultOperations($entity) + array('flush' => $flush);
 }
示例#28
0
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $imce_profile)
 {
     $operations = parent::getDefaultOperations($imce_profile);
     $operations['duplicate'] = array('title' => t('Duplicate'), 'weight' => 15, 'url' => $imce_profile->toUrl('duplicate-form'));
     return $operations;
 }
示例#29
0
  /**
   * {@inheritdoc}
   */
  public function getDefaultOperations(EntityInterface $entity) {
    $operations = parent::getDefaultOperations($entity);

    $operations['edit']['title'] = $this->t('Configure');

    // Add AJAX functionality to enable/disable operations.
    foreach (array('enable', 'disable') as $op) {
      if (isset($operations[$op])) {
        $operations[$op]['url'] = $entity->urlInfo($op);
        // Enable and disable operations should use AJAX.
        $operations[$op]['attributes']['class'][] = 'use-ajax';
      }
    }

    // Allow queue handlers to add their own operations.
    $operations += $entity->getHandlerPlugin()->getQueueListBuilderOperations();

    return $operations;
  }
 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     foreach (array('enable', 'disable') as $operation) {
         if (!$entity->access($operation)) {
             unset($operations[$operation]);
         }
     }
     if ($entity->access('duplicate')) {
         $operations['duplicate'] = array('title' => $this->t('Duplicate'), 'weight' => 99, 'url' => $entity->urlInfo('duplicate-form'));
     }
     return $operations;
 }