diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-07-08 15:24:30 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-07-08 15:24:30 +0000 |
commit | 898bdeffafe913417951ec214d57ec930ea90812 (patch) | |
tree | daae02095efd8209bd8b213cb1b0a9bacc3bdc31 | |
parent | 144c1abb587f7a66e9f03b242ef359d4e0e670f5 (diff) | |
download | brdo-898bdeffafe913417951ec214d57ec930ea90812.tar.gz brdo-898bdeffafe913417951ec214d57ec930ea90812.tar.bz2 |
- Marked required fields on the node (story, book, page, blog) and comment
forms using the $required argument of the form_ functions.
- Replaced all Optional's and Required's from the taxonomy forms with proper
use of the form_ functions.
Please check your contributed modules too!
-rw-r--r-- | modules/book.module | 2 | ||||
-rw-r--r-- | modules/book/book.module | 2 | ||||
-rw-r--r-- | modules/comment.module | 11 | ||||
-rw-r--r-- | modules/comment/comment.module | 11 | ||||
-rw-r--r-- | modules/node.module | 6 | ||||
-rw-r--r-- | modules/node/node.module | 6 | ||||
-rw-r--r-- | modules/page.module | 2 | ||||
-rw-r--r-- | modules/page/page.module | 2 | ||||
-rw-r--r-- | modules/story.module | 2 | ||||
-rw-r--r-- | modules/story/story.module | 2 | ||||
-rw-r--r-- | modules/taxonomy.module | 46 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.module | 46 |
12 files changed, 74 insertions, 64 deletions
diff --git a/modules/book.module b/modules/book.module index 50aae88f6..d099993ee 100644 --- a/modules/book.module +++ b/modules/book.module @@ -238,7 +238,7 @@ function book_form(&$node) { $output .= implode('', taxonomy_node_form('book', $node)); } - $output .= form_textarea(t('Body'), 'body', $node->body, 60, 20, filter_tips_short()); + $output .= form_textarea(t('Body'), 'body', $node->body, 60, 20, filter_tips_short(), NULL, TRUE); $output .= form_textarea(t('Log message'), 'log', $node->log, 60, 5, t('An explanation of the additions or updates being made to help the group understand your motivations.')); if (user_access('administer nodes')) { diff --git a/modules/book/book.module b/modules/book/book.module index 50aae88f6..d099993ee 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -238,7 +238,7 @@ function book_form(&$node) { $output .= implode('', taxonomy_node_form('book', $node)); } - $output .= form_textarea(t('Body'), 'body', $node->body, 60, 20, filter_tips_short()); + $output .= form_textarea(t('Body'), 'body', $node->body, 60, 20, filter_tips_short(), NULL, TRUE); $output .= form_textarea(t('Log message'), 'log', $node->log, 60, 5, t('An explanation of the additions or updates being made to help the group understand your motivations.')); if (user_access('administer nodes')) { diff --git a/modules/comment.module b/modules/comment.module index 63abc01d1..0782ef2e7 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -84,7 +84,7 @@ function comment_help($section) { case 'admin/comment/configure/matrix': return t("Here is where you assign a value to each item in the dropdown menu. This value is added to the vote total, which is then divided by the number of users who have voted and rounded off to the nearest integer.<br />Notes:<ul><li>In order to use comment moderation, every text box on this page should be populated.</li><li>You must assign the \"moderate comments\" permission to at least one role in order to use this page.</li><li>Every box not filled in will have a value of zero, which will have the effect of lowering a comments over all score.</li></ul>"); case 'admin/comment/configure/thresholds': - return t("Optional. Here you can setup the name and minimum \"cut off\" score to help your users hide comments that they don't want too see. These thresholds appear in the Comment Control Panel. Click \"edit\" to edit the values of an already existing threshold. To delete a threshold click on \"edit\"."); + return t("Here you can setup the name and minimum \"cut off\" score to help your users hide comments that they don't want too see. These thresholds appear in the Comment Control Panel. Click \"edit\" to edit the values of an already existing threshold. To delete a threshold click on \"edit\"."); case 'admin/comment/configure/votes': return t('Here is where you set up the name of each type of vote. "Weight" lets you set the order of the drop down menu. Click "edit" to edit a current vote weight.<br />Notes: <ul><li>you can have more than one type with the same name. The system does not protect you from this.</li><li>To delete a name/weight combination go to the "edit" area.</li></ul>'); case 'admin/comment/configure/roles': @@ -1255,11 +1255,16 @@ function theme_comment_form($edit, $title) { if ($user->uid) { $form .= form_item(t('Your name'), format_name($user)); } - else if (variable_get('comment_anonymous', 0) > 0) { + else if (variable_get('comment_anonymous', 0) == 1) { $form .= form_textfield(t('Your name'), 'name', $edit['name'] ? $edit['name'] : variable_get('anonymous', 'Anonymous') , 20, 40); $form .= form_textfield(t('E-mail'), 'mail', $edit['mail'], 20, 40); $form .= form_textfield(t('Homepage'), 'homepage', $edit['homepage'], 20, 40); } + else if (variable_get('comment_anonymous', 0) == 2) { + $form .= form_textfield(t('Your name'), 'name', $edit['name'] ? $edit['name'] : variable_get('anonymous', 'Anonymous') , 20, 40, NULL, NULL, TRUE); + $form .= form_textfield(t('E-mail'), 'mail', $edit['mail'], 20, 40, NULL, NULL, TRUE); + $form .= form_textfield(t('Homepage'), 'homepage', $edit['homepage'], 20, 40); + } // subject field: if (variable_get('comment_subject_field', 0)) { @@ -1267,7 +1272,7 @@ function theme_comment_form($edit, $title) { } // comment field: - $form .= form_textarea(t('Comment'), 'comment', $edit['comment'] ? $edit['comment'] : $user->signature, 70, 10, filter_tips_short()); + $form .= form_textarea(t('Comment'), 'comment', $edit['comment'] ? $edit['comment'] : $user->signature, 70, 10, filter_tips_short(), NULL, TRUE); // preview button: $form .= form_hidden('cid', $edit['cid']); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 63abc01d1..0782ef2e7 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -84,7 +84,7 @@ function comment_help($section) { case 'admin/comment/configure/matrix': return t("Here is where you assign a value to each item in the dropdown menu. This value is added to the vote total, which is then divided by the number of users who have voted and rounded off to the nearest integer.<br />Notes:<ul><li>In order to use comment moderation, every text box on this page should be populated.</li><li>You must assign the \"moderate comments\" permission to at least one role in order to use this page.</li><li>Every box not filled in will have a value of zero, which will have the effect of lowering a comments over all score.</li></ul>"); case 'admin/comment/configure/thresholds': - return t("Optional. Here you can setup the name and minimum \"cut off\" score to help your users hide comments that they don't want too see. These thresholds appear in the Comment Control Panel. Click \"edit\" to edit the values of an already existing threshold. To delete a threshold click on \"edit\"."); + return t("Here you can setup the name and minimum \"cut off\" score to help your users hide comments that they don't want too see. These thresholds appear in the Comment Control Panel. Click \"edit\" to edit the values of an already existing threshold. To delete a threshold click on \"edit\"."); case 'admin/comment/configure/votes': return t('Here is where you set up the name of each type of vote. "Weight" lets you set the order of the drop down menu. Click "edit" to edit a current vote weight.<br />Notes: <ul><li>you can have more than one type with the same name. The system does not protect you from this.</li><li>To delete a name/weight combination go to the "edit" area.</li></ul>'); case 'admin/comment/configure/roles': @@ -1255,11 +1255,16 @@ function theme_comment_form($edit, $title) { if ($user->uid) { $form .= form_item(t('Your name'), format_name($user)); } - else if (variable_get('comment_anonymous', 0) > 0) { + else if (variable_get('comment_anonymous', 0) == 1) { $form .= form_textfield(t('Your name'), 'name', $edit['name'] ? $edit['name'] : variable_get('anonymous', 'Anonymous') , 20, 40); $form .= form_textfield(t('E-mail'), 'mail', $edit['mail'], 20, 40); $form .= form_textfield(t('Homepage'), 'homepage', $edit['homepage'], 20, 40); } + else if (variable_get('comment_anonymous', 0) == 2) { + $form .= form_textfield(t('Your name'), 'name', $edit['name'] ? $edit['name'] : variable_get('anonymous', 'Anonymous') , 20, 40, NULL, NULL, TRUE); + $form .= form_textfield(t('E-mail'), 'mail', $edit['mail'], 20, 40, NULL, NULL, TRUE); + $form .= form_textfield(t('Homepage'), 'homepage', $edit['homepage'], 20, 40); + } // subject field: if (variable_get('comment_subject_field', 0)) { @@ -1267,7 +1272,7 @@ function theme_comment_form($edit, $title) { } // comment field: - $form .= form_textarea(t('Comment'), 'comment', $edit['comment'] ? $edit['comment'] : $user->signature, 70, 10, filter_tips_short()); + $form .= form_textarea(t('Comment'), 'comment', $edit['comment'] ? $edit['comment'] : $user->signature, 70, 10, filter_tips_short(), NULL, TRUE); // preview button: $form .= form_hidden('cid', $edit['cid']); diff --git a/modules/node.module b/modules/node.module index c48ec30ee..fd188d34e 100644 --- a/modules/node.module +++ b/modules/node.module @@ -1116,7 +1116,7 @@ function node_validate($node) { node_invoke($node, 'validate'); node_invoke_nodeapi($node, 'validate'); - $node->validated = true; + $node->validated = TRUE; return $node; } @@ -1151,7 +1151,7 @@ function node_form($edit) { $output .= '<div class="admin">'; $author = form_textfield(t('Authored by'), 'name', $edit->name, 20, 60); - $author .= form_textfield(t('Authored on'), 'date', $edit->date, 20, 25); + $author .= form_textfield(t('Authored on'), 'date', $edit->date, 20, 25, NULL, NULL, TRUE); $output .= '<div class="authored">'; $output .= form_group(t('Authoring information'), $author); @@ -1174,7 +1174,7 @@ function node_form($edit) { // Add the default fields. $output .= '<div class="standard">'; - $output .= form_textfield(t('Title'), 'title', $edit->title, 60, 128); + $output .= form_textfield(t('Title'), 'title', $edit->title, 60, 128, NULL, NULL, TRUE); // Add the node-type-specific fields. diff --git a/modules/node/node.module b/modules/node/node.module index c48ec30ee..fd188d34e 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1116,7 +1116,7 @@ function node_validate($node) { node_invoke($node, 'validate'); node_invoke_nodeapi($node, 'validate'); - $node->validated = true; + $node->validated = TRUE; return $node; } @@ -1151,7 +1151,7 @@ function node_form($edit) { $output .= '<div class="admin">'; $author = form_textfield(t('Authored by'), 'name', $edit->name, 20, 60); - $author .= form_textfield(t('Authored on'), 'date', $edit->date, 20, 25); + $author .= form_textfield(t('Authored on'), 'date', $edit->date, 20, 25, NULL, NULL, TRUE); $output .= '<div class="authored">'; $output .= form_group(t('Authoring information'), $author); @@ -1174,7 +1174,7 @@ function node_form($edit) { // Add the default fields. $output .= '<div class="standard">'; - $output .= form_textfield(t('Title'), 'title', $edit->title, 60, 128); + $output .= form_textfield(t('Title'), 'title', $edit->title, 60, 128, NULL, NULL, TRUE); // Add the node-type-specific fields. diff --git a/modules/page.module b/modules/page.module index 5f4ffe510..b5f742be4 100644 --- a/modules/page.module +++ b/modules/page.module @@ -140,7 +140,7 @@ function page_form(&$node) { $hide_types = true; } else { - $output .= form_textarea(t('Body'), 'body', $node->body, 60, 20, filter_tips_short()); + $output .= form_textarea(t('Body'), 'body', $node->body, 60, 20, filter_tips_short(), NULL, TRUE); } $output .= form_textfield(t('Link name'), 'link', $node->link, 60, 64, t('To make the page show up in the navigation links, enter the name of the link. Otherwise, leave this blank.')); diff --git a/modules/page/page.module b/modules/page/page.module index 5f4ffe510..b5f742be4 100644 --- a/modules/page/page.module +++ b/modules/page/page.module @@ -140,7 +140,7 @@ function page_form(&$node) { $hide_types = true; } else { - $output .= form_textarea(t('Body'), 'body', $node->body, 60, 20, filter_tips_short()); + $output .= form_textarea(t('Body'), 'body', $node->body, 60, 20, filter_tips_short(), NULL, TRUE); } $output .= form_textfield(t('Link name'), 'link', $node->link, 60, 64, t('To make the page show up in the navigation links, enter the name of the link. Otherwise, leave this blank.')); diff --git a/modules/story.module b/modules/story.module index ffc10f0e0..2d8357bc1 100644 --- a/modules/story.module +++ b/modules/story.module @@ -119,7 +119,7 @@ function story_form(&$node) { $output .= implode('', taxonomy_node_form('story', $node)); } - $output .= form_textarea(t('Body'), 'body', $node->body, 60, 15, filter_tips_short()); + $output .= form_textarea(t('Body'), 'body', $node->body, 60, 15, filter_tips_short(), NULL, TRUE); return $output; } diff --git a/modules/story/story.module b/modules/story/story.module index ffc10f0e0..2d8357bc1 100644 --- a/modules/story/story.module +++ b/modules/story/story.module @@ -119,7 +119,7 @@ function story_form(&$node) { $output .= implode('', taxonomy_node_form('story', $node)); } - $output .= form_textarea(t('Body'), 'body', $node->body, 60, 15, filter_tips_short()); + $output .= form_textarea(t('Body'), 'body', $node->body, 60, 15, filter_tips_short(), NULL, TRUE); return $output; } diff --git a/modules/taxonomy.module b/modules/taxonomy.module index cb7ff9e56..435d92095 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -102,15 +102,15 @@ function taxonomy_form_vocabulary($edit = array()) { $nodetypes[$type] = node_invoke($type, 'node_name'); } - $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_textfield(t('Help text'), 'help', $edit['help'], 50, 255, t('Optional') .'. '. t('Instructions to present to the user when choosing a term.') .'.'); - $form .= form_checkboxes(t('Types'), 'nodes', explode(',', $edit['nodes']), $nodetypes, t('Required') .'. '. t('A list of node types you want to associate with this vocabulary.')); - $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'))), ''); - $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_textfield(t('Vocabulary name'), 'name', $edit['name'], 50, 64, t('The name for this vocabulary. Example: "Topic".'), NULL, TRUE); + $form .= form_textarea(t('Description'), 'description', $edit['description'], 60, 5, t('Description of the vocabulary; can be used by modules.')); + $form .= form_textfield(t('Help text'), 'help', $edit['help'], 50, 255, t('Instructions to present to the user when choosing a term.')); + $form .= form_checkboxes(t('Types'), 'nodes', explode(',', $edit['nodes']), $nodetypes, t('A list of node types you want to associate with this vocabulary.'), NULL, TRUE); + $form .= form_checkbox(t('Related terms'), 'relations', 1, $edit['relations'], 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('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')))); + $form .= form_checkbox(t('Multiple select'), 'multiple', 1, $edit['multiple'], 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.')); + $form .= form_weight(t('Weight'), 'weight', $edit['weight'], 10, t('In listings, the heavier vocabularies will sink and the lighter vocabularies will be positioned nearer the top.')); $form .= form_submit(t('Submit')); if ($edit['vid']) { @@ -180,8 +180,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('The name for this term. Example: "Linux".'), NULL, TRUE); + $form .= form_textarea(t('Description'), 'description', $edit['description'], 60, 5, t('A description of the term.')); if ($vocabulary->hierarchy) { $parent = array_keys(taxonomy_get_parents($edit['tid'])); @@ -194,19 +194,19 @@ 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', NULL, NULL, 'parent') .'.', 0, '<'. t('root') .'>', $exclude); + $form .= _taxonomy_term_select(t('Parent'), 'parent', $parent, $vocabulary_id, l(t('Parent term'), 'admin/taxonomy/help', NULL, NULL, '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', NULL, NULL, 'parent') .'.', 1, '<'. t('root') .'>', $exclude); + $form .= _taxonomy_term_select(t('Parents'), 'parent', $parent, $vocabulary_id, l(t('Parent terms'), 'admin/taxonomy/help', NULL, NULL, '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, NULL, 1, '<'. t('none') .'>', array($edit['tid'])); } - $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_textarea(t('Synonyms'), 'synonyms', implode("\n", taxonomy_get_synonyms($edit['tid'])), 30, 5, 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('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')); @@ -955,9 +955,9 @@ function taxonomy_help($section = 'admin/help#taxonomy') { <h4>Setting up a vocabulary</h4> <p>When setting up a controlled vocabulary, if you select the <em>hierarchy</em> option, you will be defining a taxonomy or a thesaurus. If you select the <em>related terms</em> option, you are allowing the definition of related terms, think <em>see also</em>, as in a thesaurus. Selecting <em>multiple select</em> 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.</p> <p>When setting up a controlled vocabulary you are asked for: <ul> - <li><strong>Vocabulary name</strong> (Required) -- The name for this vocabulary. Example: <em>Dairy</em>.</li> - <li><strong>Description</strong> (Optional) -- Description of the vocabulary, this can be used by modules and feeds.</li> - <li><strong>Types</strong> (Required) -- The list of node types you want to associate this vocabulary with. Some available types are: blog, book, forum, page, story.</li> + <li><strong>Vocabulary name</strong> -- The name for this vocabulary. Example: <em>Dairy</em>.</li> + <li><strong>Description</strong> -- Description of the vocabulary, this can be used by modules and feeds.</li> + <li><strong>Types</strong> -- The list of node types you want to associate this vocabulary with. Some available types are: blog, book, forum, page, story.</li> <li><a id=\"related-terms\"></a><strong>Related terms</strong> -- Allows relationships between terms within this vocabulary. Think of these as <em>see also</em>-references.</li> <li><a id=\"hierarchy\"></a><strong>Hierarchy</strong> -- Allows a tree-like taxonomy, as in our <em>Foods</em> example above</li> <li><strong>Multiple select</strong> -- Allows nodes to be described using more than one term. Nodes may then appear on multiple taxonomy pages.</li> @@ -967,11 +967,11 @@ function taxonomy_help($section = 'admin/help#taxonomy') { <h4>Adding terms to a vocabulary</h4> <p>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 <em>related terms</em>, <em>hierarchy</em> and <em>multiple select</em>. These options are:</p> <p><ul> - <li><strong>Term name</strong> (Required) -- The name for this term. Example: <em>Milk</em></li> - <li><strong>Description</strong> (Optional) -- Description of the term that may be used by modules and feeds. This is synonymous with a 'scope note'.</li> - <li><strong><a id=\"parent\"></a>Parent</strong> (Required) -- Select the term under which this term is a subset -- the branch of the hierarchy that this term belongs under. This is also known as the \"Broader term\" indicator used in thesauri.</li> - <li><strong><a id=\"synonyms\"></a>Synonyms</strong> (Optional) -- Enter synonyms for this term, one synonym per line. Synonyms can be used for variant spellings, acronyms, and other terms that have the same meaning as the added term, but which are not explicitly listed in this thesaurus (i.e. <em>unauthorized terms</em>)</li> - <li><strong>Weight</strong> (Optional) -- The weight is used to sort the terms of this vocabulary.</li> + <li><strong>Term name</strong> -- The name for this term. Example: <em>Milk</em></li> + <li><strong>Description</strong> -- Description of the term that may be used by modules and feeds. This is synonymous with a 'scope note'.</li> + <li><strong><a id=\"parent\"></a>Parent</strong> -- Select the term under which this term is a subset -- the branch of the hierarchy that this term belongs under. This is also known as the \"Broader term\" indicator used in thesauri.</li> + <li><strong><a id=\"synonyms\"></a>Synonyms</strong> -- Enter synonyms for this term, one synonym per line. Synonyms can be used for variant spellings, acronyms, and other terms that have the same meaning as the added term, but which are not explicitly listed in this thesaurus (i.e. <em>unauthorized terms</em>)</li> + <li><strong>Weight</strong> -- The weight is used to sort the terms of this vocabulary.</li> </ul></p> <h3><a id=\"taxonomy-url\"></a>Displaying nodes organized by term(s)</h3> <p>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, <a href=\"%taxo-example\">taxonomy/page/or/1,2</a>. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the <em>querystring</em>). You may learn the term ID for a given term by hovering over that term in the <a href=\"%taxo-overview\">taxonomy overview</a> 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 <em>or</em>, which chooses nodes tagged with <strong>any</strong> of the given term IDs, or <em>and</em>, which chooses nodes tagged with <strong>all</strong> of the given Term IDs. Thus <em>or</em> is less specific than <em>and</em>. Finally add a comma separated list of term IDs.</p> diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index cb7ff9e56..435d92095 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -102,15 +102,15 @@ function taxonomy_form_vocabulary($edit = array()) { $nodetypes[$type] = node_invoke($type, 'node_name'); } - $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_textfield(t('Help text'), 'help', $edit['help'], 50, 255, t('Optional') .'. '. t('Instructions to present to the user when choosing a term.') .'.'); - $form .= form_checkboxes(t('Types'), 'nodes', explode(',', $edit['nodes']), $nodetypes, t('Required') .'. '. t('A list of node types you want to associate with this vocabulary.')); - $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'))), ''); - $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_textfield(t('Vocabulary name'), 'name', $edit['name'], 50, 64, t('The name for this vocabulary. Example: "Topic".'), NULL, TRUE); + $form .= form_textarea(t('Description'), 'description', $edit['description'], 60, 5, t('Description of the vocabulary; can be used by modules.')); + $form .= form_textfield(t('Help text'), 'help', $edit['help'], 50, 255, t('Instructions to present to the user when choosing a term.')); + $form .= form_checkboxes(t('Types'), 'nodes', explode(',', $edit['nodes']), $nodetypes, t('A list of node types you want to associate with this vocabulary.'), NULL, TRUE); + $form .= form_checkbox(t('Related terms'), 'relations', 1, $edit['relations'], 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('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')))); + $form .= form_checkbox(t('Multiple select'), 'multiple', 1, $edit['multiple'], 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.')); + $form .= form_weight(t('Weight'), 'weight', $edit['weight'], 10, t('In listings, the heavier vocabularies will sink and the lighter vocabularies will be positioned nearer the top.')); $form .= form_submit(t('Submit')); if ($edit['vid']) { @@ -180,8 +180,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('The name for this term. Example: "Linux".'), NULL, TRUE); + $form .= form_textarea(t('Description'), 'description', $edit['description'], 60, 5, t('A description of the term.')); if ($vocabulary->hierarchy) { $parent = array_keys(taxonomy_get_parents($edit['tid'])); @@ -194,19 +194,19 @@ 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', NULL, NULL, 'parent') .'.', 0, '<'. t('root') .'>', $exclude); + $form .= _taxonomy_term_select(t('Parent'), 'parent', $parent, $vocabulary_id, l(t('Parent term'), 'admin/taxonomy/help', NULL, NULL, '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', NULL, NULL, 'parent') .'.', 1, '<'. t('root') .'>', $exclude); + $form .= _taxonomy_term_select(t('Parents'), 'parent', $parent, $vocabulary_id, l(t('Parent terms'), 'admin/taxonomy/help', NULL, NULL, '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, NULL, 1, '<'. t('none') .'>', array($edit['tid'])); } - $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_textarea(t('Synonyms'), 'synonyms', implode("\n", taxonomy_get_synonyms($edit['tid'])), 30, 5, 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('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')); @@ -955,9 +955,9 @@ function taxonomy_help($section = 'admin/help#taxonomy') { <h4>Setting up a vocabulary</h4> <p>When setting up a controlled vocabulary, if you select the <em>hierarchy</em> option, you will be defining a taxonomy or a thesaurus. If you select the <em>related terms</em> option, you are allowing the definition of related terms, think <em>see also</em>, as in a thesaurus. Selecting <em>multiple select</em> 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.</p> <p>When setting up a controlled vocabulary you are asked for: <ul> - <li><strong>Vocabulary name</strong> (Required) -- The name for this vocabulary. Example: <em>Dairy</em>.</li> - <li><strong>Description</strong> (Optional) -- Description of the vocabulary, this can be used by modules and feeds.</li> - <li><strong>Types</strong> (Required) -- The list of node types you want to associate this vocabulary with. Some available types are: blog, book, forum, page, story.</li> + <li><strong>Vocabulary name</strong> -- The name for this vocabulary. Example: <em>Dairy</em>.</li> + <li><strong>Description</strong> -- Description of the vocabulary, this can be used by modules and feeds.</li> + <li><strong>Types</strong> -- The list of node types you want to associate this vocabulary with. Some available types are: blog, book, forum, page, story.</li> <li><a id=\"related-terms\"></a><strong>Related terms</strong> -- Allows relationships between terms within this vocabulary. Think of these as <em>see also</em>-references.</li> <li><a id=\"hierarchy\"></a><strong>Hierarchy</strong> -- Allows a tree-like taxonomy, as in our <em>Foods</em> example above</li> <li><strong>Multiple select</strong> -- Allows nodes to be described using more than one term. Nodes may then appear on multiple taxonomy pages.</li> @@ -967,11 +967,11 @@ function taxonomy_help($section = 'admin/help#taxonomy') { <h4>Adding terms to a vocabulary</h4> <p>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 <em>related terms</em>, <em>hierarchy</em> and <em>multiple select</em>. These options are:</p> <p><ul> - <li><strong>Term name</strong> (Required) -- The name for this term. Example: <em>Milk</em></li> - <li><strong>Description</strong> (Optional) -- Description of the term that may be used by modules and feeds. This is synonymous with a 'scope note'.</li> - <li><strong><a id=\"parent\"></a>Parent</strong> (Required) -- Select the term under which this term is a subset -- the branch of the hierarchy that this term belongs under. This is also known as the \"Broader term\" indicator used in thesauri.</li> - <li><strong><a id=\"synonyms\"></a>Synonyms</strong> (Optional) -- Enter synonyms for this term, one synonym per line. Synonyms can be used for variant spellings, acronyms, and other terms that have the same meaning as the added term, but which are not explicitly listed in this thesaurus (i.e. <em>unauthorized terms</em>)</li> - <li><strong>Weight</strong> (Optional) -- The weight is used to sort the terms of this vocabulary.</li> + <li><strong>Term name</strong> -- The name for this term. Example: <em>Milk</em></li> + <li><strong>Description</strong> -- Description of the term that may be used by modules and feeds. This is synonymous with a 'scope note'.</li> + <li><strong><a id=\"parent\"></a>Parent</strong> -- Select the term under which this term is a subset -- the branch of the hierarchy that this term belongs under. This is also known as the \"Broader term\" indicator used in thesauri.</li> + <li><strong><a id=\"synonyms\"></a>Synonyms</strong> -- Enter synonyms for this term, one synonym per line. Synonyms can be used for variant spellings, acronyms, and other terms that have the same meaning as the added term, but which are not explicitly listed in this thesaurus (i.e. <em>unauthorized terms</em>)</li> + <li><strong>Weight</strong> -- The weight is used to sort the terms of this vocabulary.</li> </ul></p> <h3><a id=\"taxonomy-url\"></a>Displaying nodes organized by term(s)</h3> <p>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, <a href=\"%taxo-example\">taxonomy/page/or/1,2</a>. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the <em>querystring</em>). You may learn the term ID for a given term by hovering over that term in the <a href=\"%taxo-overview\">taxonomy overview</a> 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 <em>or</em>, which chooses nodes tagged with <strong>any</strong> of the given term IDs, or <em>and</em>, which chooses nodes tagged with <strong>all</strong> of the given Term IDs. Thus <em>or</em> is less specific than <em>and</em>. Finally add a comma separated list of term IDs.</p> |