From c073e88c56909424ba3aa164b43d26374918cbb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Mon, 10 Dec 2007 21:54:10 +0000 Subject: #199640 by webernet: (usability) add option to select no taxonomy term in multiselect forms, not to rely on browser trickery --- modules/taxonomy/taxonomy.module | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/taxonomy/taxonomy.module') diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 48187f971..2d15b7106 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -412,11 +412,13 @@ function taxonomy_del_term($tid) { function taxonomy_form($vid, $value = 0, $help = NULL, $name = 'taxonomy') { $vocabulary = taxonomy_vocabulary_load($vid); $help = ($help) ? $help : $vocabulary->help; - $blank = 0; if (!$vocabulary->multiple) { $blank = ($vocabulary->required) ? t('- Please choose -') : t('- None selected -'); } + else { + $blank = ($vocabulary->required) ? 0 : t('- None -'); + } return _taxonomy_term_select(check_plain($vocabulary->name), $name, $value, $vid, $help, intval($vocabulary->multiple), $blank); } -- cgit v1.2.3