Commit 0a4d2a55 authored by Dries's avatar Dries

- Updated example.theme: it's being reduced to a minimum as it can inherit
  most/all of its functions from the BaseTheme.
parent d595fc8f
<?php
/*********************************************************************
Theme: Example
Author: Jeroen Bensch (Jeroen)
Email: jeroen@drop.org
Description: Very basic theme for demonstration purposes.
*********************************************************************/
class Theme extends BaseTheme {
// General colorset that can be used for this theme
var $foreground = "#000000";
var $background = "#FFFFFF";
function header() {
?>
<HTML>
<HEAD>
<TITLE><? echo variable_get(site_name, "drupal"); ?></TITLE>
</HEAD>
<BODY>
<TABLE BORDER="0">
<TR>
<TD>
<BIG><A HREF="index.php"><?php print variable_get(site_name, "drupal"); ?></A></BIG>
</TD>
<TD ALIGN="right" COLSPAN="2">
<?php
print $this->links(link_page());
?>
</TD>
</TR>
<TR>
<TD VALIGN="top">
<?php
theme_blocks("left", $this);
?>
</TD>
<TD VALIGN="top">
<?php
} // close header function
function node($node, $main = 0) {
?>
<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="3" WIDTH="100%">
<TR>
<TD COLSPAN="2">
<BIG><?php echo check_output($node->title); ?></BIG>
</TD>
</TR>
<TR>
<TD>
<?php
echo strtr(t("by %a on %b"), array("%a" => format_name($node), "%b" => format_date($node->timestamp, "small")));
?>
</TD>
<TD ALIGN="right">
<?php
echo node_index($node);
?>
</TD>
</TR>
<TR>
<TD COLSPAN="2">
<?php
echo "<P>". check_output($node->body, 1) ."</P>";
?>
</TD>
</TR>
<TR>
<TD COLSPAN="2">
<?php
if ($main) echo $this->links(link_node($node));
?>
</TD>
</TR>
</TABLE>
<BR>
<?php
} // close node function
function comment($comment, $link = "") {
echo "<A NAME=\"$comment->cid\"></A>\n";
// Create comment header:
echo "<TABLE BORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"3\" WIDTH=\"100%\">";
echo " <TR>";
echo " <TD>";
echo t("Subject") .":";
echo " </TD>";
echo " <TD>";
echo " ". check_output($comment->subject);
echo " </TD>";
// Moderation:
echo " <TD>";
echo comment_moderation($comment);
echo " </TD>";
echo " </TR>";
// Author and date:
echo " <TR>";
echo " <TD>";
echo t("Author") .":";
echo " </TD>";
echo " <TD COLSPAN=\"2\">";
echo format_name($comment) ." on ". format_date($comment->timestamp);
echo " </TD>";
echo " </TR>";
// Body of comment:
echo " <TR>";
echo " <TD COLSPAN=\"3\">";
echo check_output($comment->comment, 1);
// Print navigation / control links:
echo " <P>$link</P>";
echo " </TD>";
echo " </TR>";
echo "</TABLE>";
} // close comment function
function box($subject, $content, $region = "main") {
?>
<TABLE>
<TR>
<TD>
<DIV ALIGN="center"><BIG><? echo $subject; ?></BIG></DIV><HR>
</TD>
</TR>
<TR>
<TD>
<?php echo $content; ?>
</TD>
</TR>
</TABLE>
<BR>
<?php
} // close box function
function footer() {
?>
</TD>
<TD VALIGN="top">
<?php
global $PHP_SELF;
$this->user("right", $this);
theme_blocks("right", $this);
?>
</TD>
</TR>
<TR>
<TD ALIGN="center" COLSPAN="3">
<P><?php print $this->links(link_page()); ?></P>
<P><SMALL><?php print variable_get(site_footer, ""); ?></SMALL></P>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
<?
}
}
?>
?>
\ No newline at end of file
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