Commit 5689a985 authored by Kjartan's avatar Kjartan

- Fixed bug #1298 : Taxonomy: Edit term doesn't show parent and related

  terms.
- Added feature #1299 : Order of related terms and parent in taxonomy
  admin.
parent b5ba5e22
......@@ -134,20 +134,12 @@ function _taxonomy_confirm_del_vocabulary($vid) {
}
function taxonomy_form_term($edit = array()) {
$vocabulary_id = arg(3);
if (!$vocabulary_id) {
$vocabulary_id = $edit["vid"];
}
$vocabulary_id = isset($edit["vid"]) ? $edit["vid"] : arg(3);
$vocabulary = taxonomy_get_vocabulary($vocabulary_id);
$form = form_textfield(t("Term name"), "name", $edit["name"], 50, 64, t("Required") . ". " . t("The name for this term. Example: 'Linux'."));
$form .= form_textarea(t("Description"), "description", $edit["description"], 60, 5, t("Optional") . ". " . t("A description of the term."));
if ($vocabulary->relations) {
$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"]));
}
if ($vocabulary->hierarchy) {
$parent = array_keys(taxonomy_get_parents($edit["tid"]));
$children = taxonomy_get_tree($vocabulary_id, $edit["tid"]);
......@@ -166,6 +158,10 @@ function taxonomy_form_term($edit = array()) {
}
}
if ($vocabulary->relations) {
$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#synonyms") ." of this term, one synonym per line."));
$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);
......
......@@ -134,20 +134,12 @@ function _taxonomy_confirm_del_vocabulary($vid) {
}
function taxonomy_form_term($edit = array()) {
$vocabulary_id = arg(3);
if (!$vocabulary_id) {
$vocabulary_id = $edit["vid"];
}
$vocabulary_id = isset($edit["vid"]) ? $edit["vid"] : arg(3);
$vocabulary = taxonomy_get_vocabulary($vocabulary_id);
$form = form_textfield(t("Term name"), "name", $edit["name"], 50, 64, t("Required") . ". " . t("The name for this term. Example: 'Linux'."));
$form .= form_textarea(t("Description"), "description", $edit["description"], 60, 5, t("Optional") . ". " . t("A description of the term."));
if ($vocabulary->relations) {
$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"]));
}
if ($vocabulary->hierarchy) {
$parent = array_keys(taxonomy_get_parents($edit["tid"]));
$children = taxonomy_get_tree($vocabulary_id, $edit["tid"]);
......@@ -166,6 +158,10 @@ function taxonomy_form_term($edit = array()) {
}
}
if ($vocabulary->relations) {
$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#synonyms") ." of this term, one synonym per line."));
$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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment