Commit 21a0e8b9 authored by Dries's avatar Dries

- Updated code to use new semantics of url() and l().
parent be2f4058
......@@ -838,9 +838,6 @@ function url($url = NULL, $query = NULL, $fragment = NULL) {
if (isset($fragment)) {
$fragment = "#$fragment";
}
else {
$fragment = '';
}
if (variable_get("clean_url", "0") == "0") {
if (isset($url)) {
......
......@@ -356,7 +356,7 @@ function comment_post($edit) {
** Add entry to the watchdog log:
*/
watchdog("special", "comment: updated '". $edit["subject"] ."'", l(t("view comment"), "node/view/". $edit["nid"] ."#". $edit["cid"]));
watchdog("special", "comment: updated '". $edit["subject"] ."'", l(t("view comment"), "node/view/". $edit["nid"], NULL, NULL, $edit["cid"]));
}
else {
/*
......@@ -476,7 +476,7 @@ function comment_post($edit) {
** Add entry to the watchdog log:
*/
watchdog("special", "comment: added '". $edit["subject"] ."'", l(t("view comment"), "node/view/". $edit["nid"] ."#". $edit["cid"]));
watchdog("special", "comment: added '". $edit["subject"] ."'", l(t("view comment"), "node/view/". $edit["nid"], NULL, NULL, $edit["cid"]));
}
/*
......@@ -511,7 +511,7 @@ function comment_links($comment, $return = 1) {
*/
if ($return) {
$links[] = l(t("parent"), comment_referer_load() ."#$comment->cid");
$links[] = l(t("parent"), comment_referer_load(), NULL, NULL, $comment->cid);
}
if (node_comment_mode($comment->nid) == 2) {
......@@ -789,10 +789,10 @@ function comment_link($type, $node = 0, $main = 0) {
$new = comment_num_new($node->nid);
if ($all) {
$links[] = l(format_plural($all, "1 comment", "%count comments"), "node/view/$node->nid#comment", array("title" => t("Jump to the first comment of this posting.")));
$links[] = l(format_plural($all, "1 comment", "%count comments"), "node/view/$node->nid", array("title" => t("Jump to the first comment of this posting.")), NULL, "comment");
if ($new) {
$links[] = l(format_plural($new, "1 new comment", "%count new comments"), "node/view/$node->nid#new", array("title" => t("Jump to the first new comment of this posting.")));
$links[] = l(format_plural($new, "1 new comment", "%count new comments"), "node/view/$node->nid", array("title" => t("Jump to the first new comment of this posting.")), NULL, "new");
}
}
else {
......@@ -815,7 +815,7 @@ function comment_link($type, $node = 0, $main = 0) {
if ($node->comment == 2) {
if (user_access("post comments")) {
$links[] = l(t("add new comment"), "comment/reply/$node->nid#comment", array("title" => t("Share your thoughts and opinions related to this posting.")));
$links[] = l(t("add new comment"), "comment/reply/$node->nid", array("title" => t("Share your thoughts and opinions related to this posting.")), NULL, "comment");
}
else {
$links[] = theme("comment_post_forbidden");
......@@ -913,7 +913,7 @@ function comment_node_link($node) {
$header = array(t("title"), t("author"), array("data" => t("operations"), "colspan" => 3));
while ($comment = db_fetch_object($result)) {
$rows[] = array(l($comment->subject, "node/view/$node->nid#$comment->cid"), format_name($comment), l(t("view comment"), "node/view/$node->nid#$comment->cid"), l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
$rows[] = array(l($comment->subject, "node/view/$node->nid", NULL, NULL, $comment->cid), format_name($comment), l(t("view comment"), "node/view/$node->nid", NULL, NULL, $comment->cid), l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
}
if ($rows) {
......@@ -1013,7 +1013,7 @@ function comment_admin_overview($status = 0) {
$result = pager_query($sql, 50);
while ($comment = db_fetch_object($result)) {
$rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("mark") : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
$rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128))), NULL, $comment->cid) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("mark") : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
}
if ($pager = theme("pager", NULL, 50, 0, tablesort_pager())) {
......@@ -1402,7 +1402,7 @@ function theme_comment($comment, $links = 0) {
}
function theme_comment_folded($comment) {
return "<div class=\"comment-folded\"><span class=\"subject\">". l($comment->subject, comment_referer_load() ."/$comment->cid#$comment->cid") ."</span> <span class=\"credit\">". t("by") ." ". format_name($comment) ."</span></div>";
return "<div class=\"comment-folded\"><span class=\"subject\">". l($comment->subject, comment_referer_load() ."/$comment->cid", NULL, NULL, $comment->cid) ."</span> <span class=\"credit\">". t("by") ." ". format_name($comment) ."</span></div>";
}
function theme_comment_flat_collapsed($comment, $threshold) {
......
......@@ -356,7 +356,7 @@ function comment_post($edit) {
** Add entry to the watchdog log:
*/
watchdog("special", "comment: updated '". $edit["subject"] ."'", l(t("view comment"), "node/view/". $edit["nid"] ."#". $edit["cid"]));
watchdog("special", "comment: updated '". $edit["subject"] ."'", l(t("view comment"), "node/view/". $edit["nid"], NULL, NULL, $edit["cid"]));
}
else {
/*
......@@ -476,7 +476,7 @@ function comment_post($edit) {
** Add entry to the watchdog log:
*/
watchdog("special", "comment: added '". $edit["subject"] ."'", l(t("view comment"), "node/view/". $edit["nid"] ."#". $edit["cid"]));
watchdog("special", "comment: added '". $edit["subject"] ."'", l(t("view comment"), "node/view/". $edit["nid"], NULL, NULL, $edit["cid"]));
}
/*
......@@ -511,7 +511,7 @@ function comment_links($comment, $return = 1) {
*/
if ($return) {
$links[] = l(t("parent"), comment_referer_load() ."#$comment->cid");
$links[] = l(t("parent"), comment_referer_load(), NULL, NULL, $comment->cid);
}
if (node_comment_mode($comment->nid) == 2) {
......@@ -789,10 +789,10 @@ function comment_link($type, $node = 0, $main = 0) {
$new = comment_num_new($node->nid);
if ($all) {
$links[] = l(format_plural($all, "1 comment", "%count comments"), "node/view/$node->nid#comment", array("title" => t("Jump to the first comment of this posting.")));
$links[] = l(format_plural($all, "1 comment", "%count comments"), "node/view/$node->nid", array("title" => t("Jump to the first comment of this posting.")), NULL, "comment");
if ($new) {
$links[] = l(format_plural($new, "1 new comment", "%count new comments"), "node/view/$node->nid#new", array("title" => t("Jump to the first new comment of this posting.")));
$links[] = l(format_plural($new, "1 new comment", "%count new comments"), "node/view/$node->nid", array("title" => t("Jump to the first new comment of this posting.")), NULL, "new");
}
}
else {
......@@ -815,7 +815,7 @@ function comment_link($type, $node = 0, $main = 0) {
if ($node->comment == 2) {
if (user_access("post comments")) {
$links[] = l(t("add new comment"), "comment/reply/$node->nid#comment", array("title" => t("Share your thoughts and opinions related to this posting.")));
$links[] = l(t("add new comment"), "comment/reply/$node->nid", array("title" => t("Share your thoughts and opinions related to this posting.")), NULL, "comment");
}
else {
$links[] = theme("comment_post_forbidden");
......@@ -913,7 +913,7 @@ function comment_node_link($node) {
$header = array(t("title"), t("author"), array("data" => t("operations"), "colspan" => 3));
while ($comment = db_fetch_object($result)) {
$rows[] = array(l($comment->subject, "node/view/$node->nid#$comment->cid"), format_name($comment), l(t("view comment"), "node/view/$node->nid#$comment->cid"), l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
$rows[] = array(l($comment->subject, "node/view/$node->nid", NULL, NULL, $comment->cid), format_name($comment), l(t("view comment"), "node/view/$node->nid", NULL, NULL, $comment->cid), l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
}
if ($rows) {
......@@ -1013,7 +1013,7 @@ function comment_admin_overview($status = 0) {
$result = pager_query($sql, 50);
while ($comment = db_fetch_object($result)) {
$rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("mark") : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
$rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128))), NULL, $comment->cid) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("mark") : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
}
if ($pager = theme("pager", NULL, 50, 0, tablesort_pager())) {
......@@ -1402,7 +1402,7 @@ function theme_comment($comment, $links = 0) {
}
function theme_comment_folded($comment) {
return "<div class=\"comment-folded\"><span class=\"subject\">". l($comment->subject, comment_referer_load() ."/$comment->cid#$comment->cid") ."</span> <span class=\"credit\">". t("by") ." ". format_name($comment) ."</span></div>";
return "<div class=\"comment-folded\"><span class=\"subject\">". l($comment->subject, comment_referer_load() ."/$comment->cid", NULL, NULL, $comment->cid) ."</span> <span class=\"credit\">". t("by") ." ". format_name($comment) ."</span></div>";
}
function theme_comment_flat_collapsed($comment, $threshold) {
......
......@@ -204,7 +204,7 @@ function do_search($search_array) {
$find[$i++] = array("count" => $count, "title" => $title, "link" => (strstr(request_uri(), "admin") ? url("admin/node/edit/$lno") : url("node/view/$lno")), "user" => $name, "date" => $created, "keywords" => implode("|", $words));
break;
case "comment":
$find[$i++] = array("count" => $count, "title" => $title, "link" => (strstr(request_uri(), "admin") ? url("admin/comment/edit/$lno") : url("node/view/$nid#$lno")), "user" => $name, "date" => $created, "keywords" => implode("|", $words));
$find[$i++] = array("count" => $count, "title" => $title, "link" => (strstr(request_uri(), "admin") ? url("admin/comment/edit/$lno") : url("node/view/$nid", NULL, $lno)), "user" => $name, "date" => $created, "keywords" => implode("|", $words));
break;
}
}
......
......@@ -204,7 +204,7 @@ function do_search($search_array) {
$find[$i++] = array("count" => $count, "title" => $title, "link" => (strstr(request_uri(), "admin") ? url("admin/node/edit/$lno") : url("node/view/$lno")), "user" => $name, "date" => $created, "keywords" => implode("|", $words));
break;
case "comment":
$find[$i++] = array("count" => $count, "title" => $title, "link" => (strstr(request_uri(), "admin") ? url("admin/comment/edit/$lno") : url("node/view/$nid#$lno")), "user" => $name, "date" => $created, "keywords" => implode("|", $words));
$find[$i++] = array("count" => $count, "title" => $title, "link" => (strstr(request_uri(), "admin") ? url("admin/comment/edit/$lno") : url("node/view/$nid", NULL, $lno)), "user" => $name, "date" => $created, "keywords" => implode("|", $words));
break;
}
}
......
......@@ -122,7 +122,7 @@ function system_view_general() {
$output = form_group(t("General settings"), $group);
// caching:
$group = form_radios(t("Cache support"), "cache", variable_get("cache", 0), array(t("Disabled"), t("Enabled")), t("Enable or disable the caching of rendered pages. When caching is enabled, Drupal will flush the cache when required to make sure updates take effect immediately. Check the %documentation for information on Drupal's cache system.", array("%documentation" => l(t("cache documentation"), "admin/system/help#cache"))));
$group = form_radios(t("Cache support"), "cache", variable_get("cache", 0), array(t("Disabled"), t("Enabled")), t("Enable or disable the caching of rendered pages. When caching is enabled, Drupal will flush the cache when required to make sure updates take effect immediately. Check the %documentation for information on Drupal's cache system.", array("%documentation" => l(t("cache documentation"), "admin/system/help", NULL, NULL, "cache"))));
$output .= form_group(t("Cache settings"), $group);
......
......@@ -122,7 +122,7 @@ function system_view_general() {
$output = form_group(t("General settings"), $group);
// caching:
$group = form_radios(t("Cache support"), "cache", variable_get("cache", 0), array(t("Disabled"), t("Enabled")), t("Enable or disable the caching of rendered pages. When caching is enabled, Drupal will flush the cache when required to make sure updates take effect immediately. Check the %documentation for information on Drupal's cache system.", array("%documentation" => l(t("cache documentation"), "admin/system/help#cache"))));
$group = form_radios(t("Cache support"), "cache", variable_get("cache", 0), array(t("Disabled"), t("Enabled")), t("Enable or disable the caching of rendered pages. When caching is enabled, Drupal will flush the cache when required to make sure updates take effect immediately. Check the %documentation for information on Drupal's cache system.", array("%documentation" => l(t("cache documentation"), "admin/system/help", NULL, NULL, "cache"))));
$output .= form_group(t("Cache settings"), $group);
......
......@@ -74,8 +74,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#relatedterms") ." 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#hierarchy") ." between terms of this vocabulary."), "", 0);
$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("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."));
......@@ -162,10 +162,10 @@ 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", 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#parent") .".", 1, "<". t("root") .">", $exclude);
$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);
}
}
......@@ -173,7 +173,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#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(l("Synonyms", "admin/taxonomy/help", NULL, NULL, "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);
$form .= form_submit(t("Submit"));
......@@ -855,7 +855,7 @@ function taxonomy_help($section = "admin/help#taxonomy") {
$output .= "<li><strong>Vocabulary name</strong> (Required) -- The name for this vocabulary. Example: <i>Dairy</i>.</li>";
$output .= "<li><strong>Description</strong> (Optional) -- Description of the vocabulary, this can be used by modules and feeds.</li>";
$output .= "<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>";
$output .= "<li><a id=\"relatedterms\"></a><strong>Related terms</strong> -- Allows relationships between terms within this vocabulary. Think of these as <i>see also</i>-references.</li>";
$output .= "<li><a id=\"related-terms\"></a><strong>Related terms</strong> -- Allows relationships between terms within this vocabulary. Think of these as <i>see also</i>-references.</li>";
$output .= "<li><a id=\"hierarchy\"></a><strong>Hierarchy</strong> -- Allows a tree-like taxonomy, as in our <i>Foods</i> example above</li>";
$output .= "<li><strong>Multiple select</strong> -- Allows nodes to be described using more than one term. Nodes may then appear on multiple taxonomy pages.</li>";
$output .= "<li><strong>Required</strong> -- Each node has to have a term in this vacabulary associated with it.</li>";
......@@ -869,9 +869,9 @@ function taxonomy_help($section = "admin/help#taxonomy") {
$output .= "<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. <i>unauthorized terms</i>)</li>";
$output .= "<li><strong>Weight</strong> (Optional) -- The weight is used to sort the terms of this vocabulary.</li>";
$output .= "</ul></p>";
$output .= "<h3><a id=\"taxonomyURL\"></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, %taxo-example. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the %taxo-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 <i>or</i>, which chooses nodes tagged with <strong>any</strong> of the given term IDs, or <i>and</i>, which chooses nodes tagged with <strong>all</strong> of the given Term IDs. Thus <i>or</i> is less specific than <i>and</i>. Finally add a comma seperated list of term IDs.</p>";
$output .= "<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, %taxo-example. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the %taxo-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 <i>or</i>, which chooses nodes tagged with <strong>any</strong> of the given term IDs, or <i>and</i>, which chooses nodes tagged with <strong>all</strong> of the given Term IDs. Thus <i>or</i> is less specific than <i>and</i>. Finally add a comma seperated list of term IDs.</p>";
$output .= "<h3>RSS feeds</h3><p>Every term, or collection of terms, provides an %userland-rss feed to which interested users may subscribe. The URL format for a sample RSS feed is %sample-rss. Built like a Taxonomy URL, %taxo-help it starts with \"node/feed\", then has the querystring parameter, and finally the Term IDs.</p>";
$output = t($output, array("%classification-types" => "<a href=\"http://www.eleganthack.com/archives/002165.html#002165\">classification types</a>", "%drupal-dis" => "<a href=\"http://www.drupal.org/node/view/55\">drupal.org discussion</a>", "%slashdot" => "<a href=\"http://www.slashdot.com/\">Slashdot</a>", "%taxo-example" => l("taxonomy/page/or/1,2", "taxonomy/page/or/1,2"), "%taxo-overview" => l(t("taxonomy overview"), "admin/taxonomy"), "%userland-rss" => "<a href=\"http://backend.userland.com/stories/rss\">RSS</a>", "%sample-rss" => l("node/feed/or/1,2", "node/feed/or/1,2"), "%taxo-help" => l(t("see above"), "admin/taxonomy/help#taxonomyURL") ));
$output = t($output, array("%classification-types" => "<a href=\"http://www.eleganthack.com/archives/002165.html#002165\">classification types</a>", "%drupal-dis" => "<a href=\"http://www.drupal.org/node/view/55\">drupal.org discussion</a>", "%slashdot" => "<a href=\"http://www.slashdot.com/\">Slashdot</a>", "%taxo-example" => l("taxonomy/page/or/1,2", "taxonomy/page/or/1,2"), "%taxo-overview" => l(t("taxonomy overview"), "admin/taxonomy"), "%userland-rss" => "<a href=\"http://backend.userland.com/stories/rss\">RSS</a>", "%sample-rss" => l("node/feed/or/1,2", "node/feed/or/1,2"), "%taxo-help" => l(t("see above"), "admin/taxonomy/help", NULL, NULL, "taxonomy-url") ));
break;
}
......
......@@ -74,8 +74,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#relatedterms") ." 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#hierarchy") ." between terms of this vocabulary."), "", 0);
$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("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."));
......@@ -162,10 +162,10 @@ 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", 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#parent") .".", 1, "<". t("root") .">", $exclude);
$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);
}
}
......@@ -173,7 +173,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#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(l("Synonyms", "admin/taxonomy/help", NULL, NULL, "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);
$form .= form_submit(t("Submit"));
......@@ -855,7 +855,7 @@ function taxonomy_help($section = "admin/help#taxonomy") {
$output .= "<li><strong>Vocabulary name</strong> (Required) -- The name for this vocabulary. Example: <i>Dairy</i>.</li>";
$output .= "<li><strong>Description</strong> (Optional) -- Description of the vocabulary, this can be used by modules and feeds.</li>";
$output .= "<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>";
$output .= "<li><a id=\"relatedterms\"></a><strong>Related terms</strong> -- Allows relationships between terms within this vocabulary. Think of these as <i>see also</i>-references.</li>";
$output .= "<li><a id=\"related-terms\"></a><strong>Related terms</strong> -- Allows relationships between terms within this vocabulary. Think of these as <i>see also</i>-references.</li>";
$output .= "<li><a id=\"hierarchy\"></a><strong>Hierarchy</strong> -- Allows a tree-like taxonomy, as in our <i>Foods</i> example above</li>";
$output .= "<li><strong>Multiple select</strong> -- Allows nodes to be described using more than one term. Nodes may then appear on multiple taxonomy pages.</li>";
$output .= "<li><strong>Required</strong> -- Each node has to have a term in this vacabulary associated with it.</li>";
......@@ -869,9 +869,9 @@ function taxonomy_help($section = "admin/help#taxonomy") {
$output .= "<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. <i>unauthorized terms</i>)</li>";
$output .= "<li><strong>Weight</strong> (Optional) -- The weight is used to sort the terms of this vocabulary.</li>";
$output .= "</ul></p>";
$output .= "<h3><a id=\"taxonomyURL\"></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, %taxo-example. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the %taxo-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 <i>or</i>, which chooses nodes tagged with <strong>any</strong> of the given term IDs, or <i>and</i>, which chooses nodes tagged with <strong>all</strong> of the given Term IDs. Thus <i>or</i> is less specific than <i>and</i>. Finally add a comma seperated list of term IDs.</p>";
$output .= "<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, %taxo-example. Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the %taxo-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 <i>or</i>, which chooses nodes tagged with <strong>any</strong> of the given term IDs, or <i>and</i>, which chooses nodes tagged with <strong>all</strong> of the given Term IDs. Thus <i>or</i> is less specific than <i>and</i>. Finally add a comma seperated list of term IDs.</p>";
$output .= "<h3>RSS feeds</h3><p>Every term, or collection of terms, provides an %userland-rss feed to which interested users may subscribe. The URL format for a sample RSS feed is %sample-rss. Built like a Taxonomy URL, %taxo-help it starts with \"node/feed\", then has the querystring parameter, and finally the Term IDs.</p>";
$output = t($output, array("%classification-types" => "<a href=\"http://www.eleganthack.com/archives/002165.html#002165\">classification types</a>", "%drupal-dis" => "<a href=\"http://www.drupal.org/node/view/55\">drupal.org discussion</a>", "%slashdot" => "<a href=\"http://www.slashdot.com/\">Slashdot</a>", "%taxo-example" => l("taxonomy/page/or/1,2", "taxonomy/page/or/1,2"), "%taxo-overview" => l(t("taxonomy overview"), "admin/taxonomy"), "%userland-rss" => "<a href=\"http://backend.userland.com/stories/rss\">RSS</a>", "%sample-rss" => l("node/feed/or/1,2", "node/feed/or/1,2"), "%taxo-help" => l(t("see above"), "admin/taxonomy/help#taxonomyURL") ));
$output = t($output, array("%classification-types" => "<a href=\"http://www.eleganthack.com/archives/002165.html#002165\">classification types</a>", "%drupal-dis" => "<a href=\"http://www.drupal.org/node/view/55\">drupal.org discussion</a>", "%slashdot" => "<a href=\"http://www.slashdot.com/\">Slashdot</a>", "%taxo-example" => l("taxonomy/page/or/1,2", "taxonomy/page/or/1,2"), "%taxo-overview" => l(t("taxonomy overview"), "admin/taxonomy"), "%userland-rss" => "<a href=\"http://backend.userland.com/stories/rss\">RSS</a>", "%sample-rss" => l("node/feed/or/1,2", "node/feed/or/1,2"), "%taxo-help" => l(t("see above"), "admin/taxonomy/help", NULL, NULL, "taxonomy-url") ));
break;
}
......
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