Commit 64f8781f authored by Kjartan's avatar Kjartan

- made the themes path aware. If your theme creates a constructor function it

  will now be passed the filename as the first parameter.
parent 02f0dce5
......@@ -139,7 +139,7 @@ function theme_init() {
if (is_object($themes[$name])) {
include_once($themes[$name]->filename);
$theme_class = "Theme_$name";
@$obj =& new $theme_class;
@$obj =& new $theme_class($themes[$name]->filename);
return $obj;
}
......
This diff is collapsed.
......@@ -17,7 +17,11 @@ class Theme_marvin extends BaseTheme {
// General colorset that can be used for this theme
var $foreground = "#000000";
var $background = "#EAEAEA";
function Theme_marvin($filename) {
$this->path = dirname($filename);
}
function system($field) {
$system["name"] = "Marvin";
$system["author"] = "Dries";
......@@ -66,7 +70,7 @@ function header($title = "") {
<body text="#000000" bgcolor="#ffffff" alink="#cccccc" link="#665566" vlink="#665566">
<table border="0" cellpadding="8" cellspacing="0">
<tr>
<td><a href="index.php"><img src="themes/marvin/images/logo.png" alt="" border="0" /></a></td>
<td><a href="index.php"><img src="<?php print $this->path; ?>/images/logo.png" alt="" border="0" /></a></td>
<td>&nbsp;</td>
</tr>
<tr>
......@@ -94,8 +98,8 @@ function node($node, $main = 0) {
print "\n<!-- node: \"$node->title\" -->\n";
print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
print " <tr><td colspan=\"2\"><img src=\"themes/marvin/images/drop.gif\" alt=\"\" /> &nbsp; <b>". check_output($node->title) ."</b></td></tr>\n";
print " <tr valign=\"bottom\"><td colspan=\"2\" bgcolor=\"#000000\" width=\"100%\"><img src=\"themes/marvin/images/pixel.gif\" width=\"1\" height=\"1\" alt=\"\" /></td></tr>\n";
print " <tr><td colspan=\"2\"><img src=\"$this->path/images/drop.gif\" alt=\"\" /> &nbsp; <b>". check_output($node->title) ."</b></td></tr>\n";
print " <tr valign=\"bottom\"><td colspan=\"2\" bgcolor=\"#000000\" width=\"100%\"><img src=\"$this->path/images/pixel.gif\" width=\"1\" height=\"1\" alt=\"\" /></td></tr>\n";
print " <tr><td nowrap=\"nowrap\"><font color=\"#7C7C7C\"><small>". t("Submitted by %a on %b", array("%a" => format_name($node), "%b" => format_date($node->created, "large"))); ?><?php print "</small></font></td><td align=\"right\" valign=\"top\" nowrap=\"nowrap\"><small>". $this->links($terms) ."</small></td></tr>\n";
print " <tr><td colspan=\"2\">&nbsp;</td></tr>\n";
......
......@@ -37,6 +37,10 @@ class Theme_unconed extends BaseTheme {
var $bgcolor3 = "#D7D7D7";
var $fgcolor3 = "#000000";
function Theme_unconed($filename) {
$this->path = dirname($filename);
}
function system($field) {
$system["name"] = "UnConeD";
$system["author"] = "Steven Wittens";
......@@ -66,12 +70,12 @@ function header($title = "") {
</HEAD>
<BODY TEXT="#000000" BGCOLOR="<?php print $this->clc0; ?>" ALINK="#000000" LINK="#404040" VLINK="#404040" MARGINHEIGHT="10" MARGINWIDTH="10">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" ALIGN="CENTER" WIDTH="100%">
<TR><TD BGCOLOR="<?php print $this->cl00; ?>"><IMG SRC="themes/<?php print $this->themename; ?>/images/null.gif" WIDTH="10"></TD><TD BGCOLOR="<?php print $this->clc0; ?>"><IMG SRC="themes/<?php print $this->themename; ?>/images/null.gif" WIDTH="4"></TD>
<TR><TD BGCOLOR="<?php print $this->cl00; ?>"><IMG SRC="<?php print $this->path; ?>/images/null.gif" WIDTH="10"></TD><TD BGCOLOR="<?php print $this->clc0; ?>"><IMG SRC="<?php print $this->path; ?>/images/null.gif" WIDTH="4"></TD>
<TD BGCOLOR="<?php print $this->cl80; ?>">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="9" BGCOLOR="<?php print $this->cl80; ?>">
<TR>
<TD COLSPAN="2">
<TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0" BGCOLOR="<?php echo $this->brcolor1; ?>"><TR><TD ALIGN="CENTER"><TABLE BORDER="0" WIDTH="100%" CELLSPACING="1" CELLPADDING="4"><TR><TD ALIGN="CENTER" BGCOLOR="<?php echo $this->bgcolor2; ?>"><IMG SRC="themes/<?php print $this->themename; ?>/images/logo.png" ALT="logo"></TD></TR></TABLE></TD></TR></TABLE>
<TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0" BGCOLOR="<?php echo $this->brcolor1; ?>"><TR><TD ALIGN="CENTER"><TABLE BORDER="0" WIDTH="100%" CELLSPACING="1" CELLPADDING="4"><TR><TD ALIGN="CENTER" BGCOLOR="<?php echo $this->bgcolor2; ?>"><IMG SRC="<?php print $this->path; ?>/images/logo.png" ALT="logo"></TD></TR></TABLE></TD></TR></TABLE>
</TD>
</TR>
<TR>
......@@ -83,7 +87,7 @@ function header($title = "") {
print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" BGCOLOR=\"$this->brcolor1;\" WIDTH=\"100%\">";
print "<TR><TD>";
print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"1\" WIDTH=\"100%\">";
print "<TR><TD ALIGN=\"center\" BGCOLOR=\"$this->bgcolor2\"><FONT COLOR=\"$this->fgcolor1\"><IMG SRC=\"themes/" . $this->themename . "/images/null.gif\" WIDTH=\"2\" HEIGHT=\"2\"></FONT></TD></TR>";
print "<TR><TD ALIGN=\"center\" BGCOLOR=\"$this->bgcolor2\"><FONT COLOR=\"$this->fgcolor1\"><IMG SRC=\"" . $this->path . "/images/null.gif\" WIDTH=\"2\" HEIGHT=\"2\"></FONT></TD></TR>";
print "</TABLE>";
print "</TD></TR></TABLE>";
?></TD></TR>
......@@ -99,7 +103,7 @@ function node($node, $main = 0) {
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" BGCOLOR="<?php echo $this->brcolor1; ?>" WIDTH="100%">
<TR><TD>
<TABLE BORDER="0" CELLPADDING="4" CELLSPACING="1" WIDTH="100%">
<TR><TD COLSPAN="2" BGCOLOR="<?php echo $this->bgcolor1; ?>" WIDTH="100%"><table width="100%" cellpadding="0" cellspacing="0"><tr><td width="100%"><FONT COLOR="<?php echo $this->fgcolor1; ?>"><B><?php echo "". check_output($node->title) .""; ?></B></FONT></td><td valign="middle" align="center"><IMG SRC="themes/<?php print $this->themename; ?>/images/icon.gif" valign="middle"></td></tr></table></TD></TR>
<TR><TD COLSPAN="2" BGCOLOR="<?php echo $this->bgcolor1; ?>" WIDTH="100%"><table width="100%" cellpadding="0" cellspacing="0"><tr><td width="100%"><FONT COLOR="<?php echo $this->fgcolor1; ?>"><B><?php echo "". check_output($node->title) .""; ?></B></FONT></td><td valign="middle" align="center"><IMG SRC="<?php print $this->path; ?>/images/icon.gif" valign="middle"></td></tr></table></TD></TR>
<TR BGCOLOR="<?php echo $this->bgcolor2; ?>">
<?php
if (function_exists("taxonomy_node_get_terms")) {
......@@ -217,7 +221,7 @@ function footer() {
print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" BGCOLOR=\"$this->brcolor1;\" WIDTH=\"100%\">";
print "<TR><TD>";
print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"1\" WIDTH=\"100%\">";
print "<TR><TD ALIGN=\"center\" BGCOLOR=\"$this->bgcolor2\"><FONT COLOR=\"$this->fgcolor1\"><IMG SRC=\"themes/" . $this->themename . "/images/null.gif\" WIDTH=\"2\" HEIGHT=\"2\"></FONT></TD></TR>";
print "<TR><TD ALIGN=\"center\" BGCOLOR=\"$this->bgcolor2\"><FONT COLOR=\"$this->fgcolor1\"><IMG SRC=\"" . $this->path . "/images/null.gif\" WIDTH=\"2\" HEIGHT=\"2\"></FONT></TD></TR>";
print "</TABLE>";
print "</TD></TR></TABLE>";
?></TD></TR>
......@@ -227,7 +231,7 @@ function footer() {
</TD>
</TR>
</TABLE>
</TD><TD BGCOLOR="<?php print $this->clc0; ?>"><IMG SRC="themes/<?php print $this->themename; ?>/images/null.gif" WIDTH="4"></TD><TD BGCOLOR="<?php print $this->cl00; ?>"><IMG SRC="themes/<?php print $this->themename; ?>/images/null.gif" WIDTH="10"></TD></TR>
</TD><TD BGCOLOR="<?php print $this->clc0; ?>"><IMG SRC="<?php print $this->path; ?>/images/null.gif" WIDTH="4"></TD><TD BGCOLOR="<?php print $this->cl00; ?>"><IMG SRC="<?php print $this->path; ?>/images/null.gif" WIDTH="10"></TD></TR>
</TABLE>
</BODY>
</HTML>
......
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