diff options
Diffstat (limited to 'modules/taxonomy')
-rw-r--r-- | modules/taxonomy/taxonomy.admin.inc | 30 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.module | 24 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.test | 24 |
3 files changed, 39 insertions, 39 deletions
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc index 452de1792..6734e339a 100644 --- a/modules/taxonomy/taxonomy.admin.inc +++ b/modules/taxonomy/taxonomy.admin.inc @@ -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/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")); + $form[$vocabulary->vid]['edit'] = array('#markup' => l(t('edit vocabulary'), "admin/structure/taxonomy/$vocabulary->vid")); + $form[$vocabulary->vid]['list'] = array('#markup' => l(t('list terms'), "admin/structure/taxonomy/$vocabulary->vid/list")); + $form[$vocabulary->vid]['add'] = array('#markup' => l(t('add terms'), "admin/structure/taxonomy/$vocabulary->vid/add")); } // Only make this form include a submit button and weight if more than one @@ -84,7 +84,7 @@ function theme_taxonomy_overview_vocabularies($form) { } if (empty($rows)) { - $rows[] = array(array('data' => t('No vocabularies available. <a href="@link">Add vocabulary</a>.', array('@link' => url('admin/build/taxonomy/add'))), 'colspan' => '5')); + $rows[] = array(array('data' => t('No vocabularies available. <a href="@link">Add vocabulary</a>.', array('@link' => url('admin/structure/taxonomy/add'))), 'colspan' => '5')); } $header = array(t('Vocabulary name'), t('Content types')); @@ -246,16 +246,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/build/taxonomy/' . $vocabulary->vid)); + watchdog('taxonomy', 'Created new vocabulary %name.', array('%name' => $vocabulary->name), WATCHDOG_NOTICE, l(t('edit'), 'admin/structure/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/build/taxonomy/' . $vocabulary->vid)); + watchdog('taxonomy', 'Updated vocabulary %name.', array('%name' => $vocabulary->name), WATCHDOG_NOTICE, l(t('edit'), 'admin/structure/taxonomy/' . $vocabulary->vid)); break; } $form_state['vid'] = $vocabulary->vid; - $form_state['redirect'] = 'admin/build/taxonomy'; + $form_state['redirect'] = 'admin/structure/taxonomy'; return; } @@ -451,7 +451,7 @@ function taxonomy_overview_terms(&$form_state, $vocabulary) { $form['#page_entries'] = $page_entries; $form['#back_peddle'] = $back_peddle; $form['#forward_peddle'] = $forward_peddle; - $form['#empty_text'] = t('No terms available. <a href="@link">Add term</a>.', array('@link' => url('admin/build/taxonomy/' . $vocabulary->vid . '/add'))); + $form['#empty_text'] = t('No terms available. <a href="@link">Add term</a>.', array('@link' => url('admin/structure/taxonomy/' . $vocabulary->vid . '/add'))); if (!$vocabulary->tags && $vocabulary->hierarchy < 2 && count($tree) > 1) { $form['submit'] = array( @@ -855,7 +855,7 @@ function taxonomy_form_term_submit($form, &$form_state) { } $form_state['tid'] = $term->tid; - $form_state['redirect'] = 'admin/build/taxonomy'; + $form_state['redirect'] = 'admin/structure/taxonomy'; return; } @@ -909,7 +909,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/build/taxonomy', + 'admin/structure/taxonomy', t('Deleting a term will delete all its children if there are any. This action cannot be undone.'), t('Delete'), t('Cancel')); @@ -925,7 +925,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/build/taxonomy'; + $form_state['redirect'] = 'admin/structure/taxonomy'; return; } @@ -946,7 +946,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/build/taxonomy', + 'admin/structure/taxonomy', t('Deleting a vocabulary will delete all the terms in it. This action cannot be undone.'), t('Delete'), t('Cancel')); @@ -961,7 +961,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/build/taxonomy'; + $form_state['redirect'] = 'admin/structure/taxonomy'; return; } @@ -981,7 +981,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/build/taxonomy/' . $vid, + 'admin/structure/taxonomy/' . $vid, t('Resetting a vocabulary will discard all custom ordering and sort items alphabetically.'), t('Reset to alphabetical'), t('Cancel')); @@ -999,5 +999,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/build/taxonomy/' . $form_state['values']['vid']; + $form_state['redirect'] = 'admin/structure/taxonomy/' . $form_state['values']['vid']; } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 15feb2b49..450757f4d 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -39,8 +39,8 @@ function taxonomy_fieldable_info() { $return['taxonomy_term']['bundles'][$vocabulary->machine_name] = array( 'label' => $vocabulary->name, 'admin' => array( - 'path' => 'admin/build/taxonomy/%taxonomy_vocabulary', - 'real path' => 'admin/build/taxonomy/' . $vocabulary->vid, + 'path' => 'admin/structure/taxonomy/%taxonomy_vocabulary', + 'real path' => 'admin/structure/taxonomy/' . $vocabulary->vid, 'bundle argument' => 3, 'access arguments' => array('administer taxonomy'), ), @@ -162,7 +162,7 @@ function taxonomy_term_path($term) { * Implement hook_menu(). */ function taxonomy_menu() { - $items['admin/build/taxonomy'] = array( + $items['admin/structure/taxonomy'] = array( 'title' => 'Taxonomy', 'description' => 'Manage tagging, categorization, and classification of your content.', 'page callback' => 'drupal_get_form', @@ -170,13 +170,13 @@ function taxonomy_menu() { 'access arguments' => array('administer taxonomy'), ); - $items['admin/build/taxonomy/list'] = array( + $items['admin/structure/taxonomy/list'] = array( 'title' => 'List', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10, ); - $items['admin/build/taxonomy/add'] = array( + $items['admin/structure/taxonomy/add'] = array( 'title' => 'Add vocabulary', 'page callback' => 'drupal_get_form', 'page arguments' => array('taxonomy_form_vocabulary'), @@ -223,7 +223,7 @@ function taxonomy_menu() { 'type' => MENU_CALLBACK, ); - $items['admin/build/taxonomy/%taxonomy_vocabulary'] = array( + $items['admin/structure/taxonomy/%taxonomy_vocabulary'] = array( 'title' => 'Vocabulary', // this is replaced by callback 'page callback' => 'drupal_get_form', 'page arguments' => array('taxonomy_form_vocabulary', 3), @@ -233,13 +233,13 @@ function taxonomy_menu() { 'type' => MENU_CALLBACK, ); - $items['admin/build/taxonomy/%taxonomy_vocabulary/edit'] = array( + $items['admin/structure/taxonomy/%taxonomy_vocabulary/edit'] = array( 'title' => 'Edit vocabulary', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -20, ); - $items['admin/build/taxonomy/%taxonomy_vocabulary/list'] = array( + $items['admin/structure/taxonomy/%taxonomy_vocabulary/list'] = array( 'title' => 'List terms', 'page callback' => 'drupal_get_form', 'page arguments' => array('taxonomy_overview_terms', 3), @@ -248,7 +248,7 @@ function taxonomy_menu() { 'weight' => -10, ); - $items['admin/build/taxonomy/%taxonomy_vocabulary/add'] = array( + $items['admin/structure/taxonomy/%taxonomy_vocabulary/add'] = array( 'title' => 'Add term', 'page callback' => 'drupal_get_form', 'page arguments' => array('taxonomy_form_term', 3), @@ -1761,11 +1761,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/build/taxonomy': + case 'admin/structure/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/build/taxonomy/%/list': + case 'admin/structure/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>'; @@ -1778,7 +1778,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/build/taxonomy/add': + case 'admin/structure/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>'; } } diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test index ed5a7a69b..522323c79 100644 --- a/modules/taxonomy/taxonomy.test +++ b/modules/taxonomy/taxonomy.test @@ -64,7 +64,7 @@ class TaxonomyVocabularyFunctionalTest extends TaxonomyWebTestCase { */ function testVocabularyInterface() { // Visit the main taxonomy administration page. - $this->drupalGet('admin/build/taxonomy'); + $this->drupalGet('admin/structure/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/build/taxonomy'); + $this->drupalGet('admin/structure/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/build/taxonomy'); + $this->drupalGet('admin/structure/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/build/taxonomy/add', $edit, t('Save')); + $this->drupalPost('admin/structure/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/build/taxonomy/add', $edit, t('Save')); + $this->drupalPost('admin/structure/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/build/taxonomy/', $edit, t('Save')); + $this->drupalPost('admin/structure/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/build/taxonomy'); + $this->drupalGet('admin/structure/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/build/taxonomy/add', $edit, t('Save')); + $this->drupalPost('admin/structure/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/build/taxonomy/' . $vid, $edit, t('Delete')); + $this->drupalPost('admin/structure/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/build/taxonomy/' . $this->vocabulary->vid . '/add', $edit, t('Save')); + $this->drupalPost('admin/structure/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/build/taxonomy/' . $this->vocabulary->vid . '/list'); + $this->drupalGet('admin/structure/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/build/taxonomy/' . $vocabulary->vid . '/add', $edit, t('Save')); + $this->drupalPost('admin/structure/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')); |