Commit c52185b6 authored by Kjartan's avatar Kjartan
Browse files

- taxo_link always returns array().
- Remove dead code from Marvin theme.
- cleaner node html in Marvin.
parent 9c0fd014
...@@ -38,7 +38,7 @@ function taxonomy_link($type, $node = NULL) { ...@@ -38,7 +38,7 @@ function taxonomy_link($type, $node = NULL) {
} }
} }
else if ($type == "taxonomy terms" && $node != NULL) { else if ($type == "taxonomy terms" && $node != NULL) {
$links = array();
if ($node->taxonomy) { if ($node->taxonomy) {
foreach ($node->taxonomy as $tid) { foreach ($node->taxonomy as $tid) {
$term = taxonomy_get_term($tid); $term = taxonomy_get_term($tid);
......
...@@ -38,7 +38,7 @@ function taxonomy_link($type, $node = NULL) { ...@@ -38,7 +38,7 @@ function taxonomy_link($type, $node = NULL) {
} }
} }
else if ($type == "taxonomy terms" && $node != NULL) { else if ($type == "taxonomy terms" && $node != NULL) {
$links = array();
if ($node->taxonomy) { if ($node->taxonomy) {
foreach ($node->taxonomy as $tid) { foreach ($node->taxonomy as $tid) {
$term = taxonomy_get_term($tid); $term = taxonomy_get_term($tid);
......
...@@ -2,12 +2,6 @@ ...@@ -2,12 +2,6 @@
// $Id$ // $Id$
class Theme_marvin extends BaseTheme { class Theme_marvin extends BaseTheme {
var $link = "#666699";
// General colorset that can be used for this theme
var $foreground = "#000000";
var $background = "#eaeaea";
function system($field) { function system($field) {
$system["name"] = "Marvin"; $system["name"] = "Marvin";
$system["author"] = "Dries"; $system["author"] = "Dries";
...@@ -28,7 +22,7 @@ function header($title = "") { ...@@ -28,7 +22,7 @@ function header($title = "") {
print $title ." - ". variable_get("site_name", "drupal"); print $title ." - ". variable_get("site_name", "drupal");
} }
else { else {
print variable_get("site_name", "drupal") ." - ". variable_get("site_slogan", ""); print variable_get("site_name", "drupal") . ($slogan = variable_get("site_slogan", "")) ? " - $slogan" : "";
} }
?> ?>
</title> </title>
...@@ -39,7 +33,7 @@ function header($title = "") { ...@@ -39,7 +33,7 @@ function header($title = "") {
<body<?php print theme_onload_attribute(); ?>> <body<?php print theme_onload_attribute(); ?>>
<table border="0" cellpadding="8" cellspacing="0"> <table border="0" cellpadding="8" cellspacing="0">
<tr> <tr>
<td><a href="index.php"><img src="<?php print $this->path; ?>/images/logo.png" style="border: 0px;" alt="" title="" /></a></td> <td><a href="<?php print url(); ?>"><img src="<?php print $this->path; ?>/images/logo.png" style="border: 0px;" alt="" title="" /></a></td>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
<tr> <tr>
...@@ -59,25 +53,32 @@ function node($node, $main = 0) { ...@@ -59,25 +53,32 @@ function node($node, $main = 0) {
if (module_exist("taxonomy")) { if (module_exist("taxonomy")) {
$terms = taxonomy_link("taxonomy terms", $node); $terms = taxonomy_link("taxonomy terms", $node);
} }
if (count($terms)) {
$colspan = " colspan=\"2\"";
}
print "\n<!-- node: \"$node->title\" -->\n"; print "\n<!-- node: \"$node->title\" -->\n";
print "<table cellpadding=\"0\" cellspacing=\"0\" style=\"border 0px; width: 100%;\">\n"; print "<table cellpadding=\"0\" cellspacing=\"0\" style=\"border 0px; width: 100%;\">\n";
print " <tr><td colspan=\"2\"><img src=\"$this->path/images/drop.gif\" alt=\"\" title=\"\" /> &nbsp; <b>$node->title</b></td></tr>\n"; print " <tr><td$colspan><img src=\"$this->path/images/drop.gif\" alt=\"\" title=\"\" /> &nbsp; <b>$node->title</b></td></tr>\n";
print " <tr style=\"vertical-align: bottom;\"><td colspan=\"2\" style=\"background-color: #000000; width: 100%;\"><img src=\"$this->path/images/pixel.gif\" width=\"1\" height=\"1\" alt=\"\" title=\"\" /></td></tr>\n"; print " <tr style=\"vertical-align: bottom;\"><td colspan=\"2\" style=\"background-color: #000000; width: 100%;\"><img src=\"$this->path/images/pixel.gif\" width=\"1\" height=\"1\" alt=\"\" title=\"\" /></td></tr>\n";
print " <tr><td><div style=\"color: #7c7c7c;\"><small>". t("Submitted by %a on %b", array("%a" => format_name($node), "%b" => format_date($node->created, "large"))); ?><?php print "</small></div></td><td style=\"text-align: right; vertical-align: top;\"><small>". ($terms ? $this->links($terms) : "") ."</small></td></tr>\n"; print " <tr><td><div style=\"color: #7c7c7c;\"><small>". t("Submitted by %a on %b", array("%a" => format_name($node), "%b" => format_date($node->created, "large"))) ."</small></div></td>";
print " <tr><td colspan=\"2\">&nbsp;</td></tr>\n"; if ($colspan) {
print "<td style=\"text-align: right; vertical-align: top;\"><small>". $this->links($terms) ."</small></td>";
}
print " </tr>\n";
print " <tr><td$colspan>&nbsp;</td></tr>\n";
if ($main && $node->teaser) { if ($main && $node->teaser) {
print " <tr><td colspan=\"2\"><p>$node->teaser</p></td></tr>\n"; print " <tr><td$colspan><p>$node->teaser</p></td></tr>\n";
} }
else { else {
print " <tr><td colspan=\"2\"><p>$node->body</p></td></tr>\n"; print " <tr><td$colspan><p>$node->body</p></td></tr>\n";
} }
print " <tr><td colspan=\"2\">&nbsp;</td></tr>\n"; print " <tr><td$colspan>&nbsp;</td></tr>\n";
if ($links = link_node($node, $main)) { if ($links = link_node($node, $main)) {
print " <tr><td colspan=\"2\">". $this->links($links) ."</td></tr>\n"; print " <tr><td$colspan>". $this->links($links) ."</td></tr>\n";
} }
print "</table>\n"; print "</table>\n";
......
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