diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-03-03 19:18:19 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-03-03 19:18:19 +0000 |
commit | 03374fc0f6c97aa576dc5563fdb6f5b2d99e6b40 (patch) | |
tree | a944619a112dcac5885b12cdcba551da799fe293 /modules/taxonomy/taxonomy.module | |
parent | 4a9b9f4acadeea58bc4f67bf1f9d5c6d4f96d41f (diff) | |
download | brdo-03374fc0f6c97aa576dc5563fdb6f5b2d99e6b40.tar.gz brdo-03374fc0f6c97aa576dc5563fdb6f5b2d99e6b40.tar.bz2 |
- Patch #17897 by Neil: changed the order of the joins so that a vocabulary which is not associated with any node types doesn't disappear. Also removed a centered column that shouldn't be hard coded and, IMO, looked rather weird.
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r-- | modules/taxonomy/taxonomy.module | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index f2a5663c9..76f13a362 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -344,7 +344,7 @@ function taxonomy_overview() { $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, implode(', ', $types), 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) { @@ -381,9 +381,9 @@ function taxonomy_form($vid, $value = 0, $help = NULL, $name = 'taxonomy') { } /** -* Generate a set of options for selecting a term from all vocabularies. Can be -* passed to form_select. -*/ + * Generate a set of options for selecting a term from all vocabularies. Can be + * passed to form_select. + */ function taxonomy_form_all($value = 0, $help = NULL, $name = 'taxonomy') { $vocabularies = taxonomy_get_vocabularies(); $options = array(); @@ -406,12 +406,11 @@ function taxonomy_form_all($value = 0, $help = NULL, $name = 'taxonomy') { * If set, return only those vocabularies associated with this node type. */ function taxonomy_get_vocabularies($type = NULL) { - if ($type) { - $result = db_query("SELECT v.*, n.type FROM {vocabulary_node_types} n INNER JOIN {vocabulary} v ON v.vid = n.vid WHERE n.type = '%s' ORDER BY v.weight, v.name", $type); + $result = db_query("SELECT v.*, n.type FROM {vocabulary} v LEFT JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE n.type = '%s' ORDER BY v.weight, v.name", $type); } else { - $result = db_query('SELECT v.*, n.type FROM {vocabulary_node_types} n INNER JOIN {vocabulary} v ON v.vid = n.vid ORDER BY v.weight, v.name'); + $result = db_query('SELECT v.*, n.type FROM {vocabulary} v LEFT JOIN {vocabulary_node_types} n ON v.vid = n.vid ORDER BY v.weight, v.name'); } $vocabularies = array(); @@ -711,7 +710,7 @@ function taxonomy_get_term_by_name($name) { * Return the vocabulary object matching a vocabulary ID. */ function taxonomy_get_vocabulary($vid) { - $result = db_query('SELECT v.*, n.type FROM {vocabulary_node_types} n INNER JOIN {vocabulary} v ON v.vid = n.vid WHERE v.vid = %d ORDER BY v.weight, v.name', $vid); + $result = db_query('SELECT v.*, n.type FROM {vocabulary} v LEFT JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE v.vid = %d ORDER BY v.weight, v.name', $vid); $node_types = array(); while ($voc = db_fetch_object($result)) { $node_types[] = $voc->type; |