#506124 by Bojhan: Move URL aliases path to site configuration.
parent
7c3493c45b
commit
647f3541ae
|
@ -1258,7 +1258,7 @@ class LocalePathFunctionalTest extends DrupalWebTestCase {
|
|||
$node = $this->drupalCreateNode(array('type' => 'page'));
|
||||
|
||||
// Create a path alias in default language (English).
|
||||
$path = 'admin/build/path/add';
|
||||
$path = 'admin/settings/path/add';
|
||||
$english_path = $this->randomName(8);
|
||||
$edit = array(
|
||||
'src' => 'node/' . $node->nid,
|
||||
|
|
|
@ -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('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;
|
||||
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>';
|
||||
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>';
|
||||
}
|
||||
}
|
||||
|
@ -33,31 +33,31 @@ function path_help($path, $arg) {
|
|||
* Implement hook_menu().
|
||||
*/
|
||||
function path_menu() {
|
||||
$items['admin/build/path'] = array(
|
||||
$items['admin/settings/path'] = array(
|
||||
'title' => 'URL aliases',
|
||||
'description' => "Change your site's URL paths by aliasing them.",
|
||||
'page callback' => 'path_admin_overview',
|
||||
'access arguments' => array('administer url aliases'),
|
||||
);
|
||||
$items['admin/build/path/edit'] = array(
|
||||
$items['admin/settings/path/edit'] = array(
|
||||
'title' => 'Edit alias',
|
||||
'page callback' => 'path_admin_edit',
|
||||
'access arguments' => array('administer url aliases'),
|
||||
'type' => MENU_CALLBACK,
|
||||
);
|
||||
$items['admin/build/path/delete'] = array(
|
||||
$items['admin/settings/path/delete'] = array(
|
||||
'title' => 'Delete alias',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('path_admin_delete_confirm'),
|
||||
'access arguments' => array('administer url aliases'),
|
||||
'type' => MENU_CALLBACK,
|
||||
);
|
||||
$items['admin/build/path/list'] = array(
|
||||
$items['admin/settings/path/list'] = array(
|
||||
'title' => 'List',
|
||||
'type' => MENU_DEFAULT_LOCAL_TASK,
|
||||
'weight' => -10,
|
||||
);
|
||||
$items['admin/build/path/add'] = array(
|
||||
$items['admin/settings/path/add'] = array(
|
||||
'title' => 'Add alias',
|
||||
'page callback' => 'path_admin_edit',
|
||||
'access arguments' => array('administer url aliases'),
|
||||
|
|
|
@ -37,7 +37,7 @@ class PathTestCase extends DrupalWebTestCase {
|
|||
$edit = array();
|
||||
$edit['src'] = 'node/' . $node1->nid;
|
||||
$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
|
||||
// created.
|
||||
|
@ -62,7 +62,7 @@ class PathTestCase extends DrupalWebTestCase {
|
|||
$edit = array();
|
||||
$edit['src'] = 'node/' . $node1->nid;
|
||||
$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.
|
||||
$this->drupalGet($edit['dst']);
|
||||
|
@ -73,7 +73,7 @@ class PathTestCase extends DrupalWebTestCase {
|
|||
|
||||
$previous = $edit['dst'];
|
||||
$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.
|
||||
$this->drupalGet($edit['dst']);
|
||||
|
@ -90,13 +90,13 @@ class PathTestCase extends DrupalWebTestCase {
|
|||
// Set alias to second test node.
|
||||
$edit['src'] = 'node/' . $node2->nid;
|
||||
// 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.
|
||||
$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.
|
||||
$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.
|
||||
$this->drupalGet($edit['dst']);
|
||||
|
|
Loading…
Reference in New Issue