public function ViewListController::getOperations

Implements \Drupal\Core\Entity\EntityListController::getOperations().

Overrides ConfigEntityListController::getOperations

File

drupal/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php, line 87
Definition of Drupal\views_ui\ViewListController.

Class

ViewListController
Provides a listing of Views.

Namespace

Drupal\views_ui

Code

public function getOperations(EntityInterface $view) {
  $definition = parent::getOperations($view);
  $uri = $view
    ->uri();
  $definition['clone'] = array(
    'title' => t('Clone'),
    'href' => $uri['path'] . '/clone',
    'options' => $uri['options'],
    'weight' => 15,
  );

  // Add AJAX functionality to enable/disable operations.
  foreach (array(
    'enable',
    'disable',
  ) as $op) {
    if (isset($definition[$op])) {
      $definition[$op]['ajax'] = TRUE;
    }
  }
  return $definition;
}