Commit 6b343106 authored by natrak's avatar natrak

Changes

- created a BaseTheme class in theme.inc.
- added links($links = array(), $status = 0, $node = 0) to BaseTheme.
- modified all themes to extend from BaseTheme.
- modiefied theme_link() to take advantage of $theme->links().
- theme_morelink() does not require a $theme argument.

Todo
- add the other standard variables and functions to BaseTheme.
- some themes could use some more modifications.

Weird
- marvin.theme still has a story() function.
parent 9e498458
......@@ -11,7 +11,7 @@
*********************************************************************/
class Theme {
class Theme extends BaseTheme {
// General colorset that can be used for this theme
var $foreground = "#000000";
var $background = "#FFFFFF";
......@@ -86,7 +86,7 @@ function linksbar() { // helper function to prevent double code
</tr>
<tr>
<td class="lgl"><img src="themes/goofy/images/null.gif" alt=""></td>
<td class="lgcnt" width="100%" valign="top"><div align="center"><big><?php print theme_link(" | "); ?></big></div></td>
<td class="lgcnt" width="100%" valign="top"><div align="center"><big><?php print theme_link(); ?></big></div></td>
<td class="lgr"><img src="themes/goofy/images/null.gif" alt=""></td>
</tr>
<tr>
......@@ -99,12 +99,12 @@ function linksbar() { // helper function to prevent double code
} // close linksbar function
function node($node, $main = 0) {
function node($node, $main = 0, $links = 0) {
echo "\n<!-- node: \"$node->title\" -->\n";
$title = check_output($node->title);
$subleft = strtr(t("Submitted by %a on %b"), array("%a" => format_username($node->userid), "%b" => format_date($node->timestamp, "large")));
$subright = category_name($node->cid) ." / ". topic_name($node->tid);
$body = check_output($node->body, 1) . ($main ? "<hr color=\"#404040\" size=\"1\"><div align=\"right\">" . theme_morelink($this, $node) . "</div>" : "");
$body = check_output($node->body, 1) . ($main || $links ? "<hr color=\"#404040\" size=\"1\"><div align=\"right\">" . $this->links($links, $main, $node) . "</div>" : "");
print "<script language=\"JavaScript\"><!--\ns(\"". $this->stripbreaks(addslashes($title)) ."\",\"". $this->stripbreaks(addslashes($subleft)) ."\",\"". $this->stripbreaks(addslashes($subright)) ."\",\"". $this->stripbreaks(addslashes($body)) ."\"); // -->\n</script>\n";
} // close node function
......
......@@ -9,7 +9,7 @@
*********************************************************************/
class Theme {
class Theme extends BaseTheme {
// General colorset that can be used for this theme
var $foreground = "#000000";
var $background = "#E7E7E7";
......@@ -84,7 +84,7 @@ function header() {
} // close header function
function node($node, $main = 0) {
function node($node, $main = 0, $links = 0) {
?>
......@@ -138,8 +138,7 @@ function node($node, $main = 0) {
<tr>
<td colspan="2" align="right">
<?php
if ($main)
echo "<FONT COLOR=\"#E09226\">". theme_morelink($this, $node) ."</FONT>";
if ($main || $links) echo $this->links($links, $main, $node);
?>
......@@ -311,7 +310,7 @@ function footer() {
<tr>
<td align="left" width="20" height="20" background="themes/jeroen/images/footerleft.gif" nowrap>&nbsp;</td>
<td width="100%" background="themes/jeroen/images/footer.gif" align="center" valign="middle">
<FONT COLOR="#E09226" SIZE="2">[ <?php print theme_link(" | "); ?> ] </FONT>
<FONT COLOR="#E09226" SIZE="2">[ <?php print theme_link(); ?> ] </FONT>
</td>
<td align="right" width="20" background="themes/jeroen/images/footerright.gif" nowrap>&nbsp;</td>
</tr>
......
......@@ -9,7 +9,7 @@
*********************************************************************/
class Theme {
class Theme extends BaseTheme {
var $foreground = "#000000";
var $background = "#F0F0F0";
......@@ -110,8 +110,9 @@ function do_nav() {
<?php
} // close header function
function node($node, $main = 0) {
function node($node, $main = 0, $links = 0) {
switch ($node->tid) {
case 0: $color = "#c4a2a2"; $img = "square2.gif"; break;
......@@ -144,8 +145,8 @@ function node($node, $main = 0) {
<tr>
<td align=\"right\">
<font color=\"". $color ."\">";
if ($main)
echo "". theme_morelink($this, $node) ."";
if ($main || $links)
echo $this->links($links, $main, $node);
echo"</font>";
?>
......
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