Commit 101d5209 authored by Dries's avatar Dries

- Patch #508570 by quicksketch, sun | pwolanin, bec: restore URL consistency...

- Patch #508570 by quicksketch, sun | pwolanin, bec: restore URL consistency for node types and menus.
parent 65bb91c9
......@@ -98,7 +98,7 @@ class ForumTestCase extends DrupalWebTestCase {
// Add forum to navigation menu.
$edit = array();
$this->drupalPost('admin/structure/menu-customize/navigation', $edit, t('Save configuration'));
$this->drupalPost('admin/structure/menu/manage/navigation', $edit, t('Save configuration'));
$this->assertResponse(200);
// Edit forum taxonomy.
......
......@@ -1359,12 +1359,12 @@ class LocaleContentFunctionalTest extends DrupalWebTestCase {
$this->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings'));
// Set page content type to use multilingual support.
$this->drupalGet('admin/structure/node-type/page');
$this->drupalGet('admin/structure/types/manage/page');
$this->assertText(t('Multilingual support'), t('Multilingual support fieldset present on content type configuration form.'));
$edit = array(
'language_content_type' => 1,
);
$this->drupalPost('admin/structure/node-type/page', $edit, t('Save content type'));
$this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
$this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Page')), t('Page content type has been updated.'));
$this->drupalLogout();
......
......@@ -15,9 +15,9 @@ function menu_overview_page() {
$rows = array();
foreach ($result as $menu) {
$row = array(theme('menu_admin_overview', $menu['title'], $menu['menu_name'], $menu['description']));
$row[] = array('data' => l(t('list links'), 'admin/structure/menu-customize/' . $menu['menu_name']));
$row[] = array('data' => l(t('edit menu'), 'admin/structure/menu-customize/' . $menu['menu_name'] . '/edit'));
$row[] = array('data' => l(t('add link'), 'admin/structure/menu-customize/' . $menu['menu_name'] . '/add'));
$row[] = array('data' => l(t('list links'), 'admin/structure/menu/manage/' . $menu['menu_name']));
$row[] = array('data' => l(t('edit menu'), 'admin/structure/menu/manage/' . $menu['menu_name'] . '/edit'));
$row[] = array('data' => l(t('add link'), 'admin/structure/menu/manage/' . $menu['menu_name'] . '/add'));
$rows[] = $row;
}
......@@ -69,7 +69,7 @@ function menu_overview_form($form, &$form_state, $menu) {
);
}
else {
$form['#empty_text'] = t('There are no menu links yet. <a href="@link">Add link</a>.', array('@link' => url('admin/structure/menu-customize/'. $form['#menu']['menu_name'] .'/add')));
$form['#empty_text'] = t('There are no menu links yet. <a href="@link">Add link</a>.', array('@link' => url('admin/structure/menu/manage/'. $form['#menu']['menu_name'] .'/add')));
}
return $form;
}
......@@ -398,7 +398,7 @@ function menu_edit_item_submit($form, &$form_state) {
if (!menu_link_save($item)) {
drupal_set_message(t('There was an error saving the menu link.'), 'error');
}
$form_state['redirect'] = 'admin/structure/menu-customize/' . $item['menu_name'];
$form_state['redirect'] = 'admin/structure/menu/manage/' . $item['menu_name'];
}
/**
......@@ -478,7 +478,7 @@ function menu_edit_menu($form, &$form_state, $type, $menu = array()) {
* Submit function for the 'Delete' button on the menu editing form.
*/
function menu_custom_delete_submit($form, &$form_state) {
$form_state['redirect'] = 'admin/structure/menu-customize/' . $form_state['values']['menu_name'] . '/delete';
$form_state['redirect'] = 'admin/structure/menu/manage/' . $form_state['values']['menu_name'] . '/delete';
}
/**
......@@ -505,7 +505,7 @@ function menu_delete_menu_confirm($form, &$form_state, $menu) {
$caption .= '<p>' . format_plural($num_links, '<strong>Warning:</strong> There is currently 1 menu link in %title. It will be deleted (system-defined items will be reset).', '<strong>Warning:</strong> There are currently @count menu links in %title. They will be deleted (system-defined links will be reset).', array('%title' => $menu['title'])) . '</p>';
}
$caption .= '<p>' . t('This action cannot be undone.') . '</p>';
return confirm_form($form, t('Are you sure you want to delete the custom menu %title?', array('%title' => $menu['title'])), 'admin/structure/menu-customize/' . $menu['menu_name'], $caption, t('Delete'));
return confirm_form($form, t('Are you sure you want to delete the custom menu %title?', array('%title' => $menu['title'])), 'admin/structure/menu/manage/' . $menu['menu_name'], $caption, t('Delete'));
}
/**
......@@ -525,7 +525,7 @@ function menu_delete_menu_confirm_submit($form, &$form_state) {
menu_reset_item($item);
}
// Delete all links to the overview page for this menu.
$result = db_query("SELECT mlid FROM {menu_links} ml WHERE ml.link_path = :link", array(':link' => 'admin/structure/menu-customize/' . $menu['menu_name']), array('fetch' => PDO::FETCH_ASSOC));
$result = db_query("SELECT mlid FROM {menu_links} ml WHERE ml.link_path = :link", array(':link' => 'admin/structure/menu/manage/' . $menu['menu_name']), array('fetch' => PDO::FETCH_ASSOC));
foreach ($result as $m) {
menu_link_delete($m['mlid']);
}
......@@ -582,7 +582,7 @@ function menu_edit_menu_validate($form, &$form_state) {
*/
function menu_edit_menu_submit($form, &$form_state) {
$menu = $form_state['values'];
$path = 'admin/structure/menu-customize/';
$path = 'admin/structure/menu/manage/';
if ($form['#insert']) {
// Add 'menu-' to the menu name to help avoid name-space conflicts.
$menu['menu_name'] = 'menu-' . $menu['menu_name'];
......@@ -641,7 +641,7 @@ function menu_item_delete_page($item) {
*/
function menu_item_delete_form($form, &$form_state, $item) {
$form['#item'] = $item;
return confirm_form($form, t('Are you sure you want to delete the custom menu link %item?', array('%item' => $item['link_title'])), 'admin/structure/menu-customize/' . $item['menu_name']);
return confirm_form($form, t('Are you sure you want to delete the custom menu link %item?', array('%item' => $item['link_title'])), 'admin/structure/menu/manage/' . $item['menu_name']);
}
/**
......@@ -653,7 +653,7 @@ function menu_item_delete_form_submit($form, &$form_state) {
$t_args = array('%title' => $item['link_title']);
drupal_set_message(t('The menu link %title has been deleted.', $t_args));
watchdog('menu', 'Deleted menu link %title.', $t_args, WATCHDOG_NOTICE);
$form_state['redirect'] = 'admin/structure/menu-customize/' . $item['menu_name'];
$form_state['redirect'] = 'admin/structure/menu/manage/' . $item['menu_name'];
}
/**
......@@ -661,7 +661,7 @@ function menu_item_delete_form_submit($form, &$form_state) {
*/
function menu_reset_item_confirm($form, &$form_state, $item) {
$form['item'] = array('#type' => 'value', '#value' => $item);
return confirm_form($form, t('Are you sure you want to reset the link %item to its default values?', array('%item' => $item['link_title'])), 'admin/structure/menu-customize/' . $item['menu_name'], t('Any customizations will be lost. This action cannot be undone.'), t('Reset'));
return confirm_form($form, t('Are you sure you want to reset the link %item to its default values?', array('%item' => $item['link_title'])), 'admin/structure/menu/manage/' . $item['menu_name'], t('Any customizations will be lost. This action cannot be undone.'), t('Reset'));
}
/**
......@@ -671,7 +671,7 @@ function menu_reset_item_confirm_submit($form, &$form_state) {
$item = $form_state['values']['item'];
$new_item = menu_reset_item($item);
drupal_set_message(t('The menu link was reset to its default settings.'));
$form_state['redirect'] = 'admin/structure/menu-customize/' . $new_item['menu_name'];
$form_state['redirect'] = 'admin/structure/menu/manage/' . $new_item['menu_name'];
}
/**
......
......@@ -78,41 +78,41 @@ function menu_menu() {
'weight' => 5,
'file' => 'menu.admin.inc',
);
$items['admin/structure/menu-customize/%menu'] = array(
$items['admin/structure/menu/manage/%menu'] = array(
'title' => 'Customize menu',
'page callback' => 'drupal_get_form',
'page arguments' => array('menu_overview_form', 3),
'page arguments' => array('menu_overview_form', 4),
'title callback' => 'menu_overview_title',
'title arguments' => array(3),
'title arguments' => array(4),
'access arguments' => array('administer menu'),
'type' => MENU_CALLBACK,
'file' => 'menu.admin.inc',
);
$items['admin/structure/menu-customize/%menu/list'] = array(
$items['admin/structure/menu/manage/%menu/list'] = array(
'title' => 'List links',
'weight' => -10,
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['admin/structure/menu-customize/%menu/add'] = array(
$items['admin/structure/menu/manage/%menu/add'] = array(
'title' => 'Add link',
'page callback' => 'drupal_get_form',
'page arguments' => array('menu_edit_item', 'add', NULL, 3),
'page arguments' => array('menu_edit_item', 'add', NULL, 4),
'access arguments' => array('administer menu'),
'type' => MENU_LOCAL_ACTION,
'file' => 'menu.admin.inc',
);
$items['admin/structure/menu-customize/%menu/edit'] = array(
$items['admin/structure/menu/manage/%menu/edit'] = array(
'title' => 'Edit menu',
'page callback' => 'drupal_get_form',
'page arguments' => array('menu_edit_menu', 'edit', 3),
'page arguments' => array('menu_edit_menu', 'edit', 4),
'access arguments' => array('administer menu'),
'type' => MENU_LOCAL_TASK,
'file' => 'menu.admin.inc',
);
$items['admin/structure/menu-customize/%menu/delete'] = array(
$items['admin/structure/menu/manage/%menu/delete'] = array(
'title' => 'Delete menu',
'page callback' => 'menu_delete_menu_page',
'page arguments' => array(3),
'page arguments' => array(4),
'access arguments' => array('administer menu'),
'type' => MENU_CALLBACK,
'file' => 'menu.admin.inc',
......@@ -168,7 +168,7 @@ function menu_theme() {
function menu_enable() {
menu_rebuild();
$base_link = db_query("SELECT mlid AS plid, menu_name FROM {menu_links} WHERE link_path = 'admin/structure/menu' AND module = 'system'")->fetchAssoc();
$base_link['router_path'] = 'admin/structure/menu-customize/%';
$base_link['router_path'] = 'admin/structure/menu/manage/%';
$base_link['module'] = 'menu';
$result = db_query("SELECT * FROM {menu_custom}", array(), array('fetch' => PDO::FETCH_ASSOC));
foreach ($result as $menu) {
......@@ -176,7 +176,7 @@ function menu_enable() {
$link = $base_link;
$link['mlid'] = 0;
$link['link_title'] = $menu['title'];
$link['link_path'] = 'admin/structure/menu-customize/' . $menu['menu_name'];
$link['link_path'] = 'admin/structure/menu/manage/' . $menu['menu_name'];
$menu_link = db_query("SELECT mlid FROM {menu_links} WHERE link_path = :path AND plid = :plid", array(
':path' => $link['link_path'],
':plid' => $link['plid']
......
......@@ -148,7 +148,7 @@ class MenuTestCase extends DrupalWebTestCase {
$title = $this->menu['title'];
// Delete custom menu.
$this->drupalPost("admin/structure/menu-customize/$menu_name/delete", array(), t('Delete'));
$this->drupalPost("admin/structure/menu/manage/$menu_name/delete", array(), t('Delete'));
$this->assertResponse(200);
$this->assertRaw(t('The custom menu %title has been deleted.', array('%title' => $title)), t('Custom menu was deleted'));
$this->assertFalse(menu_load($menu_name), 'Custom menu was deleted');
......@@ -186,7 +186,7 @@ class MenuTestCase extends DrupalWebTestCase {
// Note in the UI the 'mlid:x[hidden]' form element maps to enabled, or
// NOT hidden.
$edit['mlid:' . $item1['mlid'] . '[hidden]'] = TRUE;
$this->drupalPost('admin/structure/menu-customize/' . $item1['menu_name'], $edit, t('Save configuration'));
$this->drupalPost('admin/structure/menu/manage/' . $item1['menu_name'], $edit, t('Save configuration'));
// Verify in the database.
$hidden = db_query("SELECT hidden FROM {menu_links} WHERE mlid = :mlid", array(':mlid' => $item1['mlid']))->fetchField();
......@@ -207,7 +207,7 @@ class MenuTestCase extends DrupalWebTestCase {
*/
function addMenuLink($plid = 0, $link = '<front>', $menu_name = 'navigation') {
// View add menu link page.
$this->drupalGet("admin/structure/menu-customize/$menu_name/add");
$this->drupalGet("admin/structure/menu/manage/$menu_name/add");
$this->assertResponse(200);
$title = '!link_' . $this->randomName(16);
......@@ -222,7 +222,7 @@ class MenuTestCase extends DrupalWebTestCase {
);
// Add menu link.
$this->drupalPost("admin/structure/menu-customize/$menu_name/add", $edit, t('Save'));
$this->drupalPost("admin/structure/menu/manage/$menu_name/add", $edit, t('Save'));
$this->assertResponse(200);
// Unlike most other modules, there is no confirmation message displayed.
......@@ -259,7 +259,7 @@ class MenuTestCase extends DrupalWebTestCase {
'menu[link_path]' => $link_path,
'menu[link_title]' => 'title',
);
$this->drupalPost("admin/structure/menu-customize/$menu_name/add", $edit, t('Save'));
$this->drupalPost("admin/structure/menu/manage/$menu_name/add", $edit, t('Save'));
$this->assertRaw(t("The path '@path' is either invalid or you do not have access to it.", array('@path' => $link_path)), 'Menu link was not created');
}
}
......@@ -318,7 +318,7 @@ class MenuTestCase extends DrupalWebTestCase {
// Unlike most other modules, there is no confirmation message displayed.
// Verify menu link.
$this->drupalGet('admin/structure/menu-customize/' . $item['menu_name']);
$this->drupalGet('admin/structure/menu/manage/' . $item['menu_name']);
$this->assertText($title, 'Menu link was edited');
}
......@@ -452,7 +452,7 @@ class MenuTestCase extends DrupalWebTestCase {
}
// View navigation menu customization node.
$this->drupalGet('admin/structure/menu-customize/navigation');
$this->drupalGet('admin/structure/menu/manage/navigation');
$this->assertResponse($response);
if ($response == 200) {
$this->assertText(t('Navigation'), t('Navigation menu node was displayed'));
......
......@@ -21,11 +21,11 @@ function node_overview_types() {
$type_url_str = str_replace('_', '-', $type->type);
$row = array(theme('node_admin_overview', $name, $type));
// Set the edit column.
$row[] = array('data' => l(t('edit'), 'admin/structure/node-type/' . $type_url_str));
$row[] = array('data' => l(t('edit'), 'admin/structure/types/manage/' . $type_url_str));
// Set the delete column.
if ($type->custom) {
$row[] = array('data' => l(t('delete'), 'admin/structure/node-type/' . $type_url_str . '/delete'));
$row[] = array('data' => l(t('delete'), 'admin/structure/types/manage/' . $type_url_str . '/delete'));
}
else {
$row[] = array('data' => '');
......@@ -316,7 +316,7 @@ function node_type_form_submit($form, &$form_state) {
$type->locked = $form_state['values']['locked'];
if ($op == t('Delete content type')) {
$form_state['redirect'] = 'admin/structure/node-type/' . str_replace('_', '-', $type->old_type) . '/delete';
$form_state['redirect'] = 'admin/structure/types/manage/' . str_replace('_', '-', $type->old_type) . '/delete';
return;
}
......
......@@ -92,13 +92,13 @@ function node_help($path, $arg) {
case 'admin/structure/types/add':
return '<p>' . t('Each piece of content is of a specific content type. Each <em>content type</em> can have different fields, behaviors, and permissions assigned to it.') . '</p>';
case 'admin/structure/node-type/' . $arg[3] . '/fields':
case 'admin/structure/types/manage/' . $arg[3] . '/fields':
return '<p>' . t('This form lets you add, edit, and arrange fields within the %type content type.', array('%type' => node_type_get_name($arg[3]))) . '</p>';
case 'admin/structure/node-type/' . $arg[3] . '/display':
case 'admin/structure/types/manage/' . $arg[3] . '/display':
return '<p>' . t('This form lets you configure how fields and labels are displayed when %type content is viewed in teaser and full-page mode.', array('%type' => node_type_get_name($arg[3]))) . '</p>';
case 'admin/structure/node-type/' . $arg[3] . '/display/' . $arg[5]:
case 'admin/structure/types/manage/' . $arg[3] . '/display/' . $arg[5]:
return '<p>' . t('This form lets you configure how fields should be displayed when rendered %type content in the following contexts.', array('%type' => node_type_get_name($arg[3]))) . '</p>';
case 'node/%/revisions':
......@@ -200,7 +200,7 @@ function node_entity_info() {
$return['node']['bundles'][$type] = array(
'label' => $name,
'admin' => array(
'path' => 'admin/structure/node-type/' . str_replace('_', '-', $type),
'path' => 'admin/structure/types/manage/' . str_replace('_', '-', $type),
'access arguments' => array('administer content types'),
),
);
......@@ -1675,7 +1675,7 @@ function node_menu() {
'description' => $type->description,
'file' => 'node.pages.inc',
);
$items['admin/structure/node-type/' . $type_url_str] = array(
$items['admin/structure/types/manage/' . $type_url_str] = array(
'title' => $type->name,
'page callback' => 'drupal_get_form',
'page arguments' => array('node_type_form', $type),
......@@ -1683,11 +1683,11 @@ function node_menu() {
'type' => MENU_CALLBACK,
'file' => 'content_types.inc',
);
$items['admin/structure/node-type/' . $type_url_str . '/edit'] = array(
$items['admin/structure/types/manage/' . $type_url_str . '/edit'] = array(
'title' => 'Edit',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['admin/structure/node-type/' . $type_url_str . '/delete'] = array(
$items['admin/structure/types/manage/' . $type_url_str . '/delete'] = array(
'title' => 'Delete',
'page arguments' => array('node_type_delete_confirm', $type),
'access arguments' => array('administer content types'),
......
......@@ -424,7 +424,7 @@ class SummaryLengthTestCase extends DrupalWebTestCase {
$edit = array (
'teaser_length' => 200,
);
$this->drupalPost('admin/structure/node-type/page', $edit, t('Save content type'));
$this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
// Attempt to access the front page again and check if the summary is now only 200 characters in length.
$this->drupalGet("node");
$this->assertNoRaw($expected, t('Check that the summary is not longer than 200 characters'), 'Node');
......@@ -522,7 +522,7 @@ class NodePostSettingsTestCase extends DrupalWebTestCase {
// Set page content type to display post information.
$edit = array();
$edit['node_submitted'] = TRUE;
$this->drupalPost('admin/structure/node-type/page', $edit, t('Save content type'));
$this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
// Create a node.
$edit = array();
......@@ -544,7 +544,7 @@ class NodePostSettingsTestCase extends DrupalWebTestCase {
// Set page content type to display post information.
$edit = array();
$edit['node_submitted'] = FALSE;
$this->drupalPost('admin/structure/node-type/page', $edit, t('Save content type'));
$this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
// Create a node.
$edit = array();
......
......@@ -31,10 +31,10 @@ class TranslationTestCase extends DrupalWebTestCase {
$this->addLanguage('es');
// Set page content type to use multilingual support with translation.
$this->drupalGet('admin/structure/node-type/page');
$this->drupalGet('admin/structure/types/manage/page');
$edit = array();
$edit['language_content_type'] = 2;
$this->drupalPost('admin/structure/node-type/page', $edit, t('Save content type'));
$this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
$this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Page')), t('Page content type has been updated.'));
$this->drupalLogout();
......
......@@ -206,7 +206,7 @@ function default_install() {
menu_rebuild();
// Save some default links.
$link = array('link_path' => 'admin/structure/menu-customize/main-menu/add', 'link_title' => 'Add a main menu link', 'menu_name' => 'main-menu');
$link = array('link_path' => 'admin/structure/menu/manage/main-menu/add', 'link_title' => 'Add a main menu link', 'menu_name' => 'main-menu');
menu_link_save($link);
// Enable the admin theme.
......
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