- Patch #100429 by Zen, RobRoy and kkaefer: remove the content type requirement.

6.x
Dries Buytaert 2007-04-10 10:16:29 +00:00
parent 07e6bdcdfe
commit 30bf1d53ae
1 changed files with 6 additions and 4 deletions

View File

@ -255,11 +255,10 @@ function taxonomy_form_vocabulary($edit = array()) {
'#description' => t('Instructions to present to the user when choosing a term.'), '#description' => t('Instructions to present to the user when choosing a term.'),
); );
$form['nodes'] = array('#type' => 'checkboxes', $form['nodes'] = array('#type' => 'checkboxes',
'#title' => t('Types'), '#title' => t('Content types'),
'#default_value' => $edit['nodes'], '#default_value' => $edit['nodes'],
'#options' => node_get_types('names'), '#options' => node_get_types('names'),
'#description' => t('A list of node types you want to associate with this vocabulary.'), '#description' => t('A list of content types you would like to categorize using this vocabulary.'),
'#required' => TRUE,
); );
$form['hierarchy'] = array('#type' => 'radios', $form['hierarchy'] = array('#type' => 'radios',
'#title' => t('Hierarchy'), '#title' => t('Hierarchy'),
@ -316,6 +315,7 @@ function taxonomy_form_vocabulary_submit($form_id, $form_values) {
drupal_set_message(t('Updated vocabulary %name.', array('%name' => $form_values['name']))); drupal_set_message(t('Updated vocabulary %name.', array('%name' => $form_values['name'])));
break; break;
} }
return 'admin/content/taxonomy'; return 'admin/content/taxonomy';
} }
@ -1135,7 +1135,9 @@ function taxonomy_vocabulary_load($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); $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(); $node_types = array();
while ($voc = db_fetch_object($result)) { while ($voc = db_fetch_object($result)) {
$node_types[] = $voc->type; if (!empty($voc->type)) {
$node_types[] = $voc->type;
}
unset($voc->type); unset($voc->type);
$voc->nodes = $node_types; $voc->nodes = $node_types;
$vocabularies[$vid] = $voc; $vocabularies[$vid] = $voc;