diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-01-28 15:47:03 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-01-28 15:47:03 +0000 |
commit | 92320b2b21c5e018a80c981bd421cef71c3fe20e (patch) | |
tree | 65737f4614d9199e7ea035d00eaa751e0962f38a /modules/taxonomy/taxonomy.module | |
parent | bb4dff0c920bb2e9441832131721df071c1ddf8a (diff) | |
download | brdo-92320b2b21c5e018a80c981bd421cef71c3fe20e.tar.gz brdo-92320b2b21c5e018a80c981bd421cef71c3fe20e.tar.bz2 |
- Patch #10425 by ccourtne and walkah: added admin screens to maintain forums instead of forcing the user to add a taxonomy.
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r-- | modules/taxonomy/taxonomy.module | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 0ac6aa828..d76828f6e 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -145,7 +145,7 @@ function taxonomy_save_vocabulary($edit) { $edit['nodes'] = array(); } - $data = array('name' => $edit['name'], 'description' => $edit['description'], 'help' => $edit['help'], 'multiple' => $edit['multiple'], 'required' => $edit['required'], 'hierarchy' => $edit['hierarchy'], 'relations' => $edit['relations'], 'weight' => $edit['weight']); + $data = array('name' => $edit['name'], 'description' => $edit['description'], 'help' => $edit['help'], 'multiple' => $edit['multiple'], 'required' => $edit['required'], 'hierarchy' => $edit['hierarchy'], 'relations' => $edit['relations'], 'weight' => $edit['weight'], 'module' => isset($edit['module']) ? $edit['module'] : 'taxonomy'); if ($edit['vid'] && $edit['name']) { db_query('UPDATE {vocabulary} SET '. _taxonomy_prepare_update($data) .' WHERE vid = %d', $edit['vid']); db_query("DELETE FROM {vocabulary_node_types} WHERE vid = %d", $edit['vid']); @@ -357,21 +357,23 @@ function taxonomy_overview() { $vocabularies = taxonomy_get_vocabularies(); foreach ($vocabularies as $vocabulary) { - $types = array(); - foreach($vocabulary->nodes as $type) { - $node_type = node_invoke($type, 'node_name'); - $types[] = $node_type ? $node_type : $type; - } + if ($vocabulary->module == 'taxonomy') { // only show vocabularies that can be configured through the vocabulary module + $types = array(); + foreach($vocabulary->nodes as $type) { + $node_type = node_invoke($type, 'node_name'); + $types[] = $node_type ? $node_type : $type; + } - $rows[] = array($vocabulary->name, array('data' => implode(', ', $types), 'align' => 'center'), l(t('edit vocabulary'), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"), l(t('add term'), "admin/taxonomy/add/term/$vocabulary->vid"), l(t('preview form'), "admin/taxonomy/preview/vocabulary/$vocabulary->vid")); + $rows[] = array($vocabulary->name, array('data' => implode(', ', $types), 'align' => 'center'), l(t('edit vocabulary'), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"), l(t('add term'), "admin/taxonomy/add/term/$vocabulary->vid"), l(t('preview form'), "admin/taxonomy/preview/vocabulary/$vocabulary->vid")); - $tree = taxonomy_get_tree($vocabulary->vid); - if ($tree) { - unset($data); + $tree = taxonomy_get_tree($vocabulary->vid); + if ($tree) { + unset($data); foreach ($tree as $term) { $data .= _taxonomy_depth($term->depth) .' '. $term->name .' ('. l(t('edit term'), "admin/taxonomy/edit/term/$term->tid") .')<br />'; } $rows[] = array(array('data' => $data, 'colspan' => '5')); + } } } |