From 22c889e7c05b1c2dd98ad5e6b3547234a3f6596f Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 7 Oct 2003 18:16:41 +0000 Subject: - Help system improvements: eliminated the _system hook. Patch by Michael. - Bloggerapi module fixes. Patch by Kjartan. - Coding style fixes. Patch by Michael. --- modules/taxonomy/taxonomy.module | 46 +++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 27 deletions(-) (limited to 'modules/taxonomy/taxonomy.module') diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index df37c6022..68d64b9ae 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1,14 +1,6 @@ must 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.")); $form .= form_submit(t("Submit")); @@ -152,8 +144,8 @@ function taxonomy_form_term($edit = array()) { $vocabulary_id = isset($edit["vid"]) ? $edit["vid"] : arg(4); $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.")); + $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->hierarchy) { $parent = array_keys(taxonomy_get_parents($edit["tid"])); @@ -166,15 +158,15 @@ function taxonomy_form_term($edit = array()) { $exclude[] = $edit["tid"]; if ($vocabulary->hierarchy == 1) { - $form .= _taxonomy_term_select(t("Parent"), "parent", $parent, $vocabulary_id, t("Required") . ". " . l(t("Parent term"), "admin/taxonomy/help#parent") .".", 0, "<" . t("root") . ">", $exclude); + $form .= _taxonomy_term_select(t("Parent"), "parent", $parent, $vocabulary_id, t("Required") .". ". l(t("Parent term"), "admin/taxonomy/help#parent") .".", 0, "<". t("root") .">", $exclude); } elseif ($vocabulary->hierarchy == 2) { - $form .= _taxonomy_term_select(t("Parents"), "parent", $parent, $vocabulary_id, t("Required") . ". ". l(t("Parent terms"), "admin/taxonomy/help#parent") .".", 1, "<" . t("root") . ">", $exclude); + $form .= _taxonomy_term_select(t("Parents"), "parent", $parent, $vocabulary_id, t("Required") .". ". l(t("Parent terms"), "admin/taxonomy/help#parent") .".", 1, "<". t("root") .">", $exclude); } } 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 .= _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.")); @@ -277,7 +269,7 @@ function _taxonomy_confirm_del_term($tid) { function taxonomy_overview() { - $output .= "

" . t("Vocabularies overview") . "

"; + $output .= "

". t("Vocabularies overview") ."

"; $header = array(t("name"), t("node types"), array("data" => t("operations"), "colspan" => 3)); @@ -308,7 +300,7 @@ function taxonomy_form($vocabulary_id, $value = 0) { } else { $verb = "can"; - $blank = "<" . t("none") . ">"; + $blank = "<". t("none") .">"; } if ($vocabulary->multiple) { @@ -615,7 +607,7 @@ function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $descripti if (count($options) > 0) { foreach ($options as $option) { - $select .= ""; + $select .= ""; } $size = min(12, count($options)); @@ -666,7 +658,7 @@ function taxonomy_select_nodes($taxonomy, $pager = 1) { $sql_count = "SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid INNER JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1'"; } else { - $sql = "SELECT n.nid, n.title, n.type, n.created, n.changed, n.uid, u.name FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid INNER JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1' GROUP BY n.nid, n.title, n.type, n.created, n.changed, n.uid, u.name HAVING COUNT(n.nid) = ".count($taxonomy->tids)." ORDER BY static DESC, created DESC"; + $sql = "SELECT n.nid, n.title, n.type, n.created, n.changed, n.uid, u.name FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid INNER JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1' GROUP BY n.nid, n.title, n.type, n.created, n.changed, n.uid, u.name HAVING COUNT(n.nid) = ". count($taxonomy->tids) ." ORDER BY static DESC, created DESC"; // Special trick as we could not find anything better: $count = db_num_rows(db_query("SELECT n.nid FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1' GROUP BY n.nid HAVING COUNT(n.nid) = ". count($taxonomy->tids))); @@ -807,16 +799,16 @@ function taxonomy_help($section = "admin/taxonomy/help") { $output = ""; switch ($section) { - case "admin/system/modules": + case 'admin/system/modules#description': $output = t("Enables the organization of content into categories."); break; - case "admin/taxonomy": + case 'admin/taxonomy': $output = t("The taxonomy module allows you to classify content into categories and subcategories; it allows multiple lists of categories for classification (controlled vocabularies) and offers the possibility of creating thesauri (controlled vocabularies that indicate the relationship of terms) and taxonomies (controlled vocabularies where relationships are indicated hierarchically). To delete a term choose \"edit term\". To delete a vocabulary, and all its terms, choose \"edit vocabulary\"."); break; - case "admin/taxonomy/add/vocabulary": + case 'admin/taxonomy/add/vocabulary': $output = t("When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node type (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot.org's or Kuro5hin.org's sections. For more complex implementations, you might create a hierarchical list of categories."); break; - case "admin/taxonomy/help": + case 'admin/taxonomy/help': $output .= "

Background

Taxonomy is the study of classification. Drupal's taxonomy module allows you to define categories which are used to classify content. The module supports hierarchical classification and association between terms, allowing for truly flexible information retrieval and classification. For more details about %classification-types and insight into the development of the taxonomy.module, see this %drupal-dis.

"; $output .= "

An example taxonomy: food

"; $output .= "

Notes

"; -- cgit v1.2.3