Commit 4c6e47e0 authored by merlinofchaos's avatar merlinofchaos

#138217: Made the menu tabs work properly for default views as well.

parent bc780f81
......@@ -15,6 +15,8 @@ Views 5.x-dev
o #137952: (dww) Fix some problems by not having enough options on default menu tabs.
o #130019: Use the correct filter on textarea profile fields.
o #139381: (whalebeach) Invalid call to strpos fixed in views_set_breadcrumb
o #86577: Added a form_alter to check for the profile form so that Views will invalidate its cache when profile fields are added/edited.
o #138217: Made the menu tabs work properly for default views as well.
New features:
o #132825: (lyricnz) Allow 'add comment' link as field.
......
......@@ -145,7 +145,7 @@ function views_menu_inline_items(&$items) {
function views_views_tabs($op) {
switch ($op) {
case 'names':
return array('edit', 'view', 'clone', 'export');
return array('edit', 'view', 'clone', 'export', 'add');
break;
}
}
......@@ -196,9 +196,7 @@ function views_get_all_urls() {
foreach ($default_views as $name => $view) {
if ($view->page && !$used[$name] && ($views_status[$name] == 'enabled' || (!$view->disabled && $views_status[$name] != 'disabled'))) {
if ($view->url{0} == '$' || strpos($view->url, '/$') !== FALSE) {
$views[$view->name] = $view->url;
}
}
}
cache_set("views_urls", 'cache_views', serialize($views));
......
......@@ -237,6 +237,7 @@ function _views_get_default_views() {
foreach ($views as $i => $view) {
if (!is_array($view->requires) || !array_diff($view->requires, $tables)) {
views_sanitize_view($view);
$view->is_default = TRUE;
$views_default_views[$i] = $view;
}
}
......
......@@ -168,13 +168,24 @@ function views_ui_add_menu_items(&$items, $view, $url, $base = TRUE, $args = arr
'access' => user_access('administer views'),
'weight' => -10,
'type' => MENU_DEFAULT_LOCAL_TASK);
$items[] = array('path' => "$url/edit",
'title' => t('Edit'),
'callback' => 'views_ui_admin_edit_page',
'callback arguments' => array($view->name),
'access' => user_access('administer views'),
'weight' => -5,
'type' => MENU_LOCAL_TASK);
if (isset($view->is_default)) {
$items[] = array('path' => "$url/add",
'title' => t('Override'),
'callback' => 'views_ui_admin_add_page',
'callback arguments' => array($view->name),
'access' => user_access('administer views'),
'weight' => -5,
'type' => MENU_LOCAL_TASK);
}
else {
$items[] = array('path' => "$url/edit",
'title' => t('Edit'),
'callback' => 'views_ui_admin_edit_page',
'callback arguments' => array($view->name),
'access' => user_access('administer views'),
'weight' => -5,
'type' => MENU_LOCAL_TASK);
}
$items[] = array('path' => "$url/export",
'title' => t('Export'),
'callback' => 'drupal_get_form',
......@@ -468,7 +479,7 @@ function views_ui_admin_clone_page($viewname) {
drupal_goto('admin/build/views');
}
$view = views_load_view($viewname);
$view = views_get_view($viewname);
if (!$view) {
return drupal_not_found();
}
......@@ -1893,7 +1904,7 @@ function views_tf($val) {
* This function creates view code for a view.
*/
function views_create_view_code($vid) {
$view = _views_load_view($vid);
$view = views_get_view($vid);
if (!$view) {
return t("View '%vid' not found.", array('%vid' => $vid));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment