Implements Drupal\Core\Entity\EntityListController::getOperations();
Overrides EntityListController::getOperations
public function getOperations(EntityInterface $view) {
$uri = $view
->uri();
$path = $uri['path'];
$definition['edit'] = array(
'title' => t('Edit'),
'href' => "{$path}/edit",
'weight' => -5,
);
if (!$view
->isEnabled()) {
$definition['enable'] = array(
'title' => t('Enable'),
'ajax' => TRUE,
'token' => TRUE,
'href' => "{$path}/enable",
'weight' => -10,
);
}
else {
$definition['disable'] = array(
'title' => t('Disable'),
'ajax' => TRUE,
'token' => TRUE,
'href' => "{$path}/disable",
'weight' => 0,
);
}
// This property doesn't exist yet.
if (!empty($view->overridden)) {
$definition['revert'] = array(
'title' => t('Revert'),
'href' => "{$path}/revert",
'weight' => 5,
);
}
else {
$definition['delete'] = array(
'title' => t('Delete'),
'href' => "{$path}/delete",
'weight' => 10,
);
}
$definition['clone'] = array(
'title' => t('Clone'),
'href' => "{$path}/clone",
'weight' => 15,
);
return $definition;
}