summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-15 12:13:45 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-15 12:13:45 +0000
commit394e7f2e2065fe62abadab057e7ae4a2d0a57d16 (patch)
treea3feccd43eed743b9fdeda95b632802ac9378990 /modules
parentc5c46c739c5ef2b9170a67c501db7967ca814b3b (diff)
downloadbrdo-394e7f2e2065fe62abadab057e7ae4a2d0a57d16.tar.gz
brdo-394e7f2e2065fe62abadab057e7ae4a2d0a57d16.tar.bz2
- Patch #604980 by sun: factored taxonomy_term_edit() away.
Diffstat (limited to 'modules')
-rw-r--r--modules/taxonomy/taxonomy.admin.inc6
-rw-r--r--modules/taxonomy/taxonomy.module18
-rw-r--r--modules/taxonomy/taxonomy.pages.inc12
3 files changed, 11 insertions, 25 deletions
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc
index be5b9179e..110d43d5b 100644
--- a/modules/taxonomy/taxonomy.admin.inc
+++ b/modules/taxonomy/taxonomy.admin.inc
@@ -596,7 +596,11 @@ function theme_taxonomy_overview_terms($variables) {
* @ingroup forms
* @see taxonomy_form_term_submit()
*/
-function taxonomy_form_term($form, &$form_state, $vocabulary, $edit = array()) {
+function taxonomy_form_term($form, &$form_state, $edit = array(), $vocabulary = NULL) {
+ if (!isset($vocabulary) && is_object($edit)) {
+ $vocabulary = taxonomy_vocabulary_load($edit->vid);
+ $edit = (array)$edit;
+ }
$edit += array(
'name' => '',
'description' => '',
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 129dd5404..7476f5588 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -10,7 +10,6 @@
* Implement hook_permission().
*/
function taxonomy_permission() {
-
$permissions = array(
'administer taxonomy' => array(
'title' => t('Administer taxonomy'),
@@ -187,13 +186,11 @@ function taxonomy_menu() {
'access arguments' => array('administer taxonomy'),
'file' => 'taxonomy.admin.inc',
);
-
$items['admin/structure/taxonomy/list'] = array(
'title' => 'List',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
-
$items['admin/structure/taxonomy/add'] = array(
'title' => 'Add vocabulary',
'page callback' => 'drupal_get_form',
@@ -213,21 +210,21 @@ function taxonomy_menu() {
'type' => MENU_CALLBACK,
'file' => 'taxonomy.pages.inc',
);
-
$items['taxonomy/term/%taxonomy_term/view'] = array(
'title' => 'View',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
-
$items['taxonomy/term/%taxonomy_term/edit'] = array(
'title' => 'Edit term',
- 'page callback' => 'taxonomy_term_edit',
- 'page arguments' => array(2),
+ 'title callback' => 'taxonomy_term_title',
+ 'title arguments' => array(2),
+ 'page callback' => 'drupal_get_form',
+ 'page arguments' => array('taxonomy_form_term', 2),
'access callback' => 'taxonomy_term_edit_access',
'access arguments' => array(2),
'type' => MENU_LOCAL_TASK,
'weight' => 10,
- 'file' => 'taxonomy.pages.inc',
+ 'file' => 'taxonomy.admin.inc',
);
$items['taxonomy/term/%taxonomy_term/feed'] = array(
'title' => 'Taxonomy term',
@@ -257,13 +254,11 @@ function taxonomy_menu() {
'type' => MENU_CALLBACK,
'file' => 'taxonomy.admin.inc',
);
-
$items['admin/structure/taxonomy/%taxonomy_vocabulary/edit'] = array(
'title' => 'Edit vocabulary',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -20,
);
-
$items['admin/structure/taxonomy/%taxonomy_vocabulary/list'] = array(
'title' => 'List terms',
'page callback' => 'drupal_get_form',
@@ -273,11 +268,10 @@ function taxonomy_menu() {
'weight' => -10,
'file' => 'taxonomy.admin.inc',
);
-
$items['admin/structure/taxonomy/%taxonomy_vocabulary/list/add'] = array(
'title' => 'Add term',
'page callback' => 'drupal_get_form',
- 'page arguments' => array('taxonomy_form_term', 3),
+ 'page arguments' => array('taxonomy_form_term', array(), 3),
'access arguments' => array('administer taxonomy'),
'type' => MENU_LOCAL_ACTION,
'file' => 'taxonomy.admin.inc',
diff --git a/modules/taxonomy/taxonomy.pages.inc b/modules/taxonomy/taxonomy.pages.inc
index 35c0d09be..b3a2c941a 100644
--- a/modules/taxonomy/taxonomy.pages.inc
+++ b/modules/taxonomy/taxonomy.pages.inc
@@ -76,18 +76,6 @@ function taxonomy_term_feed($term) {
}
/**
- * Page to edit a vocabulary term.
- */
-function taxonomy_term_edit($term) {
- if (isset($term)) {
- drupal_set_title($term->name);
- include_once DRUPAL_ROOT . '/'. drupal_get_path('module', 'taxonomy') . '/taxonomy.admin.inc';
- return drupal_get_form('taxonomy_form_term', taxonomy_vocabulary_load($term->vid), (array)$term);
- }
- return drupal_not_found();
-}
-
-/**
* Helper function for autocompletion
*/
function taxonomy_autocomplete($field_name, $bundle, $tags_typed = '') {