From 64f8781f789912751849c506a9a412ed27ddd0db Mon Sep 17 00:00:00 2001 From: Kjartan Mannes Date: Sat, 16 Nov 2002 18:06:32 +0000 Subject: [PATCH] - made the themes path aware. If your theme creates a constructor function it will now be passed the filename as the first parameter. --- includes/theme.inc | 2 +- themes/goofy/goofy.theme | 52 +++++++++++++++++++----------------- themes/marvin/marvin.theme | 12 ++++++--- themes/unconed/unconed.theme | 16 ++++++----- 4 files changed, 47 insertions(+), 35 deletions(-) diff --git a/includes/theme.inc b/includes/theme.inc index 16910009272..8c304746613 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -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; } diff --git a/themes/goofy/goofy.theme b/themes/goofy/goofy.theme index 8dd71630cee..efeefa991a1 100644 --- a/themes/goofy/goofy.theme +++ b/themes/goofy/goofy.theme @@ -17,6 +17,10 @@ var $foreground = "#000000"; var $background = "#FFFFFF"; + function Theme_goofy($filename) { + $this->path = dirname($filename); + } + function system($field) { $system["name"] = "Goofy"; $system["author"] = "Steven Wittens"; @@ -38,20 +42,20 @@ p,ul,li,div,form,em,blockquote,quote { font-size: 10pt; font-family: tahoma,helvetica,arial; font-weight: normal; } td { font-family: tahoma,arial,helvetica; font-size: 10pt; font-weight: normal; } td.left { font-family: tahoma,arial,helvetica; font-size: 10pt; text-align: left; } - td.oru { background: url("themes/goofy/images/or-u.png"); width: 100%; } - td.ord { background: url("themes/goofy/images/or-d.png"); width: 100%; } - td.orl { background: url("themes/goofy/images/or-l.png"); } - td.orr { background: url("themes/goofy/images/or-r.png"); } + td.oru { background: url("path; ?>/images/or-u.png"); width: 100%; } + td.ord { background: url("path; ?>/images/or-d.png"); width: 100%; } + td.orl { background: url("path; ?>/images/or-l.png"); } + td.orr { background: url("path; ?>/images/or-r.png"); } td.orcnt { background: #FBC636; width: 100%; font-family: tahoma,arial,helvetica; font-size: 10pt; font-weight: bold; text-align: center; } - td.gru { background: url("themes/goofy/images/gr-u.png"); width: 100%; } - td.grd { background: url("themes/goofy/images/gr-d.png"); width: 100%; } - td.grl { background: url("themes/goofy/images/gr-l.png"); } - td.grr { background: url("themes/goofy/images/gr-r.png"); } + td.gru { background: url("path; ?>/images/gr-u.png"); width: 100%; } + td.grd { background: url("path; ?>/images/gr-d.png"); width: 100%; } + td.grl { background: url("path; ?>/images/gr-l.png"); } + td.grr { background: url("path; ?>/images/gr-r.png"); } td.grcnt { background: #C6C6C6; width: 100%; font-family: tahoma,arial,helvetica; font-size: 10pt; } - td.lgu { background: url("themes/goofy/images/lg-u.png"); width: 100%; } - td.lgd { background: url("themes/goofy/images/lg-d.png"); width: 100%; } - td.lgl { background: url("themes/goofy/images/lg-l.png"); } - td.lgr { background: url("themes/goofy/images/lg-r.png"); } + td.lgu { background: url("path; ?>/images/lg-u.png"); width: 100%; } + td.lgd { background: url("path; ?>/images/lg-d.png"); width: 100%; } + td.lgl { background: url("path; ?>/images/lg-l.png"); } + td.lgr { background: url("path; ?>/images/lg-r.png"); } td.lgcnt { background: #E4E4E4; width: 100%; font-family: tahoma,arial,helvetica; font-size: 10pt; white-space: normal; } td.lgcntnw { background: #E4E4E4; width: 100%; font-family: tahoma,arial,helvetica; font-size: 10pt; white-space: nowrap; } @@ -70,16 +74,16 @@ --> - @@ -94,19 +98,19 @@ function c(subject,mod,author,date,body) {document.writeln("
Powered by Drupal
+
Powered by Drupal
linksbar(); ?>
- - - + + + - + - + - - - + + +
links(link_page()); ?>
path = dirname($filename); + } + function system($field) { $system["name"] = "Marvin"; $system["author"] = "Dries"; @@ -66,7 +70,7 @@ - + @@ -94,8 +98,8 @@ print "\n\n"; print "
 
\n"; - print " \n"; - print " \n"; + print " \n"; + print " \n"; print " \n"; print " \n"; diff --git a/themes/unconed/unconed.theme b/themes/unconed/unconed.theme index 25249eb2e03..bbcfece95da 100644 --- a/themes/unconed/unconed.theme +++ b/themes/unconed/unconed.theme @@ -37,6 +37,10 @@ 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 @@
\"\"   ". check_output($node->title) ."
\"\"
path/images/drop.gif\" alt=\"\" />   ". check_output($node->title) ."
path/images/pixel.gif\" width=\"1\" height=\"1\" alt=\"\" />
". t("Submitted by %a on %b", array("%a" => format_name($node), "%b" => format_date($node->created, "large"))); ?>". $this->links($terms) ."
 
- + @@ -99,7 +103,7 @@
@@ -83,7 +87,7 @@ print "
-
logo
+
logo
brcolor1;\" WIDTH=\"100%\">"; print "
"; print ""; - print ""; + print ""; print "
bgcolor2\">fgcolor1\">themename . "/images/null.gif\" WIDTH=\"2\" HEIGHT=\"2\">
bgcolor2\">fgcolor1\">path . "/images/null.gif\" WIDTH=\"2\" HEIGHT=\"2\">
"; print "
"; ?>
@@ -227,7 +231,7 @@
- + brcolor1;\" WIDTH=\"100%\">"; print "
title) .""; ?>
title) .""; ?>
"; print ""; - print ""; + print ""; print "
bgcolor2\">fgcolor1\">themename . "/images/null.gif\" WIDTH=\"2\" HEIGHT=\"2\">
bgcolor2\">fgcolor1\">path . "/images/null.gif\" WIDTH=\"2\" HEIGHT=\"2\">
"; print "
"; ?>
- +