Commit 647f3541 authored by webchick's avatar webchick
Browse files

#506124 by Bojhan: Move URL aliases path to site configuration.

parent 7c3493c4
...@@ -1258,7 +1258,7 @@ class LocalePathFunctionalTest extends DrupalWebTestCase { ...@@ -1258,7 +1258,7 @@ class LocalePathFunctionalTest extends DrupalWebTestCase {
$node = $this->drupalCreateNode(array('type' => 'page')); $node = $this->drupalCreateNode(array('type' => 'page'));
// Create a path alias in default language (English). // Create a path alias in default language (English).
$path = 'admin/build/path/add'; $path = 'admin/settings/path/add';
$english_path = $this->randomName(8); $english_path = $this->randomName(8);
$edit = array( $edit = array(
'src' => 'node/' . $node->nid, 'src' => 'node/' . $node->nid,
......
...@@ -22,9 +22,9 @@ function path_help($path, $arg) { ...@@ -22,9 +22,9 @@ function path_help($path, $arg) {
$output .= '<p>' . t('This module also provides user-defined mass URL aliasing capabilities, which is useful if you wish to uniformly use URLs different from the default. For example, you may want to have your URLs presented in a different language. Access to the Drupal source code on the web server is required to set up mass URL aliasing.') . ' </p>'; $output .= '<p>' . t('This module also provides user-defined mass URL aliasing capabilities, which is useful if you wish to uniformly use URLs different from the default. For example, you may want to have your URLs presented in a different language. Access to the Drupal source code on the web server is required to set up mass URL aliasing.') . ' </p>';
$output .= '<p>' . t('For more information, see the online handbook entry for <a href="@path">Path module</a>.', array('@path' => 'http://drupal.org/handbook/modules/path/')) . '</p>'; $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@path">Path module</a>.', array('@path' => 'http://drupal.org/handbook/modules/path/')) . '</p>';
return $output; return $output;
case 'admin/build/path': case 'admin/settings/path':
return '<p>' . t("Drupal provides complete control over URLs through aliasing, which is often used to make URLs more readable or easy to remember. For example, the alias 'about' may be mapped onto the post at the system path 'node/1', creating a more meaningful URL. Each system path can have multiple aliases.") . '</p>'; return '<p>' . t("Drupal provides complete control over URLs through aliasing, which is often used to make URLs more readable or easy to remember. For example, the alias 'about' may be mapped onto the post at the system path 'node/1', creating a more meaningful URL. Each system path can have multiple aliases.") . '</p>';
case 'admin/build/path/add': case 'admin/settings/path/add':
return '<p>' . t('Enter the path you wish to create the alias for, followed by the name of the new alias.') . '</p>'; return '<p>' . t('Enter the path you wish to create the alias for, followed by the name of the new alias.') . '</p>';
} }
} }
...@@ -33,31 +33,31 @@ function path_help($path, $arg) { ...@@ -33,31 +33,31 @@ function path_help($path, $arg) {
* Implement hook_menu(). * Implement hook_menu().
*/ */
function path_menu() { function path_menu() {
$items['admin/build/path'] = array( $items['admin/settings/path'] = array(
'title' => 'URL aliases', 'title' => 'URL aliases',
'description' => "Change your site's URL paths by aliasing them.", 'description' => "Change your site's URL paths by aliasing them.",
'page callback' => 'path_admin_overview', 'page callback' => 'path_admin_overview',
'access arguments' => array('administer url aliases'), 'access arguments' => array('administer url aliases'),
); );
$items['admin/build/path/edit'] = array( $items['admin/settings/path/edit'] = array(
'title' => 'Edit alias', 'title' => 'Edit alias',
'page callback' => 'path_admin_edit', 'page callback' => 'path_admin_edit',
'access arguments' => array('administer url aliases'), 'access arguments' => array('administer url aliases'),
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
); );
$items['admin/build/path/delete'] = array( $items['admin/settings/path/delete'] = array(
'title' => 'Delete alias', 'title' => 'Delete alias',
'page callback' => 'drupal_get_form', 'page callback' => 'drupal_get_form',
'page arguments' => array('path_admin_delete_confirm'), 'page arguments' => array('path_admin_delete_confirm'),
'access arguments' => array('administer url aliases'), 'access arguments' => array('administer url aliases'),
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
); );
$items['admin/build/path/list'] = array( $items['admin/settings/path/list'] = array(
'title' => 'List', 'title' => 'List',
'type' => MENU_DEFAULT_LOCAL_TASK, 'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10, 'weight' => -10,
); );
$items['admin/build/path/add'] = array( $items['admin/settings/path/add'] = array(
'title' => 'Add alias', 'title' => 'Add alias',
'page callback' => 'path_admin_edit', 'page callback' => 'path_admin_edit',
'access arguments' => array('administer url aliases'), 'access arguments' => array('administer url aliases'),
......
...@@ -37,7 +37,7 @@ class PathTestCase extends DrupalWebTestCase { ...@@ -37,7 +37,7 @@ class PathTestCase extends DrupalWebTestCase {
$edit = array(); $edit = array();
$edit['src'] = 'node/' . $node1->nid; $edit['src'] = 'node/' . $node1->nid;
$edit['dst'] = $this->randomName(8); $edit['dst'] = $this->randomName(8);
$this->drupalPost('admin/build/path/add', $edit, t('Create new alias')); $this->drupalPost('admin/settings/path/add', $edit, t('Create new alias'));
// Visit the system path for the node and confirm a cache entry is // Visit the system path for the node and confirm a cache entry is
// created. // created.
...@@ -62,7 +62,7 @@ class PathTestCase extends DrupalWebTestCase { ...@@ -62,7 +62,7 @@ class PathTestCase extends DrupalWebTestCase {
$edit = array(); $edit = array();
$edit['src'] = 'node/' . $node1->nid; $edit['src'] = 'node/' . $node1->nid;
$edit['dst'] = $this->randomName(8); $edit['dst'] = $this->randomName(8);
$this->drupalPost('admin/build/path/add', $edit, t('Create new alias')); $this->drupalPost('admin/settings/path/add', $edit, t('Create new alias'));
// Confirm that the alias works. // Confirm that the alias works.
$this->drupalGet($edit['dst']); $this->drupalGet($edit['dst']);
...@@ -73,7 +73,7 @@ class PathTestCase extends DrupalWebTestCase { ...@@ -73,7 +73,7 @@ class PathTestCase extends DrupalWebTestCase {
$previous = $edit['dst']; $previous = $edit['dst'];
$edit['dst'] = $this->randomName(8); $edit['dst'] = $this->randomName(8);
$this->drupalPost('admin/build/path/edit/' . $pid, $edit, t('Update alias')); $this->drupalPost('admin/settings/path/edit/' . $pid, $edit, t('Update alias'));
// Confirm that the alias works. // Confirm that the alias works.
$this->drupalGet($edit['dst']); $this->drupalGet($edit['dst']);
...@@ -90,13 +90,13 @@ class PathTestCase extends DrupalWebTestCase { ...@@ -90,13 +90,13 @@ class PathTestCase extends DrupalWebTestCase {
// Set alias to second test node. // Set alias to second test node.
$edit['src'] = 'node/' . $node2->nid; $edit['src'] = 'node/' . $node2->nid;
// leave $edit['dst'] the same // leave $edit['dst'] the same
$this->drupalPost('admin/build/path/add', $edit, t('Create new alias')); $this->drupalPost('admin/settings/path/add', $edit, t('Create new alias'));
// Confirm no duplicate was created. // Confirm no duplicate was created.
$this->assertRaw(t('The alias %alias is already in use in this language.', array('%alias' => $edit['dst'])), 'Attempt to move alias was rejected.'); $this->assertRaw(t('The alias %alias is already in use in this language.', array('%alias' => $edit['dst'])), 'Attempt to move alias was rejected.');
// Delete alias. // Delete alias.
$this->drupalPost('admin/build/path/delete/' . $pid, array(), t('Confirm')); $this->drupalPost('admin/settings/path/delete/' . $pid, array(), t('Confirm'));
// Confirm that the alias no longer works. // Confirm that the alias no longer works.
$this->drupalGet($edit['dst']); $this->drupalGet($edit['dst']);
......
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