Commit ec8deb00 authored by webchick's avatar webchick

Issue #1978112 by andypost: Convert taxonomy admin path to follow other core.

parent dfd61636
......@@ -192,11 +192,11 @@ function testNonInitializedFields() {
* Tests hiding the view modes fieldset when there's only one available.
*/
function testSingleViewMode() {
$this->drupalGet('admin/structure/taxonomy/' . $this->vocabulary . '/display');
$this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary . '/display');
$this->assertNoText('Use custom display settings for the following view modes', 'Custom display settings fieldset found.');
// This may not trigger a notice when 'view_modes_custom' isn't available.
$this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary . '/display', array(), t('Save'));
$this->drupalPost('admin/structure/taxonomy/manage/' . $this->vocabulary . '/display', array(), t('Save'));
}
/**
......
......@@ -115,7 +115,7 @@ function createField() {
// different entity types; e.g. if a field was added in a node entity, it
// should also appear in the 'taxonomy term' entity.
$vocabulary = taxonomy_vocabulary_load('tags');
$this->drupalGet('admin/structure/taxonomy/' . $vocabulary->id() . '/fields');
$this->drupalGet('admin/structure/taxonomy/manage/' . $vocabulary->id() . '/fields');
$this->assertTrue($this->xpath('//select[@name="fields[_add_existing_field][field_name]"]//option[@value="' . $this->field_name . '"]'), 'Existing field was found in taxonomy term fields.');
}
......@@ -456,7 +456,7 @@ function testWidgetChange() {
*/
function testDeleteTaxonomyField() {
// Create a new field.
$bundle_path = 'admin/structure/taxonomy/tags';
$bundle_path = 'admin/structure/taxonomy/manage/tags';
$edit1 = array(
'fields[_add_new_field][label]' => $this->field_label,
'fields[_add_new_field][field_name]' => $this->field_name_input,
......
......@@ -302,7 +302,7 @@ private function doAdminTests($user) {
$this->root_forum = $this->createForum('forum');
// Test vocabulary form alterations.
$this->drupalGet('admin/structure/taxonomy/forums/edit');
$this->drupalGet('admin/structure/taxonomy/manage/forums/edit');
$this->assertFieldByName('op', t('Save'), 'Save button found.');
$this->assertNoFieldByName('op', t('Delete'), 'Delete button not found.');
......@@ -323,11 +323,11 @@ private function doAdminTests($user) {
));
taxonomy_vocabulary_save($vocabulary);
// Test tags vocabulary form is not affected.
$this->drupalGet('admin/structure/taxonomy/tags/edit');
$this->drupalGet('admin/structure/taxonomy/manage/tags/edit');
$this->assertFieldByName('op', t('Save'), 'Save button found.');
$this->assertFieldByName('op', t('Delete'), 'Delete button found.');
// Test tags vocabulary term form is not affected.
$this->drupalGet('admin/structure/taxonomy/tags/add');
$this->drupalGet('admin/structure/taxonomy/manage/tags/add');
$this->assertField('parent[]', 'Parent field found.');
// Test relations widget exists.
$relations_widget = $this->xpath("//details[@id='edit-relations']");
......@@ -349,7 +349,7 @@ function editForumVocabulary() {
);
// Edit the vocabulary.
$this->drupalPost('admin/structure/taxonomy/' . $original_vocabulary->id() . '/edit', $edit, t('Save'));
$this->drupalPost('admin/structure/taxonomy/manage/' . $original_vocabulary->id() . '/edit', $edit, t('Save'));
$this->assertResponse(200);
$this->assertRaw(t('Updated vocabulary %name.', array('%name' => $edit['name'])), 'Vocabulary was edited');
......
......@@ -54,7 +54,7 @@ function testTermAlias() {
'description[value]' => $description,
'path[alias]' => $this->randomName(),
);
$this->drupalPost('admin/structure/taxonomy/' . $vocabulary->id() . '/add', $edit, t('Save'));
$this->drupalPost('admin/structure/taxonomy/manage/' . $vocabulary->id() . '/add', $edit, t('Save'));
// Confirm that the alias works.
$this->drupalGet($edit['path[alias]']);
......
......@@ -94,13 +94,13 @@ function testBreadCrumbs() {
$trail += array(
'admin/structure/taxonomy' => t('Taxonomy'),
);
$this->assertBreadcrumb('admin/structure/taxonomy/tags', $trail);
$this->assertBreadcrumb('admin/structure/taxonomy/manage/tags', $trail);
$trail += array(
'admin/structure/taxonomy/tags' => t('Tags'),
'admin/structure/taxonomy/manage/tags' => t('Tags'),
);
$this->assertBreadcrumb('admin/structure/taxonomy/tags/edit', $trail);
$this->assertBreadcrumb('admin/structure/taxonomy/tags/fields', $trail);
$this->assertBreadcrumb('admin/structure/taxonomy/tags/add', $trail);
$this->assertBreadcrumb('admin/structure/taxonomy/manage/tags/edit', $trail);
$this->assertBreadcrumb('admin/structure/taxonomy/manage/tags/fields', $trail);
$this->assertBreadcrumb('admin/structure/taxonomy/manage/tags/add', $trail);
// Verify Menu administration breadcrumbs.
$trail = $admin + array(
......
......@@ -43,7 +43,7 @@
* "bundle" = "vid"
* },
* menu_base_path = "taxonomy/term/%taxonomy_term",
* route_base_path = "admin/structure/taxonomy/{bundle}",
* route_base_path = "admin/structure/taxonomy/manage/{bundle}",
* permission_granularity = "bundle"
* )
*/
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\taxonomy\Plugin\Core\Entity\Vocabulary.
* Contains \Drupal\taxonomy\Plugin\Core\Entity\Vocabulary.
*/
namespace Drupal\taxonomy\Plugin\Core\Entity;
......@@ -76,9 +76,23 @@ class Vocabulary extends ConfigEntityBase implements VocabularyInterface {
public $weight = 0;
/**
* Implements Drupal\Core\Entity\EntityInterface::id().
* {@inheritdoc}
*/
public function id() {
return $this->vid;
}
/**
* {@inheritdoc}
*/
public function uri() {
return array(
'path' => 'admin/structure/taxonomy/manage/' . $this->id(),
'options' => array(
'entity_type' => $this->entityType,
'entity' => $this,
),
);
}
}
......@@ -50,7 +50,7 @@ function testTaxonomyTermHooks() {
'name' => $this->randomName(),
'antonym' => 'Long',
);
$this->drupalPost('admin/structure/taxonomy/' . $vocabulary->id() . '/add', $edit, t('Save'));
$this->drupalPost('admin/structure/taxonomy/manage/' . $vocabulary->id() . '/add', $edit, t('Save'));
$terms = taxonomy_term_load_multiple_by_name($edit['name']);
$term = reset($terms);
$this->assertEqual($term->antonym->value, $edit['antonym'], 'Antonym was loaded into the term object.');
......
......@@ -49,10 +49,10 @@ function testTermLanguage() {
$edit = array(
'default_language[language_show]' => TRUE,
);
$this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->id() . '/edit', $edit, t('Save'));
$this->drupalPost('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/edit', $edit, t('Save'));
// Add a term.
$this->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->id() . '/add');
$this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add');
// Check that we have the language selector.
$this->assertField('edit-langcode', t('The language selector field was found on the page'));
// Submit the term.
......@@ -85,8 +85,8 @@ function testDefaultTermLanguage() {
'default_language[langcode]' => 'bb',
'default_language[language_show]' => TRUE,
);
$this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->id() . '/edit', $edit, t('Save'));
$this->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->id() . '/add');
$this->drupalPost('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/edit', $edit, t('Save'));
$this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add');
$this->assertOptionSelected('edit-langcode', 'bb');
// Make the default language of the terms to be the current interface.
......@@ -94,10 +94,10 @@ function testDefaultTermLanguage() {
'default_language[langcode]' => 'current_interface',
'default_language[language_show]' => TRUE,
);
$this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->id() . '/edit', $edit, t('Save'));
$this->drupalGet('aa/admin/structure/taxonomy/' . $this->vocabulary->id() . '/add');
$this->drupalPost('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/edit', $edit, t('Save'));
$this->drupalGet('aa/admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add');
$this->assertOptionSelected('edit-langcode', 'aa');
$this->drupalGet('bb/admin/structure/taxonomy/' . $this->vocabulary->id() . '/add');
$this->drupalGet('bb/admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add');
$this->assertOptionSelected('edit-langcode', 'bb');
// Change the default language of the site and check if the default terms
......@@ -112,8 +112,8 @@ function testDefaultTermLanguage() {
'default_language[langcode]' => 'site_default',
'default_language[language_show]' => TRUE,
);
$this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->id() . '/edit', $edit, t('Save'));
$this->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->id() . '/add');
$this->drupalPost('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/edit', $edit, t('Save'));
$this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add');
$this->assertOptionSelected('edit-langcode', 'cc');
}
}
......@@ -293,14 +293,14 @@ function testTermInterface() {
$edit['parent[]'] = array(0);
// Create the term to edit.
$this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->id() . '/add', $edit, t('Save'));
$this->drupalPost('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add', $edit, t('Save'));
$terms = taxonomy_term_load_multiple_by_name($edit['name']);
$term = reset($terms);
$this->assertNotNull($term, 'Term found in database.');
// Submitting a term takes us to the add page; we need the List page.
$this->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->id());
$this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id());
// Test edit link as accessed from Taxonomy administration pages.
// Because Simpletest creates its own database when running tests, we know
......@@ -319,7 +319,7 @@ function testTermInterface() {
$this->drupalPost('taxonomy/term/' . $term->id() . '/edit', $edit, t('Save'));
// Check that the term is still present at admin UI after edit.
$this->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->id());
$this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id());
$this->assertText($edit['name'], 'The randomly generated term name is present.');
$this->assertLink(t('edit'));
......@@ -367,7 +367,7 @@ function testTermReorder() {
drupal_static_reset('taxonomy_get_treeterms');
list($term1, $term2, $term3) = taxonomy_get_tree($this->vocabulary->id(), 0, NULL, TRUE);
$this->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->id());
$this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id());
// Each term has four hidden fields, "tid:1:0[tid]", "tid:1:0[parent]",
// "tid:1:0[depth]", and "tid:1:0[weight]". Change the order to term2,
......@@ -397,7 +397,7 @@ function testTermReorder() {
$this->assertEqual($terms[1]->parents, array($term2->id()), 'Term 3 was made a child of term 2.');
$this->assertEqual($terms[2]->tid, $term1->id(), 'Term 1 was moved below term 2.');
$this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->id(), array(), t('Reset to alphabetical'));
$this->drupalPost('admin/structure/taxonomy/manage/' . $this->vocabulary->id(), array(), t('Reset to alphabetical'));
// Submit confirmation form.
$this->drupalPost(NULL, array(), t('Reset to alphabetical'));
......@@ -425,7 +425,7 @@ function testTermMultipleParentsInterface() {
'parent[]' => array(0, $parent->id()),
);
// Save the new term.
$this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->id() . '/add', $edit, t('Save'));
$this->drupalPost('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add', $edit, t('Save'));
// Check that the term was successfully created.
$terms = taxonomy_term_load_multiple_by_name($edit['name']);
......
......@@ -116,12 +116,12 @@ function testTranslateLinkVocabularyAdminPage() {
$untranslatable_tid = $this->createEntity(array(), $this->langcodes[0], $untranslatable_vocabulary->id());
// Verify translation links.
$this->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->id());
$this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id());
$this->assertResponse(200);
$this->assertLinkByHref('term/' . $translatable_tid . '/translations');
$this->assertLinkByHref('term/' . $translatable_tid . '/edit');
$this->drupalGet('admin/structure/taxonomy/' . $untranslatable_vocabulary->id());
$this->drupalGet('admin/structure/taxonomy/manage/' . $untranslatable_vocabulary->id());
$this->assertResponse(200);
$this->assertLinkByHref('term/' . $untranslatable_tid . '/edit');
$this->assertNoLinkByHref('term/' . $untranslatable_tid . '/translations');
......
......@@ -44,7 +44,7 @@ function testTaxonomyTermThemes() {
// Adding a term to a vocabulary is considered an administrative action and
// should use the administrative theme.
$vocabulary = $this->createVocabulary();
$this->drupalGet('admin/structure/taxonomy/' . $vocabulary->id() . '/add');
$this->drupalGet('admin/structure/taxonomy/manage/' . $vocabulary->id() . '/add');
$this->assertRaw('seven/style.css', t("The administrative theme's CSS appears on the page for adding a taxonomy term."));
// Viewing a taxonomy term should use the default theme.
......
......@@ -63,7 +63,7 @@ function testVocabularyLanguage() {
$this->drupalPost(NULL, $edit, t('Save'));
// Check the language on the edit page.
$this->drupalGet('admin/structure/taxonomy/' . $vid . '/edit');
$this->drupalGet('admin/structure/taxonomy/manage/' . $vid . '/edit');
$this->assertOptionSelected('edit-langcode', $edit['langcode'], 'The vocabulary language was correctly selected.');
// Change the language and save again.
......@@ -72,7 +72,7 @@ function testVocabularyLanguage() {
$this->drupalPost(NULL, $edit, t('Save'));
// Check again the language on the edit page.
$this->drupalGet('admin/structure/taxonomy/' . $vid . '/edit');
$this->drupalGet('admin/structure/taxonomy/manage/' . $vid . '/edit');
$this->assertOptionSelected('edit-langcode', $edit['langcode'], 'The vocabulary language was correctly selected.');
}
......@@ -92,7 +92,7 @@ function testVocabularyDefaultLanguageForTerms() {
$this->drupalPost('admin/structure/taxonomy/add', $edit, t('Save'));
// Check that the vocabulary was actually created.
$this->drupalGet('admin/structure/taxonomy/' . $edit['vid'] . '/edit');
$this->drupalGet('admin/structure/taxonomy/manage/' . $edit['vid'] . '/edit');
$this->assertResponse(200, 'The vocabulary has been created.');
// Check that the language settings were saved.
......@@ -109,14 +109,14 @@ function testVocabularyDefaultLanguageForTerms() {
'default_language[langcode]' => 'aa',
'default_language[language_show]' => FALSE,
);
$this->drupalPost('admin/structure/taxonomy/' . $vid . '/edit', $edit, t('Save'));
$this->drupalPost('admin/structure/taxonomy/manage/' . $vid . '/edit', $edit, t('Save'));
// And check again the settings and also the interface.
$language_settings = language_get_default_configuration('taxonomy_term', $vid);
$this->assertEqual($language_settings['langcode'], 'aa');
$this->assertEqual($language_settings['language_show'], FALSE);
$this->drupalGet('admin/structure/taxonomy/' . $vid . '/edit');
$this->drupalGet('admin/structure/taxonomy/manage/' . $vid . '/edit');
$this->assertOptionSelected('edit-default-language-langcode', 'aa', 'The correct default language for the terms of this vocabulary is selected.');
$this->assertNoFieldChecked('edit-default-language-language-show', 'Show language selection option is not checked.');
......@@ -126,7 +126,7 @@ function testVocabularyDefaultLanguageForTerms() {
'default_language[langcode]' => 'authors_default',
'default_language[language_show]' => FALSE,
);
$this->drupalPost('admin/structure/taxonomy/' . $vid . '/edit', $edit, t('Save'));
$this->drupalPost('admin/structure/taxonomy/manage/' . $vid . '/edit', $edit, t('Save'));
// Check that we have the new settings.
$new_settings = language_get_default_configuration('taxonomy_term', $vid);
......
......@@ -35,7 +35,7 @@ function testVocabularyPermissionsTaxonomyTerm() {
$this->drupalLogin($user);
// Visit the main taxonomy administration page.
$this->drupalGet('admin/structure/taxonomy/' . $vocabulary->id() . '/add');
$this->drupalGet('admin/structure/taxonomy/manage/' . $vocabulary->id() . '/add');
$this->assertResponse(200);
$this->assertField('edit-name', 'Add taxonomy term form opened successfully.');
......@@ -71,7 +71,7 @@ function testVocabularyPermissionsTaxonomyTerm() {
$this->drupalLogin($user);
// Visit the main taxonomy administration page.
$this->drupalGet('admin/structure/taxonomy/' . $vocabulary->id() . '/add');
$this->drupalGet('admin/structure/taxonomy/manage/' . $vocabulary->id() . '/add');
$this->assertResponse(403, 'Add taxonomy term form open failed.');
// Create a test term.
......@@ -95,7 +95,7 @@ function testVocabularyPermissionsTaxonomyTerm() {
$this->drupalLogin($user);
// Visit the main taxonomy administration page.
$this->drupalGet('admin/structure/taxonomy/' . $vocabulary->id() . '/add');
$this->drupalGet('admin/structure/taxonomy/manage/' . $vocabulary->id() . '/add');
$this->assertResponse(403, 'Add taxonomy term form open failed.');
// Create a test term.
......@@ -118,7 +118,7 @@ function testVocabularyPermissionsTaxonomyTerm() {
$this->drupalLogin($user);
// Visit the main taxonomy administration page.
$this->drupalGet('admin/structure/taxonomy/' . $vocabulary->id() . '/add');
$this->drupalGet('admin/structure/taxonomy/manage/' . $vocabulary->id() . '/add');
$this->assertResponse(403, 'Add taxonomy term form open failed.');
// Create a test term.
......
......@@ -142,7 +142,7 @@ function testTaxonomyAdminDeletingVocabulary() {
// Delete the vocabulary.
$edit = array();
$this->drupalPost('admin/structure/taxonomy/' . $vocabulary->id() . '/edit', $edit, t('Delete'));
$this->drupalPost('admin/structure/taxonomy/manage/' . $vocabulary->id() . '/edit', $edit, t('Delete'));
$this->assertRaw(t('Are you sure you want to delete the vocabulary %name?', array('%name' => $vocabulary->name)), '[confirm deletion] Asks for confirmation.');
$this->assertText(t('Deleting a vocabulary will delete all the terms in it. This action cannot be undone.'), '[confirm deletion] Inform that all terms will be deleted.');
......
......@@ -107,26 +107,6 @@ protected function actions(array $form, array &$form_state) {
}
}
/**
* Overrides Drupal\Core\Entity\EntityFormController::validate().
*/
public function validate(array $form, array &$form_state) {
parent::validate($form, $form_state);
// Make sure that the machine name of the vocabulary is not in the
// disallowed list (names that conflict with menu items, such as 'list'
// and 'add').
// During the deletion there is no 'vid' key.
if (isset($form_state['values']['vid'])) {
// Do not allow machine names to conflict with taxonomy path arguments.
$vid = $form_state['values']['vid'];
$disallowed = array('add', 'list');
if (in_array($vid, $disallowed)) {
form_set_error('vid', t('The machine-readable name cannot be "add" or "list".'));
}
}
}
/**
* Submit handler to update the bundle for the default language configuration.
*/
......@@ -172,13 +152,13 @@ public function save(array $form, array &$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/structure/taxonomy/' . $vocabulary->id() . '/edit'));
$form_state['redirect'] = 'admin/structure/taxonomy/' . $vocabulary->id();
watchdog('taxonomy', 'Created new vocabulary %name.', array('%name' => $vocabulary->name), WATCHDOG_NOTICE, l(t('edit'), 'admin/structure/taxonomy/manage/' . $vocabulary->id() . '/edit'));
$form_state['redirect'] = 'admin/structure/taxonomy/manage/' . $vocabulary->id();
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/structure/taxonomy/' . $vocabulary->id() . '/edit'));
watchdog('taxonomy', 'Updated vocabulary %name.', array('%name' => $vocabulary->name), WATCHDOG_NOTICE, l(t('edit'), 'admin/structure/taxonomy/manage/' . $vocabulary->id() . '/edit'));
$form_state['redirect'] = 'admin/structure/taxonomy';
break;
}
......
......@@ -42,15 +42,15 @@ function taxonomy_overview_vocabularies($form) {
$links = array();
$links['edit'] = array(
'title' => t('edit vocabulary'),
'href' => "admin/structure/taxonomy/{$vocabulary->id()}/edit",
'href' => "admin/structure/taxonomy/manage/{$vocabulary->id()}/edit",
);
$links['list'] = array(
'title' => t('list terms'),
'href' => "admin/structure/taxonomy/{$vocabulary->id()}",
'href' => "admin/structure/taxonomy/manage/{$vocabulary->id()}",
);
$links['add'] = array(
'title' => t('add terms'),
'href' => "admin/structure/taxonomy/{$vocabulary->id()}/add",
'href' => "admin/structure/taxonomy/manage/{$vocabulary->id()}/add",
);
$form['vocabularies'][$vocabulary->id()]['operations'] = array(
'#type' => 'operations',
......@@ -234,7 +234,7 @@ function taxonomy_overview_terms($form, &$form_state, Vocabulary $vocabulary) {
$form['terms'] = array(
'#type' => 'table',
'#header' => array(t('Name'), t('Weight'), t('Operations')),
'#empty' => t('No terms available. <a href="@link">Add term</a>.', array('@link' => url('admin/structure/taxonomy/' . $vocabulary->id() . '/add'))),
'#empty' => t('No terms available. <a href="@link">Add term</a>.', array('@link' => url('admin/structure/taxonomy/manage/' . $vocabulary->id() . '/add'))),
'#attributes' => array(
'id' => 'taxonomy',
),
......@@ -580,7 +580,7 @@ function taxonomy_vocabulary_confirm_reset_alphabetical($form, &$form_state, $vi
return confirm_form($form,
t('Are you sure you want to reset the vocabulary %title to alphabetical order?',
array('%title' => $vocabulary->label())),
'admin/structure/taxonomy/' . $vocabulary->id(),
'admin/structure/taxonomy/manage/' . $vocabulary->id(),
t('Resetting a vocabulary will discard all custom ordering and sort items alphabetically.'),
t('Reset to alphabetical'),
t('Cancel'));
......@@ -598,5 +598,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/structure/taxonomy/' . $form_state['values']['vid'];
$form_state['redirect'] = 'admin/structure/taxonomy/manage/' . $form_state['values']['vid'];
}
......@@ -68,8 +68,8 @@ function taxonomy_help($path, $arg) {
case 'admin/structure/taxonomy':
$output = '<p>' . t('Taxonomy is for categorizing content. Terms are grouped into vocabularies. For example, a vocabulary called "Fruit" would contain the terms "Apple" and "Banana".') . '</p>';
return $output;
case 'admin/structure/taxonomy/%':
$vocabulary = taxonomy_vocabulary_load($arg[3]);
case 'admin/structure/taxonomy/manage/%':
$vocabulary = taxonomy_vocabulary_load($arg[4]);
switch ($vocabulary->hierarchy) {
case TAXONOMY_HIERARCHY_DISABLED:
return '<p>' . t('You can reorganize the terms in %capital_name using their drag-and-drop handles, and group terms under a parent term by sliding them under and to the right of the parent.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) . '</p>';
......@@ -128,7 +128,7 @@ function taxonomy_entity_bundle_info() {
$bundles['taxonomy_term'][$id] = array(
'label' => $config->get('name'),
'admin' => array(
'real path' => 'admin/structure/taxonomy/' . $id,
'real path' => 'admin/structure/taxonomy/manage/' . $id,
),
);
}
......@@ -324,35 +324,35 @@ function taxonomy_menu() {
'file' => 'taxonomy.pages.inc',
);
$items['admin/structure/taxonomy/%taxonomy_vocabulary'] = array(
$items['admin/structure/taxonomy/manage/%taxonomy_vocabulary'] = array(
'title callback' => 'entity_page_label',
'title arguments' => array(3),
'title arguments' => array(4),
'page callback' => 'drupal_get_form',
'page arguments' => array('taxonomy_overview_terms', 3),
'page arguments' => array('taxonomy_overview_terms', 4),
'access callback' => 'entity_page_access',
'access arguments' => array(3, 'view'),
'access arguments' => array(4, 'view'),
'file' => 'taxonomy.admin.inc',
);
$items['admin/structure/taxonomy/%taxonomy_vocabulary/list'] = array(
$items['admin/structure/taxonomy/manage/%taxonomy_vocabulary/list'] = array(
'title' => 'List',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['admin/structure/taxonomy/%taxonomy_vocabulary/edit'] = array(
$items['admin/structure/taxonomy/manage/%taxonomy_vocabulary/edit'] = array(
'title' => 'Edit',
'page callback' => 'entity_get_form',
'page arguments' => array(3),
'page arguments' => array(4),
'access callback' => 'entity_page_access',
'access arguments' => array(3, 'update'),
'access arguments' => array(4, 'update'),
'type' => MENU_LOCAL_TASK,
'file' => 'taxonomy.admin.inc',
);
$items['admin/structure/taxonomy/%taxonomy_vocabulary/add'] = array(
$items['admin/structure/taxonomy/manage/%taxonomy_vocabulary/add'] = array(
'title' => 'Add term',
'page callback' => 'taxonomy_term_add',
'page arguments' => array(3),
'page arguments' => array(4),
'access callback' => 'taxonomy_term_create_access',
'access arguments' => array(3),
'access arguments' => array(4),
'type' => MENU_LOCAL_ACTION,
'file' => 'taxonomy.admin.inc',
);
......
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