Commit 43db68b6 authored by webchick's avatar webchick

#506124 follow-up by Gábor Hojtsy: Move URL aliases under Search & Metadata.

parent b8448cac
......@@ -1252,7 +1252,7 @@ class LocalePathFunctionalTest extends DrupalWebTestCase {
$node = $this->drupalCreateNode(array('type' => 'page'));
// Create a path alias in default language (English).
$path = 'admin/settings/path/add';
$path = 'admin/config/search/path/add';
$english_path = $this->randomName(8);
$edit = array(
'src' => 'node/' . $node->nid,
......
......@@ -45,8 +45,8 @@ function path_admin_overview($keys = NULL) {
'data' => array(
l($data->dst, $data->src),
l($data->src, $data->src, array('alias' => TRUE)),
l(t('edit'), "admin/settings/path/edit/$data->pid", array('query' => $destination)),
l(t('delete'), "admin/settings/path/delete/$data->pid", array('query' => $destination)),
l(t('edit'), "admin/config/search/path/edit/$data->pid", array('query' => $destination)),
l(t('delete'), "admin/config/search/path/delete/$data->pid", array('query' => $destination)),
),
);
// If the system path maps to a different URL alias, highlight this table
......@@ -61,7 +61,7 @@ function path_admin_overview($keys = NULL) {
}
if (empty($rows)) {
$empty_message = $keys ? t('No URL aliases found.') : t('No URL aliases available. <a href="@link">Add alias</a>.', array('@link' => url('admin/settings/path/add'))) ;
$empty_message = $keys ? t('No URL aliases found.') : t('No URL aliases available. <a href="@link">Add alias</a>.', array('@link' => url('admin/config/search/path/add'))) ;
$rows[] = array(array('data' => $empty_message, 'colspan' => ($multilanguage ? 5 : 4)));
}
......@@ -173,7 +173,7 @@ function path_admin_form_submit($form, &$form_state) {
path_set_alias($form_state['values']['src'], $form_state['values']['dst'], isset($form_state['values']['pid']) ? $form_state['values']['pid'] : 0, isset($form_state['values']['language']) ? $form_state['values']['language'] : '');
drupal_set_message(t('The alias has been saved.'));
$form_state['redirect'] = 'admin/settings/path';
$form_state['redirect'] = 'admin/config/search/path';
return;
}
......@@ -186,7 +186,7 @@ function path_admin_delete_confirm($form_state, $pid) {
$form['pid'] = array('#type' => 'value', '#value' => $pid);
$output = confirm_form($form,
t('Are you sure you want to delete path alias %title?', array('%title' => $path['dst'])),
isset($_GET['destination']) ? $_GET['destination'] : 'admin/settings/path');
isset($_GET['destination']) ? $_GET['destination'] : 'admin/config/search/path');
}
return $output;
}
......@@ -197,7 +197,7 @@ function path_admin_delete_confirm($form_state, $pid) {
function path_admin_delete_confirm_submit($form, &$form_state) {
if ($form_state['values']['confirm']) {
path_admin_delete($form_state['values']['pid']);
$form_state['redirect'] = 'admin/settings/path';
$form_state['redirect'] = 'admin/config/search/path';
return;
}
}
......@@ -241,14 +241,14 @@ function path_admin_filter_form(&$form_state, $keys = '') {
* Process filter form submission when the Filter button is pressed.
*/
function path_admin_filter_form_submit_filter($form, &$form_state) {
$form_state['redirect'] = 'admin/settings/path/list/' . trim($form_state['values']['filter']);
$form_state['redirect'] = 'admin/config/search/path/list/' . trim($form_state['values']['filter']);
}
/**
* Process filter form submission when the Reset button is pressed.
*/
function path_admin_filter_form_submit_reset($form, &$form_state) {
$form_state['redirect'] = 'admin/settings/path/list';
$form_state['redirect'] = 'admin/config/search/path/list';
}
......
......@@ -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/settings/path':
case 'admin/config/search/path':
return '<p>' . t("An alias defines a different name for an existing URL path - for example, the alias 'about' for the URL path 'node/1'. A URL path can have multiple aliases.") . '</p>';
case 'admin/settings/path/add':
case 'admin/config/search/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,21 +33,21 @@ function path_help($path, $arg) {
* Implement hook_menu().
*/
function path_menu() {
$items['admin/settings/path'] = array(
$items['admin/config/search/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'),
'file' => 'path.admin.inc',
);
$items['admin/settings/path/edit'] = array(
$items['admin/config/search/path/edit'] = array(
'title' => 'Edit alias',
'page callback' => 'path_admin_edit',
'access arguments' => array('administer url aliases'),
'type' => MENU_CALLBACK,
'file' => 'path.admin.inc',
);
$items['admin/settings/path/delete'] = array(
$items['admin/config/search/path/delete'] = array(
'title' => 'Delete alias',
'page callback' => 'drupal_get_form',
'page arguments' => array('path_admin_delete_confirm'),
......@@ -55,12 +55,12 @@ function path_menu() {
'type' => MENU_CALLBACK,
'file' => 'path.admin.inc',
);
$items['admin/settings/path/list'] = array(
$items['admin/config/search/path/list'] = array(
'title' => 'List',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items['admin/settings/path/add'] = array(
$items['admin/config/search/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/settings/path/add', $edit, t('Create new alias'));
$this->drupalPost('admin/config/search/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/settings/path/add', $edit, t('Create new alias'));
$this->drupalPost('admin/config/search/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/settings/path/edit/' . $pid, $edit, t('Update alias'));
$this->drupalPost('admin/config/search/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/settings/path/add', $edit, t('Create new alias'));
$this->drupalPost('admin/config/search/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/settings/path/delete/' . $pid, array(), t('Confirm'));
$this->drupalPost('admin/config/search/path/delete/' . $pid, array(), t('Confirm'));
// Confirm that the alias no longer works.
$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