From d595fc8f4edb6a4d097f9e452fac70e7838bcb45 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 20 Oct 2001 13:35:12 +0000 Subject: - Started a theme.inc clean-up. --- includes/theme.inc | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) (limited to 'includes') diff --git a/includes/theme.inc b/includes/theme.inc index 4d0e3b017..ed6a2c80e 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1,6 +1,17 @@ ". variable_get(site_name, "drupal") .""; + $output .= "
"; + + print $output; + $this->box(t("Navigation"), implode("
", link_page())); $this->user("all", $this); theme_blocks("all", $this); + print "
"; + + } + function links($links, $delimiter = " | ") { return implode($delimiter, $links); } @@ -9,7 +20,7 @@ class BaseTheme { return "misc/$name"; } - function user($region, &$theme) { + function user($region) { global $user; if ($user->uid) { @@ -33,7 +44,7 @@ class BaseTheme { $output .= ""; - $theme->box($user->name, $output, $region); + $this->box($user->name, $output, $region); } else { $output .= "
\n"; @@ -45,10 +56,27 @@ class BaseTheme { $output .= " \n"; $output .= "
\n"; - $theme->box(t("Log in"), $output, $region); + $this->box(t("Log in"), $output, $region); + } + } + + function node($node, $main) { + $output .= "". check_output($node->title) ." by ". format_name($node) ."
"; + if ($main && $node->teaser) { + $output .= strip_tags(check_output($node->teaser, 1)); + } + else { + $output .= check_output($node->body, 1); } + if ($main) { + $output .= "
[ ". $this->links(link_node($node)) ." ]"; + } + $output .= "
"; + + print $output; } + function comment_controls($threshold = 1, $mode = 3, $order = 1) { global $user, $id; @@ -73,6 +101,18 @@ class BaseTheme { $output .= "
"; print $output; } + + function box($subject, $content, $region = "main") { + $output .= "". check_output($subject) ."
". check_output($content) ."

"; + print $output; + } + + function footer() { + $output .= "

"; + $output .= ""; + print $output; + } + } function theme_init() { -- cgit v1.2.3