From b85eb11e113396490720572d11d30cd83c772ba1 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 23 Jan 2004 18:42:43 +0000 Subject: Patch 5287 by Stefan: multiline help texts should become inside a single $output. --- modules/taxonomy.module | 71 ++++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 31 deletions(-) (limited to 'modules/taxonomy.module') diff --git a/modules/taxonomy.module b/modules/taxonomy.module index 07f4639c0..c7726e039 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -65,10 +65,8 @@ function taxonomy_link($type, $node = NULL) { */ function taxonomy_form_vocabulary($edit = array()) { - foreach (module_list() as $name) { - if (module_hook($name, "node")) { - $nodetypes[$name] = module_invoke($name, "node", "name"); - } + foreach (node_list() as $type => $module) { + $nodetypes[$type] = module_invoke($module, "node", "name", $type); } $form .= form_textfield(t("Vocabulary name"), "name", $edit["name"], 50, 64, t("Required") .". ". t("The name for this vocabulary. Example: 'Topic'") ."."); @@ -282,7 +280,11 @@ function taxonomy_overview() { foreach ($vocabularies as $vocabulary) { $links = array(); - $rows[] = array($vocabulary->name, array("data" => module_invoke($vocabulary->nodes, "node", "name"), "align" => "center"), l(t("edit vocabulary"), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"), l(t("add term"), "admin/taxonomy/add/term/$vocabulary->vid"), l(t("preview form"), "admin/taxonomy/preview/vocabulary/$vocabulary->vid")); + $types = array(); + foreach(explode(",", $vocabulary->nodes) as $type) { + $types[] = module_invoke(node_get_module_name($type), "node", "name", $type); + } + $rows[] = array($vocabulary->name, array("data" => implode(", ", $types), "align" => "center"), l(t("edit vocabulary"), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"), l(t("add term"), "admin/taxonomy/add/term/$vocabulary->vid"), l(t("preview form"), "admin/taxonomy/preview/vocabulary/$vocabulary->vid")); $tree = taxonomy_get_tree($vocabulary->vid); if ($tree) { @@ -848,32 +850,39 @@ function taxonomy_help($section = "admin/help#taxonomy") { $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/help#taxonomy': - $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.org discussion.

"; - $output .= "

An example taxonomy: food

"; - $output .= "

Notes

"; - $output .= "

Vocabularies

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 of content (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's sections. For more complex implementations, you might create a hierarchical list of categories such as Food taxonomy shown above.

"; - $output .= "

Setting up a vocabulary

When setting up a controlled vocabulary, if you select the hierarchy option, you will be defining a taxonomy or a thesaurus. If you select the related terms option, you are allowing the definition of related terms, think see also, as in a thesaurus. Selecting multiple select will allow you to describe a node using more than one term. That node will then appear in each term's page, thus increasing the chance that a user will find it.

"; - $output .= "

When setting up a controlled vocabulary you are asked for:

"; - $output .= "

Adding terms to a vocabulary

Once done defining the vocabulary, you have to add terms to it to make it useful. The options you see when adding a term to a vocabulary will depend on what you selected for related terms, hierarchy and multiple select. These options are:

"; - $output .= "

"; - $output .= "

Displaying nodes organized by term(s)

In order to view the nodes associated with a term or a collection of terms, you should browse to a properly formed Taxonomy URL. For example, taxonomy/page/or/1,2. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the querystring). You may learn the term ID for a given term by hovering over that term in the taxonomy overview page and noting the number at the end or the URL. To build a Taxonomy URL start with \"taxonomy/page\". Now add the querystring parameter, either or, which chooses nodes tagged with any of the given term IDs, or and, which chooses nodes tagged with all of the given Term IDs. Thus or is less specific than and. Finally add a comma seperated list of term IDs.

"; - $output .= "

RSS feeds

Every term, or collection of terms, provides an RSS feed to which interested users may subscribe. The URL format for a sample RSS feed is node/feed/or/1,2. Built like a Taxonomy URL, see above it starts with \"node/feed\", then has the querystring parameter, and finally the Term IDs.

"; - $output = t($output, array("%classification-types" => "http://www.eleganthack.com/archives/002165.html#002165", "%drupal-dis" => "http://www.drupal.org/node/view/55", "%slashdot" => "http://www.slashdot.com/", "%taxo-example" => url("taxonomy/page/or/1,2"), "%taxo-overview" => url("admin/taxonomy"), "%userland-rss" => "http://backend.userland.com/stories/rss", "%sample-rss" => url("node/feed/or/1,2"), "%taxo-help" => url("admin/taxonomy/help", NULL, "taxonomy-url") )); + $output .= t(" +

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.org discussion.

+

An example taxonomy: food

+ +

Notes

+

Vocabularies

+

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 of content (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's sections. For more complex implementations, you might create a hierarchical list of categories such as Food taxonomy shown above.

+

Setting up a vocabulary

+

When setting up a controlled vocabulary, if you select the hierarchy option, you will be defining a taxonomy or a thesaurus. If you select the related terms option, you are allowing the definition of related terms, think see also, as in a thesaurus. Selecting multiple select will allow you to describe a node using more than one term. That node will then appear in each term's page, thus increasing the chance that a user will find it.

+

When setting up a controlled vocabulary you are asked for:

+

Adding terms to a vocabulary

+

Once done defining the vocabulary, you have to add terms to it to make it useful. The options you see when adding a term to a vocabulary will depend on what you selected for related terms, hierarchy and multiple select. These options are:

+

+

Displaying nodes organized by term(s)

+

In order to view the nodes associated with a term or a collection of terms, you should browse to a properly formed Taxonomy URL. For example, taxonomy/page/or/1,2. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the querystring). You may learn the term ID for a given term by hovering over that term in the taxonomy overview page and noting the number at the end or the URL. To build a Taxonomy URL start with \"taxonomy/page\". Now add the querystring parameter, either or, which chooses nodes tagged with any of the given term IDs, or and, which chooses nodes tagged with all of the given Term IDs. Thus or is less specific than and. Finally add a comma seperated list of term IDs.

+

RSS feeds

+

Every term, or collection of terms, provides an RSS feed to which interested users may subscribe. The URL format for a sample RSS feed is node/feed/or/1,2. Built like a Taxonomy URL, see above it starts with \"node/feed\", then has the querystring parameter, and finally the Term IDs.

", array("%classification-types" => "http://www.eleganthack.com/archives/002165.html#002165", "%drupal-dis" => "http://www.drupal.org/node/view/55", "%slashdot" => "http://www.slashdot.com/", "%taxo-example" => url("taxonomy/page/or/1,2"), "%taxo-overview" => url("admin/taxonomy"), "%userland-rss" => "http://backend.userland.com/stories/rss", "%sample-rss" => url("node/feed/or/1,2"), "%taxo-help" => url("admin/taxonomy/help", NULL, "taxonomy-url"))); break; } -- cgit v1.2.3