diff options
Diffstat (limited to 'modules/taxonomy.module')
-rw-r--r-- | modules/taxonomy.module | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/modules/taxonomy.module b/modules/taxonomy.module index 0a2c01827..245e1ba54 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -72,8 +72,8 @@ function taxonomy_form_vocabulary($edit = array()) { $form .= form_textfield(t("Vocabulary name"), "name", $edit["name"], 50, 64, t("Required") .". ". t("The name for this vocabulary. Example: 'Topic'") ."."); $form .= form_textarea(t("Description"), "description", $edit["description"], 60, 5, t("Optional") .". ". t("Description of the vocabulary, can be used by modules.")); $form .= form_select(t("Types"), "nodes", explode(",", $edit["nodes"]), $nodetypes, t("Required") .". ". t("A list of node types you want to associate this vocabulary with."), "", 1); - $form .= form_checkbox(t("Related terms"), "relations", 1, $edit["relations"], t("Optional") .". ". t("Allows ". l("related terms", "admin/taxonomy/help", NULL, NULL, "related-terms") ." in this vocabulary.")); - $form .= form_radios(t("Hierarchy"), "hierarchy", $edit["hierarchy"], array(t("Disabled"), t("Single"), t("Multiple")), t("Optional") .". ". t("Allows ". l("a tree-like hierarchy", "admin/taxonomy/help", NULL, NULL, "hierarchy") ." between terms of this vocabulary."), "", 0); + $form .= form_checkbox(t("Related terms"), "relations", 1, $edit["relations"], t("Optional") .". ". t("Allows <a href=\"%help-url\">related terms</a> in this vocabulary.", array("%help-url" => url("admin/taxonomy/help", NULL, NULL, "related-terms")))); + $form .= form_radios(t("Hierarchy"), "hierarchy", $edit["hierarchy"], array(t("Disabled"), t("Single"), t("Multiple")), t("Optional") .". ". t("Allows <a href=\"%help-url\">a tree-like hierarchy</a> between terms of this vocabulary.", array("%help-url" => url("admin/taxonomy/help", NULL, NULL, "hierarchy"))), "", 0); $form .= form_checkbox(t("Multiple select"), "multiple", 1, $edit["multiple"], t("Optional") .". ". t("Allows nodes to have more than one term in this vocabulary.")); $form .= form_checkbox(t("Required"), "required", 1, $edit["required"], t("If enabled every node <strong>must</strong> have at least one term in this vocabulary")); $form .= form_weight(t("Weight"), "weight", $edit["weight"], 10, t("Optional. In listings, the heavier vocabularies will sink and the lighter vocabularies will be positioned nearer the top.")); @@ -171,7 +171,7 @@ function taxonomy_form_term($edit = array()) { $form .= _taxonomy_term_select(t("Related terms"), "relations", array_keys(taxonomy_get_related($edit["tid"])), $vocabulary_id, t("Optional") .". ", 1, "<". t("none") .">", array($edit["tid"])); } - $form .= form_textarea(t("Synonyms"), "synonyms", implode("\n", taxonomy_get_synonyms($edit["tid"])), 30, 5, t("Optional") . ". ". t(l("Synonyms", "admin/taxonomy/help", NULL, NULL, "synonyms") ." of this term, one synonym per line.")); + $form .= form_textarea(t("Synonyms"), "synonyms", implode("\n", taxonomy_get_synonyms($edit["tid"])), 30, 5, t("Optional") . ". ". t("<a href=\"%help-url\">Synonyms</a> of this term, one synonym per line.", array("%help-url" => url("admin/taxonomy/help", NULL, NULL, "synonyms")))); $form .= form_weight(t("Weight"), "weight", $edit["weight"], 10, t("Optional. In listings, the heavier terms will sink and the lighter terms will be positioned nearer the top.")); $form .= form_hidden("vid", $vocabulary->vid); $form .= form_submit(t("Submit")); @@ -302,23 +302,17 @@ function taxonomy_overview() { function taxonomy_form($vocabulary_id, $value = 0) { $vocabulary = taxonomy_get_vocabulary($vocabulary_id); if ($vocabulary->required) { - $verb = "must"; + $descriptions = array(t("You must choose one term for this node."), t("You must choose one or more terms for this node.")); $blank = 0; } else { - $verb = "can"; + $descriptions = array(t("You can choose one term for this node."), t("You can choose one or more terms for this node.")); $blank = "<". t("none") .">"; } - if ($vocabulary->multiple) { - $description = t("You $verb choose one or more terms for this node."); - $multiple = 1; - } - else { - $description = t("You $verb choose one term for this node."); - $multiple = 0; - } - return _taxonomy_term_select($vocabulary->name, "taxonomy", $value, $vocabulary_id, $description, $multiple, $blank); + $multiple = intval($vocabulary->multiple); + + return _taxonomy_term_select($vocabulary->name, "taxonomy", $value, $vocabulary_id, $descriptions[$multiple], $multiple, $blank); } /* |