1 views_ui.admin.inc | _views_ui_get_operations(view $view) |
Given a view, return a list of operations that can be performed on it.
File
- core/
modules/ views_ui/ views_ui.admin.inc, line 332 - Admin page callbacks for the Views UI module.
Code
function _views_ui_get_operations(view $view) {
$links = array();
if ($view->disabled) {
$links['enable'] = array(
'title' => t('Enable'),
'href' => 'admin/structure/views/view/' . $view->name . '/enable',
'query' => array('token' => backdrop_get_token($view->name)),
);
}
$links['configure'] = array(
'title' => t('Configure'),
'href' => 'admin/structure/views/view/' . $view->name,
);
$links['clone'] = array(
'title' => t('Clone'),
'href' => 'admin/structure/views/view/' . $view->name . '/clone',
);
if (!$view->disabled) {
$links['disable'] = array(
'title' => t('Disable'),
'href' => 'admin/structure/views/view/' . $view->name . '/disable',
'query' => array('token' => backdrop_get_token($view->name)),
);
}
if ($view->storage == VIEWS_STORAGE_NORMAL) {
$links['delete'] = array(
'title' => t('Delete'),
'href' => 'admin/structure/views/view/' . $view->name . '/delete',
);
}
elseif ($view->storage == VIEWS_STORAGE_OVERRIDE) {
$links['revert'] = array(
'title' => t('Revert'),
'href' => 'admin/structure/views/view/' . $view->name . '/revert',
);
}
if (module_exists('config') && user_access('synchronize configuration')) {
$links['export'] = array(
'title' => t('Export'),
'href' => 'admin/config/development/configuration/single/export',
'query' => array(
'group' => 'Views',
'name' => 'views.view.' . $view->name,
),
);
}
return $links;
}