diff options
author | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2001-06-11 17:42:51 +0000 |
---|---|---|
committer | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2001-06-11 17:42:51 +0000 |
commit | 8f7eddbed6ae6e9b244b601686bcdc2e31a40edc (patch) | |
tree | 999a5da54beb61c8caefb6fd93db9b06d9f8adbf /includes | |
parent | d397bbe93587f015cd8db0dbf16ef6d1c1aef78b (diff) | |
download | brdo-8f7eddbed6ae6e9b244b601686bcdc2e31a40edc.tar.gz brdo-8f7eddbed6ae6e9b244b601686bcdc2e31a40edc.tar.bz2 |
Changes
- fixed the trailing | in some cases.
- removed theme_morelinks().
- added node_links().
- simplified BaseTheme->links().
- updated themes.
Notes
- the new links system is taking form, but concider it beta. There might still
be some major changes ahead so I suggest waiting a little longer before
modifying your theme to take advantage of it.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/theme.inc | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index 4bc6e57ea..d37b73cd9 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1,16 +1,16 @@ <?php class BaseTheme { - function links($links = array(), $status = 0, $node = 0) { - if ($status == 1) - $links = array_merge(theme_morelink($node), $links); - + function links(&$links, $state = 0) { + // $state = 0 : default behaviour + // $state = 1 : main page + // $state = 2 : theme_link() + // Subject to change coz its messy foreach ($links as $link) { - $_links[] = count($link) == 2 ? "<A HREF=\"$link[0]\"><FONT COLOR=\"$theme->link\">". t($link[1]) ."</FONT></A>" : t($link[0]); + if ($link[0]) $_links[] = count($link) == 2 ? "<A HREF=\"$link[0]\"><FONT COLOR=\"$theme->link\">". t($link[1]) ."</FONT></A>" : t($link[0]); } - if ($status == 2) return ($_links ? implode(" | ", $_links) : ""); - else return ($_links ? "[ ". implode(" | ", $_links) ." ]" : ""); + return ($_links ? implode(" | ", $_links) : ""); } } @@ -112,17 +112,6 @@ function theme_blocks($region, $theme) { } } -function theme_morelink(&$node) { - if ($node->body) { - $links[] = array("node.php?id=$node->nid", t("read more")); - } - if ($node->comment) { - $links[] = array("node.php?id=$node->nid", format_plural(node_get_comments($node->nid), "comment", "comments")); - } - - return $links; -} - function theme_moderation_results($theme, $node) { foreach (explode(";", $node->users) as $vote) { if ($vote) { |