Commit 1170f565 authored by Dries's avatar Dries
Browse files

- Patch #502166 by catch: move taxonomy administration to admin/build.

parent 65d96685
......@@ -131,7 +131,7 @@ class ForumTestCase extends DrupalWebTestCase {
);
// Edit the vocabulary.
$this->drupalPost('admin/content/taxonomy/' . $vid, $edit, t('Save'));
$this->drupalPost('admin/build/taxonomy/' . $vid, $edit, t('Save'));
$this->assertResponse(200);
$this->assertRaw(t('Updated vocabulary %name.', array('%name' => $title)), t('Vocabulary was edited'));
......
......@@ -26,9 +26,9 @@ function taxonomy_overview_vocabularies() {
$form[$vocabulary->vid]['name'] = array('#markup' => check_plain($vocabulary->name));
$form[$vocabulary->vid]['types'] = array('#markup' => implode(', ', $types));
$form[$vocabulary->vid]['weight'] = array('#type' => 'weight', '#delta' => 10, '#default_value' => $vocabulary->weight);
$form[$vocabulary->vid]['edit'] = array('#markup' => l(t('edit vocabulary'), "admin/content/taxonomy/$vocabulary->vid"));
$form[$vocabulary->vid]['list'] = array('#markup' => l(t('list terms'), "admin/content/taxonomy/$vocabulary->vid/list"));
$form[$vocabulary->vid]['add'] = array('#markup' => l(t('add terms'), "admin/content/taxonomy/$vocabulary->vid/add"));
$form[$vocabulary->vid]['edit'] = array('#markup' => l(t('edit vocabulary'), "admin/build/taxonomy/$vocabulary->vid"));
$form[$vocabulary->vid]['list'] = array('#markup' => l(t('list terms'), "admin/build/taxonomy/$vocabulary->vid/list"));
$form[$vocabulary->vid]['add'] = array('#markup' => l(t('add terms'), "admin/build/taxonomy/$vocabulary->vid/add"));
}
// Only make this form include a submit button and weight if more than one
......@@ -248,16 +248,16 @@ function taxonomy_form_vocabulary_submit($form, &$form_state) {
switch (taxonomy_vocabulary_save($vocabulary)) {
case SAVED_NEW:
drupal_set_message(t('Created new vocabulary %name.', array('%name' => $vocabulary->name)));
watchdog('taxonomy', 'Created new vocabulary %name.', array('%name' => $vocabulary->name), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/' . $vocabulary->vid));
watchdog('taxonomy', 'Created new vocabulary %name.', array('%name' => $vocabulary->name), WATCHDOG_NOTICE, l(t('edit'), 'admin/build/taxonomy/' . $vocabulary->vid));
break;
case SAVED_UPDATED:
drupal_set_message(t('Updated vocabulary %name.', array('%name' => $vocabulary->name)));
watchdog('taxonomy', 'Updated vocabulary %name.', array('%name' => $vocabulary->name), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/' . $vocabulary->vid));
watchdog('taxonomy', 'Updated vocabulary %name.', array('%name' => $vocabulary->name), WATCHDOG_NOTICE, l(t('edit'), 'admin/build/taxonomy/' . $vocabulary->vid));
break;
}
$form_state['vid'] = $vocabulary->vid;
$form_state['redirect'] = 'admin/content/taxonomy';
$form_state['redirect'] = 'admin/build/taxonomy';
return;
}
......@@ -858,7 +858,7 @@ function taxonomy_form_term_submit($form, &$form_state) {
}
$form_state['tid'] = $term->tid;
$form_state['redirect'] = 'admin/content/taxonomy';
$form_state['redirect'] = 'admin/build/taxonomy';
return;
}
......@@ -912,7 +912,7 @@ function taxonomy_term_confirm_delete(&$form_state, $tid) {
return confirm_form($form,
t('Are you sure you want to delete the term %title?',
array('%title' => $term->name)),
'admin/content/taxonomy',
'admin/build/taxonomy',
t('Deleting a term will delete all its children if there are any. This action cannot be undone.'),
t('Delete'),
t('Cancel'));
......@@ -928,7 +928,7 @@ function taxonomy_term_confirm_delete_submit($form, &$form_state) {
taxonomy_check_vocabulary_hierarchy($form['#vocabulary'], $form_state['values']);
drupal_set_message(t('Deleted term %name.', array('%name' => $form_state['values']['name'])));
watchdog('taxonomy', 'Deleted term %name.', array('%name' => $form_state['values']['name']), WATCHDOG_NOTICE);
$form_state['redirect'] = 'admin/content/taxonomy';
$form_state['redirect'] = 'admin/build/taxonomy';
return;
}
......@@ -949,7 +949,7 @@ function taxonomy_vocabulary_confirm_delete(&$form_state, $vid) {
return confirm_form($form,
t('Are you sure you want to delete the vocabulary %title?',
array('%title' => $vocabulary->name)),
'admin/content/taxonomy',
'admin/build/taxonomy',
t('Deleting a vocabulary will delete all the terms in it. This action cannot be undone.'),
t('Delete'),
t('Cancel'));
......@@ -964,7 +964,7 @@ function taxonomy_vocabulary_confirm_delete_submit($form, &$form_state) {
$status = taxonomy_vocabulary_delete($form_state['values']['vid']);
drupal_set_message(t('Deleted vocabulary %name.', array('%name' => $form_state['values']['name'])));
watchdog('taxonomy', 'Deleted vocabulary %name.', array('%name' => $form_state['values']['name']), WATCHDOG_NOTICE);
$form_state['redirect'] = 'admin/content/taxonomy';
$form_state['redirect'] = 'admin/build/taxonomy';
return;
}
......@@ -984,7 +984,7 @@ function taxonomy_vocabulary_confirm_reset_alphabetical(&$form_state, $vid) {
return confirm_form($form,
t('Are you sure you want to reset the vocabulary %title to alphabetical order?',
array('%title' => $vocabulary->name)),
'admin/content/taxonomy/' . $vid,
'admin/build/taxonomy/' . $vid,
t('Resetting a vocabulary will discard all custom ordering and sort items alphabetically.'),
t('Reset to alphabetical'),
t('Cancel'));
......@@ -1002,5 +1002,5 @@ function taxonomy_vocabulary_confirm_reset_alphabetical_submit($form, &$form_sta
->execute();
drupal_set_message(t('Reset vocabulary %name to alphabetical order.', array('%name' => $form_state['values']['name'])));
watchdog('taxonomy', 'Reset vocabulary %name to alphabetical order.', array('%name' => $form_state['values']['name']), WATCHDOG_NOTICE);
$form_state['redirect'] = 'admin/content/taxonomy/' . $form_state['values']['vid'];
$form_state['redirect'] = 'admin/build/taxonomy/' . $form_state['values']['vid'];
}
......@@ -145,7 +145,7 @@ function taxonomy_term_path($term) {
* Implement hook_menu().
*/
function taxonomy_menu() {
$items['admin/content/taxonomy'] = array(
$items['admin/build/taxonomy'] = array(
'title' => 'Taxonomy',
'description' => 'Manage tagging, categorization, and classification of your content.',
'page callback' => 'drupal_get_form',
......@@ -153,13 +153,13 @@ function taxonomy_menu() {
'access arguments' => array('administer taxonomy'),
);
$items['admin/content/taxonomy/list'] = array(
$items['admin/build/taxonomy/list'] = array(
'title' => 'List',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items['admin/content/taxonomy/add'] = array(
$items['admin/build/taxonomy/add'] = array(
'title' => 'Add vocabulary',
'page callback' => 'drupal_get_form',
'page arguments' => array('taxonomy_form_vocabulary'),
......@@ -196,7 +196,7 @@ function taxonomy_menu() {
'type' => MENU_CALLBACK,
);
$items['admin/content/taxonomy/%taxonomy_vocabulary'] = array(
$items['admin/build/taxonomy/%taxonomy_vocabulary'] = array(
'title' => 'Vocabulary', // this is replaced by callback
'page callback' => 'drupal_get_form',
'page arguments' => array('taxonomy_form_vocabulary', 3),
......@@ -206,13 +206,13 @@ function taxonomy_menu() {
'type' => MENU_CALLBACK,
);
$items['admin/content/taxonomy/%taxonomy_vocabulary/edit'] = array(
$items['admin/build/taxonomy/%taxonomy_vocabulary/edit'] = array(
'title' => 'Edit vocabulary',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -20,
);
$items['admin/content/taxonomy/%taxonomy_vocabulary/list'] = array(
$items['admin/build/taxonomy/%taxonomy_vocabulary/list'] = array(
'title' => 'List terms',
'page callback' => 'drupal_get_form',
'page arguments' => array('taxonomy_overview_terms', 3),
......@@ -221,7 +221,7 @@ function taxonomy_menu() {
'weight' => -10,
);
$items['admin/content/taxonomy/%taxonomy_vocabulary/add'] = array(
$items['admin/build/taxonomy/%taxonomy_vocabulary/add'] = array(
'title' => 'Add term',
'page callback' => 'drupal_get_form',
'page arguments' => array('taxonomy_form_term', 3),
......@@ -1756,11 +1756,11 @@ function taxonomy_help($path, $arg) {
$output .= '<p>' . t('The taxonomy module supports the use of both synonyms and related terms, but does not directly use this functionality. However, optional contributed or custom modules may make full use of these advanced features.') . '</p>';
$output .= '<p>' . t('For more information, see the online handbook entry for <a href="@taxonomy">Taxonomy module</a>.', array('@taxonomy' => 'http://drupal.org/handbook/modules/taxonomy/')) . '</p>';
return $output;
case 'admin/content/taxonomy':
case 'admin/build/taxonomy':
$output = '<p>' . t("The taxonomy module allows you to categorize your content using both tags and administrator defined terms. It is a flexible tool for classifying content with many advanced features. To begin, create a 'Vocabulary' to hold one set of terms or tags. You can create one free-tagging vocabulary for everything, or separate controlled vocabularies to define the various properties of your content, for example 'Countries' or 'Colors'.") . '</p>';
$output .= '<p>' . t('Use the list below to configure and review the vocabularies defined on your site, or to list and manage the terms (tags) they contain. A vocabulary may (optionally) be tied to specific content types as shown in the <em>Type</em> column and, if so, will be displayed when creating or editing posts of that type. Multiple vocabularies tied to the same content type will be displayed in the order shown below. To change the order of a vocabulary, grab a drag-and-drop handle under the <em>Name</em> column and drag it to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the <em>Save</em> button at the bottom of the page.') . '</p>';
return $output;
case 'admin/content/taxonomy/%/list':
case 'admin/build/taxonomy/%/list':
$vocabulary = taxonomy_vocabulary_load($arg[3]);
if ($vocabulary->tags) {
return '<p>' . t('%capital_name is a free-tagging vocabulary. To change the name or description of a term, click the <em>edit</em> link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name))) . '</p>';
......@@ -1773,7 +1773,7 @@ function taxonomy_help($path, $arg) {
case 2:
return '<p>' . t('%capital_name is a multiple hierarchy vocabulary. To change the name or description of a term, click the <em>edit</em> link next to the term. Drag and drop of multiple hierarchies is not supported, but you can re-enable drag and drop support by editing each term to include only a single parent.', array('%capital_name' => drupal_ucfirst($vocabulary->name))) . '</p>';
}
case 'admin/content/taxonomy/add':
case 'admin/build/taxonomy/add':
return '<p>' . t('Define how your vocabulary will be presented to administrators and users, and which content types to categorize with it. Tags allows users to create terms when submitting posts by typing a comma separated list. Otherwise terms are chosen from a select list and can only be created by users with the "administer taxonomy" permission.') . '</p>';
}
}
......
......@@ -64,7 +64,7 @@ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase {
*/
function testVocabularyInterface() {
// Visit the main taxonomy administration page.
$this->drupalGet('admin/content/taxonomy');
$this->drupalGet('admin/build/taxonomy');
// Create a new vocabulary.
$this->clickLink(t('Add vocabulary'));
......@@ -82,23 +82,23 @@ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase {
$this->assertRaw(t('Created new vocabulary %name.', array('%name' => $edit['name'])), t('Vocabulary created successfully'));
// Edit the vocabulary.
$this->drupalGet('admin/content/taxonomy');
$this->drupalGet('admin/build/taxonomy');
$this->assertText($edit['name'], t('Vocabulary found in the vocabulary overview listing.'));
$this->clickLink(t('edit vocabulary'));
$edit = array();
$edit['name'] = $this->randomName();
$this->drupalPost(NULL, $edit, t('Save'));
$this->drupalGet('admin/content/taxonomy');
$this->drupalGet('admin/build/taxonomy');
$this->assertText($edit['name'], t('Vocabulary found in the vocabulary overview listing.'));
// Try to submit a vocabulary with a duplicate machine name.
$edit['machine_name'] = $machine_name;
$this->drupalPost('admin/content/taxonomy/add', $edit, t('Save'));
$this->drupalPost('admin/build/taxonomy/add', $edit, t('Save'));
$this->assertText(t('This machine-readable name is already in use by another vocabulary and must be unique.'), t('Duplicate machine name validation was successful'));
// Try to submit an invalid machine name.
$edit['machine_name'] = '!&^%';
$this->drupalPost('admin/content/taxonomy/add', $edit, t('Save'));
$this->drupalPost('admin/build/taxonomy/add', $edit, t('Save'));
$this->assertText(t('The machine-readable name must contain only lowercase letters, numbers, and underscores.'));
}
......@@ -119,7 +119,7 @@ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase {
$edit[$key . '[weight]'] = $vocabulary->weight;
}
// Saving the new weights via the interface.
$this->drupalPost('admin/content/taxonomy/', $edit, t('Save'));
$this->drupalPost('admin/build/taxonomy/', $edit, t('Save'));
// Load the vocabularies from the database.
$new_vocabularies = taxonomy_get_vocabularies();
......@@ -141,7 +141,7 @@ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase {
}
// Confirm that no vocabularies are found in the database.
$this->assertFalse(taxonomy_get_vocabularies(), t('No vocabularies found in the database'));
$this->drupalGet('admin/content/taxonomy');
$this->drupalGet('admin/build/taxonomy');
// Check the default message for no vocabularies.
$this->assertText(t('No vocabularies available.'), t('No vocabularies were found.'));
}
......@@ -156,7 +156,7 @@ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase {
'machine_name' => drupal_strtolower($this->randomName()),
'nodes[article]' => 'article',
);
$this->drupalPost('admin/content/taxonomy/add', $edit, t('Save'));
$this->drupalPost('admin/build/taxonomy/add', $edit, t('Save'));
$this->assertText(t('Created new vocabulary'), t('New vocabulary was created.'));
// Check the created vocabulary.
......@@ -168,7 +168,7 @@ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase {
// Delete the vocabulary.
$edit = array();
$this->drupalPost('admin/content/taxonomy/' . $vid, $edit, t('Delete'));
$this->drupalPost('admin/build/taxonomy/' . $vid, $edit, t('Delete'));
$this->assertRaw(t('Are you sure you want to delete the vocabulary %name?', array('%name' => $vocabulary->name)), t('[confirm deletion] Asks for confirmation.'));
$this->assertText(t('Deleting a vocabulary will delete all the terms in it. This action cannot be undone.'), t('[confirm deletion] Inform that all terms will be deleted.'));
......@@ -540,13 +540,13 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase {
$edit['parent[]'] = 0;
// Create the term to edit.
$this->drupalPost('admin/content/taxonomy/' . $this->vocabulary->vid . '/add', $edit, t('Save'));
$this->drupalPost('admin/build/taxonomy/' . $this->vocabulary->vid . '/add', $edit, t('Save'));
$term = reset(taxonomy_get_term_by_name($edit['name']));
$this->assertNotNull($term, t('Term found in database'));
// Submitting a term takes us to the add page; we need the List page.
$this->drupalGet('admin/content/taxonomy/' . $this->vocabulary->vid . '/list');
$this->drupalGet('admin/build/taxonomy/' . $this->vocabulary->vid . '/list');
// Test edit link as accessed from Taxonomy administration pages.
// Because Simpletest creates its own database when running tests, we know
......@@ -707,7 +707,7 @@ class TaxonomyHooksTestCase extends TaxonomyWebTestCase {
'name' => $this->randomName(),
'antonyms' => 'Long',
);
$this->drupalPost('admin/content/taxonomy/' . $vocabulary->vid . '/add', $edit, t('Save'));
$this->drupalPost('admin/build/taxonomy/' . $vocabulary->vid . '/add', $edit, t('Save'));
$term = reset(taxonomy_get_term_by_name($edit['name']));
$this->assertEqual($term->antonyms[0], $edit['antonyms'], t('Antonyms were loaded into the term object'));
......
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