Commit d595fc8f authored by Dries's avatar Dries

- Started a theme.inc clean-up.

parent 8d4650c4
<?php
class BaseTheme {
function header() {
$output .= "<html><head><title>". variable_get(site_name, "drupal") ."</title></head><body>";
$output .= "<table border=\"0\" cellspacing=\"4\" cellpadding=\"4\"><tr><td valign=\"top\" width=\"170\">";
print $output;
$this->box(t("Navigation"), implode("<br />", link_page())); $this->user("all", $this); theme_blocks("all", $this);
print "</td><td valgin=\"top\">";
}
function links($links, $delimiter = " | ") {
return implode($delimiter, $links);
}
......@@ -9,7 +20,7 @@ function image($name) {
return "misc/$name";
}
function user($region, &$theme) {
function user($region) {
global $user;
if ($user->uid) {
......@@ -33,7 +44,7 @@ function user($region, &$theme) {
$output .= "</div>";
$theme->box($user->name, $output, $region);
$this->box($user->name, $output, $region);
}
else {
$output .= "<div align=\"center\">\n";
......@@ -45,10 +56,27 @@ function user($region, &$theme) {
$output .= " </form>\n";
$output .= "</div>\n";
$theme->box(t("Log in"), $output, $region);
$this->box(t("Log in"), $output, $region);
}
}
function node($node, $main) {
$output .= "<b>". check_output($node->title) ."</b> by ". format_name($node) ."<br />";
if ($main && $node->teaser) {
$output .= strip_tags(check_output($node->teaser, 1));
}
else {
$output .= check_output($node->body, 1);
}
if ($main) {
$output .= "<br />[ ". $this->links(link_node($node)) ." ]";
}
$output .= "<hr />";
print $output;
}
function comment_controls($threshold = 1, $mode = 3, $order = 1) {
global $user, $id;
......@@ -73,6 +101,18 @@ function comment($comment, $link = 0) {
$output .= "</div><br />";
print $output;
}
function box($subject, $content, $region = "main") {
$output .= "<b>". check_output($subject) ."</b><br />". check_output($content) ."<p />";
print $output;
}
function footer() {
$output .= "</td></tr></table>";
$output .= "</body></html>";
print $output;
}
}
function theme_init() {
......
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