diff options
37 files changed, 496 insertions, 514 deletions
@@ -26,8 +26,8 @@ else { module_invoke(variable_get("site_frontpage", "node"), "page"); } else { - $theme->header(); - $theme->footer(); + theme("header"); + theme("footer"); } page_footer(); diff --git a/modules/aggregator.module b/modules/aggregator.module index 56b8f08e6..038ec1b26 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -60,10 +60,10 @@ function import_update() { } function import_format_item($item, $feed = 0) { - global $theme, $user; + global $user; if ($user->uid && user_access("maintain personal blog")) { - $output .= l("<img src=\"". $theme->image("blog.gif") ."\" border=\"0\" width=\"12\" height=\"16\" alt=\"". t("Blog this item") ."\" />", "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); + $output .= l("<img src=\"". theme("image", "blog.gif") ."\" border=\"0\" width=\"12\" height=\"16\" alt=\"". t("Blog this item") ."\" />", "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); } // external link @@ -503,7 +503,7 @@ function import_admin() { } function import_page_info() { - global $theme; + $links[] = l(t("latest news"), "import", array("title" => t("Read the latest news from syndicated websites."))); $links[] = l(t("news by source"), "import/feeds", array("title" => t("View the latest headlines sorted by source."))); @@ -514,11 +514,11 @@ function import_page_info() { $links[] = l(t("administer news feeds"), "admin/import", array("title" => t("View the news feed administrative pages."))); } - return "<div align=\"center\">". $theme->links($links) ."</div>"; + return "<div align=\"center\">". theme("links", $links) ."</div>"; } function import_page_last() { - global $theme; + $result = db_query("SELECT i.*, f.title AS ftitle, f.link AS flink FROM item i LEFT JOIN feed f ON i.fid = f.fid ORDER BY i.iid DESC LIMIT ". variable_get("import_page_limit", 75)); @@ -530,7 +530,7 @@ function import_page_last() { $links[] = l(t("feed"), "import/feed/$item->fid", array("title" => t("Read more syndicated news from this feed."))); if ($item->link) { - $output .= "<tr><td><a href=\"$item->link\">$item->title</a> · ". l($item->ftitle, "import/feed/$item->fid", array("title" => t("View more information about this feed."))) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td><a href=\"$item->link\">$item->title</a> · ". l($item->ftitle, "import/feed/$item->fid", array("title" => t("View more information about this feed."))) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". theme("links", $links) ."</td></tr>\n"; } if ($item->description) { @@ -541,20 +541,20 @@ function import_page_last() { } $output .= "</table>\n"; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); - $theme->box(t("Latest news"), $output); - $theme->footer(); + theme("header"); + theme("box", t("News feeds"), import_page_info()); + theme("box", t("Latest news"), $output); + theme("footer"); } function import_page_feed($fid) { - global $theme; + $feed = db_fetch_object(db_query("SELECT * FROM feed WHERE fid = '%s'", $fid)); $header .= "<p><b>". t("Website") .":</b><div style=\"margin-left: 20px;\"><a href=\"$feed->link\">$feed->link</a></div></p>"; $header .= "<p><b>". t("Description") .":</b><div style=\"margin-left: 20px;\">$feed->description</div></p>"; - $header .= "<p><b>". t("Last update") .":</b><div style=\"margin-left: 20px;\">". format_interval(time() - $feed->timestamp) ." ". t("ago") ." <a href=\"$feed->url\"><img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" alt=\"\" /></a><br /><br /></div></p>\n"; + $header .= "<p><b>". t("Last update") .":</b><div style=\"margin-left: 20px;\">". format_interval(time() - $feed->timestamp) ." ". t("ago") ." <a href=\"$feed->url\"><img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" alt=\"\" /></a><br /><br /></div></p>\n"; $result = db_query("SELECT * FROM item WHERE fid = '%s' ORDER BY iid DESC LIMIT ". variable_get("import_page_limit", 75), $fid); @@ -566,7 +566,7 @@ function import_page_feed($fid) { $links[] = "<a href=\"$item->link\">". t("visit") ."</a>"; if ($item->link) { - $output .= "<tr><td><a href=\"$item->link\">$item->title</a></td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td><a href=\"$item->link\">$item->title</a></td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". theme("links", $links) ."</td></tr>\n"; } if ($item->description) { $output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">$item->description</div><br /></td></tr>"; @@ -576,15 +576,15 @@ function import_page_feed($fid) { } $output .= "</table>\n"; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); - $theme->box($feed->title, $header); - $theme->box(t("Latest news"), $output); - $theme->footer(); + theme("header"); + theme("box", t("News feeds"), import_page_info()); + theme("box", $feed->title, $header); + theme("box", t("Latest news"), $output); + theme("footer"); } function import_page_bundle($bid) { - global $theme; + $bundle = db_fetch_object(db_query("SELECT * FROM bundle WHERE bid = '%s'", $bid)); @@ -604,7 +604,7 @@ function import_page_bundle($bid) { $links[] = "<a href=\"$item->link\">". t("visit") ."</a>"; if ($item->link) { - $output .= "<tr><td><a href=\"$item->link\">$item->title</a> · ". l($item->ftitle, "import/feed/$item->fid", array("title" => t("View more information about this feed."))) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td><a href=\"$item->link\">$item->title</a> · ". l($item->ftitle, "import/feed/$item->fid", array("title" => t("View more information about this feed."))) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". theme("links", $links) ."</td></tr>\n"; } if ($item->description) { @@ -615,16 +615,16 @@ function import_page_bundle($bid) { } $output .= "</table>\n"; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); - $theme->box($bundle->title, $header); - $theme->box(t("Latest news"), $output); - $theme->footer(); + theme("header"); + theme("box", t("News feeds"), import_page_info()); + theme("box", $bundle->title, $header); + theme("box", t("Latest news"), $output); + theme("footer"); } function import_page_sources() { - global $theme; + $result = db_query("SELECT * FROM feed ORDER BY title"); @@ -633,12 +633,12 @@ function import_page_sources() { $output .= "<div style=\"margin-left: 20px;\">$feed->description</div><br />"; } - $output .= l("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", "import/fd", array("title" => t("View the list of syndicated websites in XML format."))) ."<br />"; + $output .= l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", "import/fd", array("title" => t("View the list of syndicated websites in XML format."))) ."<br />"; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); - $theme->box(t("News sources"), $output); - $theme->footer(); + theme("header"); + theme("box", t("News feeds"), import_page_info()); + theme("box", t("News sources"), $output); + theme("footer"); } function import_page_fd() { @@ -671,10 +671,10 @@ function import_page_feeds() { } function import_page_blocks($blocks) { - global $theme; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); + + theme("header"); + theme("box", t("News feeds"), import_page_info()); print "<table cellpadding=\"0\" cellspacing=\"5\" border=\"0\" width=\"100%\">\n"; print " <tr>\n"; @@ -682,7 +682,7 @@ function import_page_blocks($blocks) { $i = 1; print " <td width=\"33%\" valign=\"top\">\n"; while ($block = each($blocks)) { - $theme->box($block["value"]["subject"], $block["value"]["content"]); + theme("box", $block["value"]["subject"], $block["value"]["content"]); if ($i == ceil(count($blocks) / 3)) { break; } @@ -693,7 +693,7 @@ function import_page_blocks($blocks) { print " </tr>\n"; print "</table>\n"; - $theme->footer(); + theme("footer"); } function import_page() { diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 56b8f08e6..038ec1b26 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -60,10 +60,10 @@ function import_update() { } function import_format_item($item, $feed = 0) { - global $theme, $user; + global $user; if ($user->uid && user_access("maintain personal blog")) { - $output .= l("<img src=\"". $theme->image("blog.gif") ."\" border=\"0\" width=\"12\" height=\"16\" alt=\"". t("Blog this item") ."\" />", "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); + $output .= l("<img src=\"". theme("image", "blog.gif") ."\" border=\"0\" width=\"12\" height=\"16\" alt=\"". t("Blog this item") ."\" />", "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); } // external link @@ -503,7 +503,7 @@ function import_admin() { } function import_page_info() { - global $theme; + $links[] = l(t("latest news"), "import", array("title" => t("Read the latest news from syndicated websites."))); $links[] = l(t("news by source"), "import/feeds", array("title" => t("View the latest headlines sorted by source."))); @@ -514,11 +514,11 @@ function import_page_info() { $links[] = l(t("administer news feeds"), "admin/import", array("title" => t("View the news feed administrative pages."))); } - return "<div align=\"center\">". $theme->links($links) ."</div>"; + return "<div align=\"center\">". theme("links", $links) ."</div>"; } function import_page_last() { - global $theme; + $result = db_query("SELECT i.*, f.title AS ftitle, f.link AS flink FROM item i LEFT JOIN feed f ON i.fid = f.fid ORDER BY i.iid DESC LIMIT ". variable_get("import_page_limit", 75)); @@ -530,7 +530,7 @@ function import_page_last() { $links[] = l(t("feed"), "import/feed/$item->fid", array("title" => t("Read more syndicated news from this feed."))); if ($item->link) { - $output .= "<tr><td><a href=\"$item->link\">$item->title</a> · ". l($item->ftitle, "import/feed/$item->fid", array("title" => t("View more information about this feed."))) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td><a href=\"$item->link\">$item->title</a> · ". l($item->ftitle, "import/feed/$item->fid", array("title" => t("View more information about this feed."))) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". theme("links", $links) ."</td></tr>\n"; } if ($item->description) { @@ -541,20 +541,20 @@ function import_page_last() { } $output .= "</table>\n"; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); - $theme->box(t("Latest news"), $output); - $theme->footer(); + theme("header"); + theme("box", t("News feeds"), import_page_info()); + theme("box", t("Latest news"), $output); + theme("footer"); } function import_page_feed($fid) { - global $theme; + $feed = db_fetch_object(db_query("SELECT * FROM feed WHERE fid = '%s'", $fid)); $header .= "<p><b>". t("Website") .":</b><div style=\"margin-left: 20px;\"><a href=\"$feed->link\">$feed->link</a></div></p>"; $header .= "<p><b>". t("Description") .":</b><div style=\"margin-left: 20px;\">$feed->description</div></p>"; - $header .= "<p><b>". t("Last update") .":</b><div style=\"margin-left: 20px;\">". format_interval(time() - $feed->timestamp) ." ". t("ago") ." <a href=\"$feed->url\"><img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" alt=\"\" /></a><br /><br /></div></p>\n"; + $header .= "<p><b>". t("Last update") .":</b><div style=\"margin-left: 20px;\">". format_interval(time() - $feed->timestamp) ." ". t("ago") ." <a href=\"$feed->url\"><img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" alt=\"\" /></a><br /><br /></div></p>\n"; $result = db_query("SELECT * FROM item WHERE fid = '%s' ORDER BY iid DESC LIMIT ". variable_get("import_page_limit", 75), $fid); @@ -566,7 +566,7 @@ function import_page_feed($fid) { $links[] = "<a href=\"$item->link\">". t("visit") ."</a>"; if ($item->link) { - $output .= "<tr><td><a href=\"$item->link\">$item->title</a></td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td><a href=\"$item->link\">$item->title</a></td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". theme("links", $links) ."</td></tr>\n"; } if ($item->description) { $output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">$item->description</div><br /></td></tr>"; @@ -576,15 +576,15 @@ function import_page_feed($fid) { } $output .= "</table>\n"; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); - $theme->box($feed->title, $header); - $theme->box(t("Latest news"), $output); - $theme->footer(); + theme("header"); + theme("box", t("News feeds"), import_page_info()); + theme("box", $feed->title, $header); + theme("box", t("Latest news"), $output); + theme("footer"); } function import_page_bundle($bid) { - global $theme; + $bundle = db_fetch_object(db_query("SELECT * FROM bundle WHERE bid = '%s'", $bid)); @@ -604,7 +604,7 @@ function import_page_bundle($bid) { $links[] = "<a href=\"$item->link\">". t("visit") ."</a>"; if ($item->link) { - $output .= "<tr><td><a href=\"$item->link\">$item->title</a> · ". l($item->ftitle, "import/feed/$item->fid", array("title" => t("View more information about this feed."))) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td><a href=\"$item->link\">$item->title</a> · ". l($item->ftitle, "import/feed/$item->fid", array("title" => t("View more information about this feed."))) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". theme("links", $links) ."</td></tr>\n"; } if ($item->description) { @@ -615,16 +615,16 @@ function import_page_bundle($bid) { } $output .= "</table>\n"; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); - $theme->box($bundle->title, $header); - $theme->box(t("Latest news"), $output); - $theme->footer(); + theme("header"); + theme("box", t("News feeds"), import_page_info()); + theme("box", $bundle->title, $header); + theme("box", t("Latest news"), $output); + theme("footer"); } function import_page_sources() { - global $theme; + $result = db_query("SELECT * FROM feed ORDER BY title"); @@ -633,12 +633,12 @@ function import_page_sources() { $output .= "<div style=\"margin-left: 20px;\">$feed->description</div><br />"; } - $output .= l("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", "import/fd", array("title" => t("View the list of syndicated websites in XML format."))) ."<br />"; + $output .= l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", "import/fd", array("title" => t("View the list of syndicated websites in XML format."))) ."<br />"; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); - $theme->box(t("News sources"), $output); - $theme->footer(); + theme("header"); + theme("box", t("News feeds"), import_page_info()); + theme("box", t("News sources"), $output); + theme("footer"); } function import_page_fd() { @@ -671,10 +671,10 @@ function import_page_feeds() { } function import_page_blocks($blocks) { - global $theme; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); + + theme("header"); + theme("box", t("News feeds"), import_page_info()); print "<table cellpadding=\"0\" cellspacing=\"5\" border=\"0\" width=\"100%\">\n"; print " <tr>\n"; @@ -682,7 +682,7 @@ function import_page_blocks($blocks) { $i = 1; print " <td width=\"33%\" valign=\"top\">\n"; while ($block = each($blocks)) { - $theme->box($block["value"]["subject"], $block["value"]["content"]); + theme("box", $block["value"]["subject"], $block["value"]["content"]); if ($i == ceil(count($blocks) / 3)) { break; } @@ -693,7 +693,7 @@ function import_page_blocks($blocks) { print " </tr>\n"; print "</table>\n"; - $theme->footer(); + theme("footer"); } function import_page() { diff --git a/modules/archive.module b/modules/archive.module index f4ab70eb3..6395c693d 100644 --- a/modules/archive.module +++ b/modules/archive.module @@ -137,9 +137,9 @@ function archive_link($type) { } function archive_page() { - global $date, $edit, $theme, $op, $month, $year, $meta; + global $date, $edit, $op, $month, $year, $meta; - $theme->header(); + theme("header"); if (user_access("access content")) { if ($op == t("Show")) { @@ -166,7 +166,7 @@ function archive_page() { $start = form_select("", "year", ($year ? $year : date("Y")), $years). form_select("", "month", ($month ? $month : date("m")), $months) . form_select("", "day", ($day ? $day : date("d")), $days) . form_submit(t("Show")); $start = ereg_replace("<[/]?p>", "", $start); - $theme->box(t("Archives"), form($start)); + theme("box", t("Archives"), form($start)); /* ** Fetch nodes for the selected date, or current date if none @@ -185,7 +185,7 @@ function archive_page() { message_access(); } - $theme->footer(); + theme("footer"); } function archive_settings() { diff --git a/modules/archive/archive.module b/modules/archive/archive.module index f4ab70eb3..6395c693d 100644 --- a/modules/archive/archive.module +++ b/modules/archive/archive.module @@ -137,9 +137,9 @@ function archive_link($type) { } function archive_page() { - global $date, $edit, $theme, $op, $month, $year, $meta; + global $date, $edit, $op, $month, $year, $meta; - $theme->header(); + theme("header"); if (user_access("access content")) { if ($op == t("Show")) { @@ -166,7 +166,7 @@ function archive_page() { $start = form_select("", "year", ($year ? $year : date("Y")), $years). form_select("", "month", ($month ? $month : date("m")), $months) . form_select("", "day", ($day ? $day : date("d")), $days) . form_submit(t("Show")); $start = ereg_replace("<[/]?p>", "", $start); - $theme->box(t("Archives"), form($start)); + theme("box", t("Archives"), form($start)); /* ** Fetch nodes for the selected date, or current date if none @@ -185,7 +185,7 @@ function archive_page() { message_access(); } - $theme->footer(); + theme("footer"); } function archive_settings() { diff --git a/modules/block.module b/modules/block.module index 08ae03da1..32a6eae89 100644 --- a/modules/block.module +++ b/modules/block.module @@ -258,7 +258,7 @@ function block_box_delete($bid) { } function block_admin() { - global $edit, $op, $theme; + global $edit, $op; if (user_access("administer blocks")) { diff --git a/modules/block/block.module b/modules/block/block.module index 08ae03da1..32a6eae89 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -258,7 +258,7 @@ function block_box_delete($bid) { } function block_admin() { - global $edit, $op, $theme; + global $edit, $op; if (user_access("administer blocks")) { diff --git a/modules/blog.module b/modules/blog.module index 2c54e3f09..6917baa5b 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -146,7 +146,7 @@ function blog_feed_last() { } function blog_page_user($uid = 0) { - global $user, $theme; + global $user; if ($uid) { $account = user_load(array((is_numeric($uid) ? "uid" : "name") => $uid, "status" => 1)); @@ -160,11 +160,11 @@ function blog_page_user($uid = 0) { node_view(node_load(array("nid" => $node->nid)), 1); } print pager_display(NULL, variable_get("default_nodes_main", 10)); - print l("<img align=\"right\" src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array ("%username" => $account->name)))); + print l("<img align=\"right\" src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array ("%username" => $account->name)))); } function blog_page_last() { - global $user, $theme; + global $user; $result = pager_query("SELECT nid FROM node WHERE type = 'blog' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10)); @@ -172,7 +172,7 @@ function blog_page_last() { $output = node_view(node_load(array("nid" => $node->nid)), 1); } $output .= pager_display(NULL, variable_get("default_nodes_main", 10)); - $output .= l("<img align=\"right\" src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"\" />", "blog/feed", array("title" => t("Read the XML version of all blogs."))); + $output .= l("<img align=\"right\" src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"\" />", "blog/feed", array("title" => t("Read the XML version of all blogs."))); return $output; } @@ -220,7 +220,7 @@ function blog_form(&$node, &$help, &$error) { } function blog_page() { - global $theme; + if (user_access("access content")) { switch (arg(1)) { @@ -233,20 +233,20 @@ function blog_page() { } break; default: - $theme->header(); + theme("header"); if (arg(1)) { blog_page_user(arg(1)); } else { print blog_page_last(); } - $theme->footer(); + theme("footer"); } } else { - $theme->header(); - $theme->box(t("Access denied"), message_access()); - $theme->footer(); + theme("header"); + theme("box", t("Access denied"), message_access()); + theme("footer"); } } diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 2c54e3f09..6917baa5b 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -146,7 +146,7 @@ function blog_feed_last() { } function blog_page_user($uid = 0) { - global $user, $theme; + global $user; if ($uid) { $account = user_load(array((is_numeric($uid) ? "uid" : "name") => $uid, "status" => 1)); @@ -160,11 +160,11 @@ function blog_page_user($uid = 0) { node_view(node_load(array("nid" => $node->nid)), 1); } print pager_display(NULL, variable_get("default_nodes_main", 10)); - print l("<img align=\"right\" src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array ("%username" => $account->name)))); + print l("<img align=\"right\" src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array ("%username" => $account->name)))); } function blog_page_last() { - global $user, $theme; + global $user; $result = pager_query("SELECT nid FROM node WHERE type = 'blog' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10)); @@ -172,7 +172,7 @@ function blog_page_last() { $output = node_view(node_load(array("nid" => $node->nid)), 1); } $output .= pager_display(NULL, variable_get("default_nodes_main", 10)); - $output .= l("<img align=\"right\" src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"\" />", "blog/feed", array("title" => t("Read the XML version of all blogs."))); + $output .= l("<img align=\"right\" src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"\" />", "blog/feed", array("title" => t("Read the XML version of all blogs."))); return $output; } @@ -220,7 +220,7 @@ function blog_form(&$node, &$help, &$error) { } function blog_page() { - global $theme; + if (user_access("access content")) { switch (arg(1)) { @@ -233,20 +233,20 @@ function blog_page() { } break; default: - $theme->header(); + theme("header"); if (arg(1)) { blog_page_user(arg(1)); } else { print blog_page_last(); } - $theme->footer(); + theme("footer"); } } else { - $theme->header(); - $theme->box(t("Access denied"), message_access()); - $theme->footer(); + theme("header"); + theme("box", t("Access denied"), message_access()); + theme("footer"); } } diff --git a/modules/book.module b/modules/book.module index 9422c49df..085b66072 100644 --- a/modules/book.module +++ b/modules/book.module @@ -338,7 +338,7 @@ function book_location($node, $nodes = array()) { } function book_body($node) { - global $theme, $op; + global $op; if ($node->format == 1) { /* @@ -367,7 +367,7 @@ function book_body($node) { } function book_view($node, $main = 0) { - global $theme, $mod; + global $mod; /* ** Always display the most recently approved revision of a node @@ -397,7 +397,7 @@ function book_view($node, $main = 0) { */ if ($main) { - $theme->node($node, $main); + theme("node", $node, $main); } else { /* @@ -438,10 +438,10 @@ function book_view($node, $main = 0) { $output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? l(t("previous"), "node/view/$prev->nid", array("title" => t("View the previous page in this book."))) : t("previous")) ."</td><td align=\"center\" width=\"34%\">". l(t("index"), "book", array("title" => t("View this book's table of contents."))) ."</td><td align=\"right\" width=\"33%\">". ($next ? l(t("next"), "node/view/$next->nid", array("title" => t("View the next page in this book."))) : t("next")) ."</td></tr>"; $output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? "<small>$prev->title</small>" : " ") ."</td><td align=\"center\" width=\"34%\">". ($node->parent ? l(t("up"), "node/view/$node->parent", array("title" => t("View this page's parent section."))) : t("up")) ."</td><td align=\"right\" width=\"33%\">". ($next ? "<small>$next->title</small>" : " ") ."</td></tr>"; $output .= " <tr><td colspan=\"3\"><hr /></td></tr>"; - $output .= " <tr><td colspan=\"3\" align=\"right\"><div style=\"margin: 10 10 10 10;\">". $theme->links(link_node($node, $main)) ."</div></td></tr>"; + $output .= " <tr><td colspan=\"3\" align=\"right\"><div style=\"margin: 10 10 10 10;\">". theme("links", link_node($node, $main)) ."</div></td></tr>"; $output .= "</table>"; - $theme->box(t("Handbook"), $output); + theme("box", t("Handbook"), $output); } } @@ -522,7 +522,7 @@ function book_tree($parent = 0, $depth = 3) { function book_render() { - global $theme; + $result = db_query("SELECT n.nid FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE b.parent = 0 AND n.status = 1 AND (n.moderate = 0 OR n.revisions != '') ORDER BY b.weight, n.title"); @@ -541,13 +541,13 @@ function book_render() { } } - $theme->header(); - $theme->box(t("Handbook"), "<dl>$output</dl>"); - $theme->footer(); + theme("header"); + theme("box", t("Handbook"), "<dl>$output</dl>"); + theme("footer"); } function book_page() { - global $theme; + if (user_access("access content")) { switch (arg(1)) { @@ -559,9 +559,9 @@ function book_page() { } } else { - $theme->header(); - $theme->box(t("Access denied"), message_access()); - $theme->footer(); + theme("header"); + theme("box", t("Access denied"), message_access()); + theme("footer"); } } diff --git a/modules/book/book.module b/modules/book/book.module index 9422c49df..085b66072 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -338,7 +338,7 @@ function book_location($node, $nodes = array()) { } function book_body($node) { - global $theme, $op; + global $op; if ($node->format == 1) { /* @@ -367,7 +367,7 @@ function book_body($node) { } function book_view($node, $main = 0) { - global $theme, $mod; + global $mod; /* ** Always display the most recently approved revision of a node @@ -397,7 +397,7 @@ function book_view($node, $main = 0) { */ if ($main) { - $theme->node($node, $main); + theme("node", $node, $main); } else { /* @@ -438,10 +438,10 @@ function book_view($node, $main = 0) { $output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? l(t("previous"), "node/view/$prev->nid", array("title" => t("View the previous page in this book."))) : t("previous")) ."</td><td align=\"center\" width=\"34%\">". l(t("index"), "book", array("title" => t("View this book's table of contents."))) ."</td><td align=\"right\" width=\"33%\">". ($next ? l(t("next"), "node/view/$next->nid", array("title" => t("View the next page in this book."))) : t("next")) ."</td></tr>"; $output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? "<small>$prev->title</small>" : " ") ."</td><td align=\"center\" width=\"34%\">". ($node->parent ? l(t("up"), "node/view/$node->parent", array("title" => t("View this page's parent section."))) : t("up")) ."</td><td align=\"right\" width=\"33%\">". ($next ? "<small>$next->title</small>" : " ") ."</td></tr>"; $output .= " <tr><td colspan=\"3\"><hr /></td></tr>"; - $output .= " <tr><td colspan=\"3\" align=\"right\"><div style=\"margin: 10 10 10 10;\">". $theme->links(link_node($node, $main)) ."</div></td></tr>"; + $output .= " <tr><td colspan=\"3\" align=\"right\"><div style=\"margin: 10 10 10 10;\">". theme("links", link_node($node, $main)) ."</div></td></tr>"; $output .= "</table>"; - $theme->box(t("Handbook"), $output); + theme("box", t("Handbook"), $output); } } @@ -522,7 +522,7 @@ function book_tree($parent = 0, $depth = 3) { function book_render() { - global $theme; + $result = db_query("SELECT n.nid FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE b.parent = 0 AND n.status = 1 AND (n.moderate = 0 OR n.revisions != '') ORDER BY b.weight, n.title"); @@ -541,13 +541,13 @@ function book_render() { } } - $theme->header(); - $theme->box(t("Handbook"), "<dl>$output</dl>"); - $theme->footer(); + theme("header"); + theme("box", t("Handbook"), "<dl>$output</dl>"); + theme("footer"); } function book_page() { - global $theme; + if (user_access("access content")) { switch (arg(1)) { @@ -559,9 +559,9 @@ function book_page() { } } else { - $theme->header(); - $theme->box(t("Access denied"), message_access()); - $theme->footer(); + theme("header"); + theme("box", t("Access denied"), message_access()); + theme("footer"); } } diff --git a/modules/cloud.module b/modules/cloud.module index f7d886154..affdf852d 100644 --- a/modules/cloud.module +++ b/modules/cloud.module @@ -160,12 +160,12 @@ function cloud_list($limit = 10) { } function cloud_page() { - global $theme; + if (user_access("access site cloud")) { - $theme->header(); - $theme->box(t("Site cloud"), cloud_help("user") . cloud_list(100)); - $theme->footer(); + theme("header"); + theme("box", t("Site cloud"), cloud_help("user") . cloud_list(100)); + theme("footer"); } } diff --git a/modules/comment.module b/modules/comment.module index ecc1c50ac..effac37d1 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -121,7 +121,7 @@ function comment_edit($cid) { } function comment_reply($pid, $nid) { - global $theme; + if (user_access("access comments")) { @@ -143,22 +143,22 @@ function comment_reply($pid, $nid) { */ if (node_comment_mode($nid) == 1) { - $theme->box(t("Reply"), t("This discussion is closed: you can't post new comments.")); + theme("box", t("Reply"), t("This discussion is closed: you can't post new comments.")); } else if (user_access("post comments", $context)) { - $theme->box(t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid))); + theme("box", t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid))); } else { - $theme->box(t("Reply"), t("You are not authorized to post comments.")); + theme("box", t("Reply"), t("You are not authorized to post comments.")); } } else { - $theme->box(t("Reply"), t("You are not authorized to view comments.")); + theme("box", t("Reply"), t("You are not authorized to view comments.")); } } function comment_preview($edit) { - global $theme, $user; + global $user; foreach ($edit as $key => $value) { $comment->$key = filter($value); @@ -178,7 +178,7 @@ function comment_preview($edit) { comment_view($comment); - $theme->box(t("Reply"), comment_form($edit)); + theme("box", t("Reply"), comment_form($edit)); if ($edit["pid"]) { $comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.cid = '%d' AND c.status = 0", $edit["pid"])); @@ -308,7 +308,7 @@ function comment_post($edit) { } function comment_links($comment, $return = 1) { - global $user, $theme; + global $user; $links = array(); @@ -348,7 +348,7 @@ function comment_links($comment, $return = 1) { $links[] = $moderation; } - return $theme->links($links); + return theme("links", $links); } function comment_view($comment, $links = "", $visible = 1) { @@ -373,7 +373,7 @@ function comment_view($comment, $links = "", $visible = 1) { } function comment_render($node, $cid = 0) { - global $user, $theme, $mode, $order, $threshold, $comment_page; + global $user, $mode, $order, $threshold, $comment_page; if (user_access("access comments")) { @@ -458,7 +458,7 @@ function comment_render($node, $cid = 0) { if ($comment_num && ((variable_get("comment_controls", 0) == 0) || (variable_get("comment_controls", 0) == 2))) { print "<form method=\"post\" action=\"". url("comment") ."\">\n"; - $theme->box(t("Control panel"), theme("comment_controls", $threshold, $mode, $order, $nid, $comment_page, $comment_num, $comments_per_page)); + theme("box", t("Control panel"), theme("comment_controls", $threshold, $mode, $order, $nid, $comment_page, $comment_num, $comments_per_page)); print form_hidden("nid", $nid); print "</form>"; } @@ -580,7 +580,7 @@ function comment_render($node, $cid = 0) { if ($comment_num && ((variable_get("comment_controls", 0) == 1) || (variable_get("comment_controls", 0) == 2))) { print "<form method=\"post\" action=\"". url("comment") ."\">\n"; - $theme->box(t("Control panel"), theme("comment_controls", $threshold, $mode, $order, $nid, $comment_page, $comment_num, $comments_per_page)); + theme("box", t("Control panel"), theme("comment_controls", $threshold, $mode, $order, $nid, $comment_page, $comment_num, $comments_per_page)); print form_hidden("nid", $nid); print "</form>"; } @@ -591,7 +591,7 @@ function comment_render($node, $cid = 0) { */ if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_new_form", 0)) { - $theme->box(t("Post new comment"), comment_form(array("nid" => $nid))); + theme("box", t("Post new comment"), comment_form(array("nid" => $nid))); } /* @@ -679,7 +679,7 @@ function comment_link($type, $node = 0, $main = 0) { } function comment_page() { - global $theme, $op, $edit; + global $op, $edit; if (empty($op)) { $op = arg(1); @@ -687,9 +687,9 @@ function comment_page() { switch ($op) { case "edit": - $theme->header(); + theme("header"); comment_edit(check_query(arg(2))); - $theme->footer(); + theme("footer"); break; case t("Moderate comments"): case t("Moderate comment"): @@ -697,21 +697,21 @@ function comment_page() { drupal_goto(url("node/view/". $edit["nid"])); break; case "reply": - $theme->header(); + theme("header"); comment_reply(check_query(arg(3)), check_query(arg(2))); - $theme->footer(); + theme("footer"); break; case t("Preview comment"): - $theme->header(); + theme("header"); comment_preview($edit); - $theme->footer(); + theme("footer"); break; case t("Post comment"): list($error_title, $error_body) = comment_post($edit); if ($error_body) { - $theme->header(); - $theme->box($error_title, $error_body); - $theme->footer(); + theme("header"); + theme("box", $error_title, $error_body); + theme("footer"); } else { drupal_goto(url("node/view/". $edit["nid"])); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index ecc1c50ac..effac37d1 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -121,7 +121,7 @@ function comment_edit($cid) { } function comment_reply($pid, $nid) { - global $theme; + if (user_access("access comments")) { @@ -143,22 +143,22 @@ function comment_reply($pid, $nid) { */ if (node_comment_mode($nid) == 1) { - $theme->box(t("Reply"), t("This discussion is closed: you can't post new comments.")); + theme("box", t("Reply"), t("This discussion is closed: you can't post new comments.")); } else if (user_access("post comments", $context)) { - $theme->box(t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid))); + theme("box", t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid))); } else { - $theme->box(t("Reply"), t("You are not authorized to post comments.")); + theme("box", t("Reply"), t("You are not authorized to post comments.")); } } else { - $theme->box(t("Reply"), t("You are not authorized to view comments.")); + theme("box", t("Reply"), t("You are not authorized to view comments.")); } } function comment_preview($edit) { - global $theme, $user; + global $user; foreach ($edit as $key => $value) { $comment->$key = filter($value); @@ -178,7 +178,7 @@ function comment_preview($edit) { comment_view($comment); - $theme->box(t("Reply"), comment_form($edit)); + theme("box", t("Reply"), comment_form($edit)); if ($edit["pid"]) { $comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.cid = '%d' AND c.status = 0", $edit["pid"])); @@ -308,7 +308,7 @@ function comment_post($edit) { } function comment_links($comment, $return = 1) { - global $user, $theme; + global $user; $links = array(); @@ -348,7 +348,7 @@ function comment_links($comment, $return = 1) { $links[] = $moderation; } - return $theme->links($links); + return theme("links", $links); } function comment_view($comment, $links = "", $visible = 1) { @@ -373,7 +373,7 @@ function comment_view($comment, $links = "", $visible = 1) { } function comment_render($node, $cid = 0) { - global $user, $theme, $mode, $order, $threshold, $comment_page; + global $user, $mode, $order, $threshold, $comment_page; if (user_access("access comments")) { @@ -458,7 +458,7 @@ function comment_render($node, $cid = 0) { if ($comment_num && ((variable_get("comment_controls", 0) == 0) || (variable_get("comment_controls", 0) == 2))) { print "<form method=\"post\" action=\"". url("comment") ."\">\n"; - $theme->box(t("Control panel"), theme("comment_controls", $threshold, $mode, $order, $nid, $comment_page, $comment_num, $comments_per_page)); + theme("box", t("Control panel"), theme("comment_controls", $threshold, $mode, $order, $nid, $comment_page, $comment_num, $comments_per_page)); print form_hidden("nid", $nid); print "</form>"; } @@ -580,7 +580,7 @@ function comment_render($node, $cid = 0) { if ($comment_num && ((variable_get("comment_controls", 0) == 1) || (variable_get("comment_controls", 0) == 2))) { print "<form method=\"post\" action=\"". url("comment") ."\">\n"; - $theme->box(t("Control panel"), theme("comment_controls", $threshold, $mode, $order, $nid, $comment_page, $comment_num, $comments_per_page)); + theme("box", t("Control panel"), theme("comment_controls", $threshold, $mode, $order, $nid, $comment_page, $comment_num, $comments_per_page)); print form_hidden("nid", $nid); print "</form>"; } @@ -591,7 +591,7 @@ function comment_render($node, $cid = 0) { */ if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_new_form", 0)) { - $theme->box(t("Post new comment"), comment_form(array("nid" => $nid))); + theme("box", t("Post new comment"), comment_form(array("nid" => $nid))); } /* @@ -679,7 +679,7 @@ function comment_link($type, $node = 0, $main = 0) { } function comment_page() { - global $theme, $op, $edit; + global $op, $edit; if (empty($op)) { $op = arg(1); @@ -687,9 +687,9 @@ function comment_page() { switch ($op) { case "edit": - $theme->header(); + theme("header"); comment_edit(check_query(arg(2))); - $theme->footer(); + theme("footer"); break; case t("Moderate comments"): case t("Moderate comment"): @@ -697,21 +697,21 @@ function comment_page() { drupal_goto(url("node/view/". $edit["nid"])); break; case "reply": - $theme->header(); + theme("header"); comment_reply(check_query(arg(3)), check_query(arg(2))); - $theme->footer(); + theme("footer"); break; case t("Preview comment"): - $theme->header(); + theme("header"); comment_preview($edit); - $theme->footer(); + theme("footer"); break; case t("Post comment"): list($error_title, $error_body) = comment_post($edit); if ($error_body) { - $theme->header(); - $theme->box($error_title, $error_body); - $theme->footer(); + theme("header"); + theme("box", $error_title, $error_body); + theme("footer"); } else { drupal_goto(url("node/view/". $edit["nid"])); diff --git a/modules/drupal.module b/modules/drupal.module index 5659c4455..b856aac63 100644 --- a/modules/drupal.module +++ b/modules/drupal.module @@ -143,10 +143,10 @@ function drupal_auth($username, $password, $server) { } function drupal_page() { - global $theme; - $theme->header(); - $theme->box("Drupal", drupal_auth_help()); - $theme->footer(); + + theme("header"); + theme("box", "Drupal", drupal_auth_help()); + theme("footer"); } function drupal_login($arguments) { diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module index 5659c4455..b856aac63 100644 --- a/modules/drupal/drupal.module +++ b/modules/drupal/drupal.module @@ -143,10 +143,10 @@ function drupal_auth($username, $password, $server) { } function drupal_page() { - global $theme; - $theme->header(); - $theme->box("Drupal", drupal_auth_help()); - $theme->footer(); + + theme("header"); + theme("box", "Drupal", drupal_auth_help()); + theme("footer"); } function drupal_login($arguments) { diff --git a/modules/forum.module b/modules/forum.module index d512dd52d..55d0b7cd0 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -169,7 +169,7 @@ function forum_link($type, $node = 0, $main = 0) { } function forum_view($node, $main = 0) { - global $theme; + $term_data = array_shift(taxonomy_node_get_terms($node->nid)); if (!$term_data) { @@ -182,7 +182,7 @@ function forum_view($node, $main = 0) { $node->title = _forum_get_icon($node) ." ". l($voc->name, "forum") ." : ". l($term_data->name, "forum/$term_data->tid") ." / <b>$node->title</b>"; } - $theme->node($node, $main); + theme("node", $node, $main); } function forum_validate($node) { @@ -458,7 +458,7 @@ function _forum_message_taxonomy() { } function forum_page() { - global $theme, $sortby, $forum_per_page, $from, $op, $user; + global $sortby, $forum_per_page, $from, $op, $user; if (user_access("access content")) { if (module_exist("taxonomy")) { @@ -493,15 +493,15 @@ function forum_page() { theme("forum_render", $forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset); } else { - $theme->header(); - $theme->box(t("Warning"), _forum_message_taxonomy()); - $theme->footer(); + theme("header"); + theme("box", t("Warning"), _forum_message_taxonomy()); + theme("footer"); } } else { - $theme->header(); - $theme->box(t("Access denied"), message_access()); - $theme->footer(); + theme("header"); + theme("box", t("Access denied"), message_access()); + theme("footer"); } } @@ -511,19 +511,19 @@ function forum_page() { function forum_render($forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset) { // forum list, topics list, topic browser and "add new topic" link - global $theme; + $output .= theme("forum_forum_list", $forums, $parents, $tid); if ($tid && !in_array($tid, variable_get("forum_containers", array()))) { $output .= theme("forum_topic_list", $tid, $topics, $sortby, $forum_per_page, $offset); } - $theme->header(); - $theme->box(t("Discussion forum"), $output); + theme("header"); + theme("box", t("Discussion forum"), $output); if ($tid && !in_array($tid, variable_get("forum_containers", array()))) { - $theme->box(t("Control panel"), theme("forum_topic_browser", $sortby, $forum_per_page, $offset)); + theme("box", t("Control panel"), theme("forum_topic_browser", $sortby, $forum_per_page, $offset)); } - $theme->footer(); + theme("footer"); } function forum_forum_list($forums, $parents, $tid) { @@ -608,7 +608,7 @@ function forum_topic_browser() { } function forum_topic_list($tid, $topics, $sortby, $forum_per_page, $offset) { - global $theme, $id, $status, $user, $pager_total; + global $id, $status, $user, $pager_total; if ($topics) { $output .= "<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" width=\"100%\">\n"; @@ -665,7 +665,7 @@ function _forum_get_icon($node) { function _forum_get_folder_icon($new_posts, $num_posts = 0, $comment_mode = 0) { // "folder" icon because it's generally rendered as a folder - global $theme; + $base_path = variable_get("forum_folder_icon_path", ""); if ($base_path) { @@ -680,13 +680,8 @@ function _forum_get_folder_icon($new_posts, $num_posts = 0, $comment_mode = 0) { $icon = "closed"; } - if ($theme->bbs_icons) { - $file = $theme->bbs_icons[$icon]; - } - else { - // default - $file = $base_path."/".$icon.".gif"; - } + // default + $file = $base_path."/".$icon.".gif"; return "<img src=\"$file\" alt=\"\" />"; } diff --git a/modules/forum/forum.module b/modules/forum/forum.module index d512dd52d..55d0b7cd0 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -169,7 +169,7 @@ function forum_link($type, $node = 0, $main = 0) { } function forum_view($node, $main = 0) { - global $theme; + $term_data = array_shift(taxonomy_node_get_terms($node->nid)); if (!$term_data) { @@ -182,7 +182,7 @@ function forum_view($node, $main = 0) { $node->title = _forum_get_icon($node) ." ". l($voc->name, "forum") ." : ". l($term_data->name, "forum/$term_data->tid") ." / <b>$node->title</b>"; } - $theme->node($node, $main); + theme("node", $node, $main); } function forum_validate($node) { @@ -458,7 +458,7 @@ function _forum_message_taxonomy() { } function forum_page() { - global $theme, $sortby, $forum_per_page, $from, $op, $user; + global $sortby, $forum_per_page, $from, $op, $user; if (user_access("access content")) { if (module_exist("taxonomy")) { @@ -493,15 +493,15 @@ function forum_page() { theme("forum_render", $forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset); } else { - $theme->header(); - $theme->box(t("Warning"), _forum_message_taxonomy()); - $theme->footer(); + theme("header"); + theme("box", t("Warning"), _forum_message_taxonomy()); + theme("footer"); } } else { - $theme->header(); - $theme->box(t("Access denied"), message_access()); - $theme->footer(); + theme("header"); + theme("box", t("Access denied"), message_access()); + theme("footer"); } } @@ -511,19 +511,19 @@ function forum_page() { function forum_render($forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset) { // forum list, topics list, topic browser and "add new topic" link - global $theme; + $output .= theme("forum_forum_list", $forums, $parents, $tid); if ($tid && !in_array($tid, variable_get("forum_containers", array()))) { $output .= theme("forum_topic_list", $tid, $topics, $sortby, $forum_per_page, $offset); } - $theme->header(); - $theme->box(t("Discussion forum"), $output); + theme("header"); + theme("box", t("Discussion forum"), $output); if ($tid && !in_array($tid, variable_get("forum_containers", array()))) { - $theme->box(t("Control panel"), theme("forum_topic_browser", $sortby, $forum_per_page, $offset)); + theme("box", t("Control panel"), theme("forum_topic_browser", $sortby, $forum_per_page, $offset)); } - $theme->footer(); + theme("footer"); } function forum_forum_list($forums, $parents, $tid) { @@ -608,7 +608,7 @@ function forum_topic_browser() { } function forum_topic_list($tid, $topics, $sortby, $forum_per_page, $offset) { - global $theme, $id, $status, $user, $pager_total; + global $id, $status, $user, $pager_total; if ($topics) { $output .= "<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" width=\"100%\">\n"; @@ -665,7 +665,7 @@ function _forum_get_icon($node) { function _forum_get_folder_icon($new_posts, $num_posts = 0, $comment_mode = 0) { // "folder" icon because it's generally rendered as a folder - global $theme; + $base_path = variable_get("forum_folder_icon_path", ""); if ($base_path) { @@ -680,13 +680,8 @@ function _forum_get_folder_icon($new_posts, $num_posts = 0, $comment_mode = 0) { $icon = "closed"; } - if ($theme->bbs_icons) { - $file = $theme->bbs_icons[$icon]; - } - else { - // default - $file = $base_path."/".$icon.".gif"; - } + // default + $file = $base_path."/".$icon.".gif"; return "<img src=\"$file\" alt=\"\" />"; } diff --git a/modules/import.module b/modules/import.module index 56b8f08e6..038ec1b26 100644 --- a/modules/import.module +++ b/modules/import.module @@ -60,10 +60,10 @@ function import_update() { } function import_format_item($item, $feed = 0) { - global $theme, $user; + global $user; if ($user->uid && user_access("maintain personal blog")) { - $output .= l("<img src=\"". $theme->image("blog.gif") ."\" border=\"0\" width=\"12\" height=\"16\" alt=\"". t("Blog this item") ."\" />", "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); + $output .= l("<img src=\"". theme("image", "blog.gif") ."\" border=\"0\" width=\"12\" height=\"16\" alt=\"". t("Blog this item") ."\" />", "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); } // external link @@ -503,7 +503,7 @@ function import_admin() { } function import_page_info() { - global $theme; + $links[] = l(t("latest news"), "import", array("title" => t("Read the latest news from syndicated websites."))); $links[] = l(t("news by source"), "import/feeds", array("title" => t("View the latest headlines sorted by source."))); @@ -514,11 +514,11 @@ function import_page_info() { $links[] = l(t("administer news feeds"), "admin/import", array("title" => t("View the news feed administrative pages."))); } - return "<div align=\"center\">". $theme->links($links) ."</div>"; + return "<div align=\"center\">". theme("links", $links) ."</div>"; } function import_page_last() { - global $theme; + $result = db_query("SELECT i.*, f.title AS ftitle, f.link AS flink FROM item i LEFT JOIN feed f ON i.fid = f.fid ORDER BY i.iid DESC LIMIT ". variable_get("import_page_limit", 75)); @@ -530,7 +530,7 @@ function import_page_last() { $links[] = l(t("feed"), "import/feed/$item->fid", array("title" => t("Read more syndicated news from this feed."))); if ($item->link) { - $output .= "<tr><td><a href=\"$item->link\">$item->title</a> · ". l($item->ftitle, "import/feed/$item->fid", array("title" => t("View more information about this feed."))) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td><a href=\"$item->link\">$item->title</a> · ". l($item->ftitle, "import/feed/$item->fid", array("title" => t("View more information about this feed."))) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". theme("links", $links) ."</td></tr>\n"; } if ($item->description) { @@ -541,20 +541,20 @@ function import_page_last() { } $output .= "</table>\n"; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); - $theme->box(t("Latest news"), $output); - $theme->footer(); + theme("header"); + theme("box", t("News feeds"), import_page_info()); + theme("box", t("Latest news"), $output); + theme("footer"); } function import_page_feed($fid) { - global $theme; + $feed = db_fetch_object(db_query("SELECT * FROM feed WHERE fid = '%s'", $fid)); $header .= "<p><b>". t("Website") .":</b><div style=\"margin-left: 20px;\"><a href=\"$feed->link\">$feed->link</a></div></p>"; $header .= "<p><b>". t("Description") .":</b><div style=\"margin-left: 20px;\">$feed->description</div></p>"; - $header .= "<p><b>". t("Last update") .":</b><div style=\"margin-left: 20px;\">". format_interval(time() - $feed->timestamp) ." ". t("ago") ." <a href=\"$feed->url\"><img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" alt=\"\" /></a><br /><br /></div></p>\n"; + $header .= "<p><b>". t("Last update") .":</b><div style=\"margin-left: 20px;\">". format_interval(time() - $feed->timestamp) ." ". t("ago") ." <a href=\"$feed->url\"><img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" alt=\"\" /></a><br /><br /></div></p>\n"; $result = db_query("SELECT * FROM item WHERE fid = '%s' ORDER BY iid DESC LIMIT ". variable_get("import_page_limit", 75), $fid); @@ -566,7 +566,7 @@ function import_page_feed($fid) { $links[] = "<a href=\"$item->link\">". t("visit") ."</a>"; if ($item->link) { - $output .= "<tr><td><a href=\"$item->link\">$item->title</a></td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td><a href=\"$item->link\">$item->title</a></td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". theme("links", $links) ."</td></tr>\n"; } if ($item->description) { $output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">$item->description</div><br /></td></tr>"; @@ -576,15 +576,15 @@ function import_page_feed($fid) { } $output .= "</table>\n"; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); - $theme->box($feed->title, $header); - $theme->box(t("Latest news"), $output); - $theme->footer(); + theme("header"); + theme("box", t("News feeds"), import_page_info()); + theme("box", $feed->title, $header); + theme("box", t("Latest news"), $output); + theme("footer"); } function import_page_bundle($bid) { - global $theme; + $bundle = db_fetch_object(db_query("SELECT * FROM bundle WHERE bid = '%s'", $bid)); @@ -604,7 +604,7 @@ function import_page_bundle($bid) { $links[] = "<a href=\"$item->link\">". t("visit") ."</a>"; if ($item->link) { - $output .= "<tr><td><a href=\"$item->link\">$item->title</a> · ". l($item->ftitle, "import/feed/$item->fid", array("title" => t("View more information about this feed."))) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td><a href=\"$item->link\">$item->title</a> · ". l($item->ftitle, "import/feed/$item->fid", array("title" => t("View more information about this feed."))) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". theme("links", $links) ."</td></tr>\n"; } if ($item->description) { @@ -615,16 +615,16 @@ function import_page_bundle($bid) { } $output .= "</table>\n"; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); - $theme->box($bundle->title, $header); - $theme->box(t("Latest news"), $output); - $theme->footer(); + theme("header"); + theme("box", t("News feeds"), import_page_info()); + theme("box", $bundle->title, $header); + theme("box", t("Latest news"), $output); + theme("footer"); } function import_page_sources() { - global $theme; + $result = db_query("SELECT * FROM feed ORDER BY title"); @@ -633,12 +633,12 @@ function import_page_sources() { $output .= "<div style=\"margin-left: 20px;\">$feed->description</div><br />"; } - $output .= l("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", "import/fd", array("title" => t("View the list of syndicated websites in XML format."))) ."<br />"; + $output .= l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", "import/fd", array("title" => t("View the list of syndicated websites in XML format."))) ."<br />"; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); - $theme->box(t("News sources"), $output); - $theme->footer(); + theme("header"); + theme("box", t("News feeds"), import_page_info()); + theme("box", t("News sources"), $output); + theme("footer"); } function import_page_fd() { @@ -671,10 +671,10 @@ function import_page_feeds() { } function import_page_blocks($blocks) { - global $theme; - $theme->header(); - $theme->box(t("News feeds"), import_page_info()); + + theme("header"); + theme("box", t("News feeds"), import_page_info()); print "<table cellpadding=\"0\" cellspacing=\"5\" border=\"0\" width=\"100%\">\n"; print " <tr>\n"; @@ -682,7 +682,7 @@ function import_page_blocks($blocks) { $i = 1; print " <td width=\"33%\" valign=\"top\">\n"; while ($block = each($blocks)) { - $theme->box($block["value"]["subject"], $block["value"]["content"]); + theme("box", $block["value"]["subject"], $block["value"]["content"]); if ($i == ceil(count($blocks) / 3)) { break; } @@ -693,7 +693,7 @@ function import_page_blocks($blocks) { print " </tr>\n"; print "</table>\n"; - $theme->footer(); + theme("footer"); } function import_page() { diff --git a/modules/jabber.module b/modules/jabber.module index 9843a1ea4..d80435a2c 100644 --- a/modules/jabber.module +++ b/modules/jabber.module @@ -145,11 +145,11 @@ function jabber_auth($username, $password, $server) { } function jabber_page() { - global $theme; - $theme->header(); - $theme->box("Jabber", jabber_auth_help()); - $theme->footer(); + + theme("header"); + theme("box", "Jabber", jabber_auth_help()); + theme("footer"); } function jabber_auth_help() { diff --git a/modules/node.module b/modules/node.module index e3b820c14..2262a0e82 100644 --- a/modules/node.module +++ b/modules/node.module @@ -275,7 +275,7 @@ function node_save($node, $filter) { } function node_view($node, $main = 0) { - global $theme; + $node = array2object($node); @@ -300,12 +300,12 @@ function node_view($node, $main = 0) { ** Default behavior: */ - $theme->node($node, $main); + theme("node", $node, $main); } } function node_show($nid, $cid) { - global $theme, $revision; + global $revision; $node = node_load(array("status" => 1, "nid" => $nid)); @@ -679,14 +679,14 @@ function node_admin() { } function node_block($op = "list", $delta = 0) { - global $theme; + if ($op == "list") { $blocks[0]["info"] = t("Syndicate"); return $blocks; } else { $block["subject"] = t("Syndicate"); - $block["content"] = "<div align=\"center\">". l("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"XML\" />", "node/feed", array("title" => t("Read the XML version of this page."))) ."</div>"; + $block["content"] = "<div align=\"center\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"XML\" />", "node/feed", array("title" => t("Read the XML version of this page."))) ."</div>"; return $block; } @@ -1049,7 +1049,7 @@ function node_preview($node, $error = NULL) { } function node_submit($node) { - global $user, $theme; + global $user; /* ** Fixup the node when required: @@ -1176,7 +1176,7 @@ function node_submit($node) { $links[] = l(t("edit"), "node/edit/$nid"); } - $output .= "<p>". $theme->links($links) ."</p>"; + $output .= "<p>". theme("links", $links) ."</p>"; return $output; } @@ -1230,7 +1230,7 @@ function node_delete($edit) { } function node_page() { - global $op, $id, $user, $edit, $theme, $or, $and; + global $op, $id, $user, $edit, $or, $and; if (user_access("access content")) { if (empty($op)) { @@ -1242,27 +1242,27 @@ function node_page() { return; } - $theme->header(); + theme("header"); switch ($op) { case "add": - $theme->box(t("Create new post"), node_add(arg(2))); + theme("box", t("Create new post"), node_add(arg(2))); break; case "edit": - $theme->box(t("Edit post"), node_edit(arg(2))); + theme("box", t("Edit post"), node_edit(arg(2))); break; case "view": print node_show(arg(2), arg(3)); break; case t("Preview"): $edit = node_validate($edit, $error); - $theme->box(t("Preview post"), node_preview($edit, $error)); + theme("box", t("Preview post"), node_preview($edit, $error)); break; case t("Submit"): - $theme->box(t("Submit post"), node_submit($edit)); + theme("box", t("Submit post"), node_submit($edit)); break; case t("Delete"): - $theme->box(t("Delete post"), node_delete($edit)); + theme("box", t("Delete post"), node_delete($edit)); break; default: $result = pager_query("SELECT nid, type FROM node WHERE promote = '1' AND status = '1' ORDER BY static DESC, created DESC", variable_get("default_nodes_main", 10)); @@ -1274,10 +1274,10 @@ function node_page() { } } else { - $theme->box(t("Access denied"), message_access()); + theme("box", t("Access denied"), message_access()); } - $theme->footer(); + theme("footer"); } function node_update_index() { diff --git a/modules/node/node.module b/modules/node/node.module index e3b820c14..2262a0e82 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -275,7 +275,7 @@ function node_save($node, $filter) { } function node_view($node, $main = 0) { - global $theme; + $node = array2object($node); @@ -300,12 +300,12 @@ function node_view($node, $main = 0) { ** Default behavior: */ - $theme->node($node, $main); + theme("node", $node, $main); } } function node_show($nid, $cid) { - global $theme, $revision; + global $revision; $node = node_load(array("status" => 1, "nid" => $nid)); @@ -679,14 +679,14 @@ function node_admin() { } function node_block($op = "list", $delta = 0) { - global $theme; + if ($op == "list") { $blocks[0]["info"] = t("Syndicate"); return $blocks; } else { $block["subject"] = t("Syndicate"); - $block["content"] = "<div align=\"center\">". l("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"XML\" />", "node/feed", array("title" => t("Read the XML version of this page."))) ."</div>"; + $block["content"] = "<div align=\"center\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"XML\" />", "node/feed", array("title" => t("Read the XML version of this page."))) ."</div>"; return $block; } @@ -1049,7 +1049,7 @@ function node_preview($node, $error = NULL) { } function node_submit($node) { - global $user, $theme; + global $user; /* ** Fixup the node when required: @@ -1176,7 +1176,7 @@ function node_submit($node) { $links[] = l(t("edit"), "node/edit/$nid"); } - $output .= "<p>". $theme->links($links) ."</p>"; + $output .= "<p>". theme("links", $links) ."</p>"; return $output; } @@ -1230,7 +1230,7 @@ function node_delete($edit) { } function node_page() { - global $op, $id, $user, $edit, $theme, $or, $and; + global $op, $id, $user, $edit, $or, $and; if (user_access("access content")) { if (empty($op)) { @@ -1242,27 +1242,27 @@ function node_page() { return; } - $theme->header(); + theme("header"); switch ($op) { case "add": - $theme->box(t("Create new post"), node_add(arg(2))); + theme("box", t("Create new post"), node_add(arg(2))); break; case "edit": - $theme->box(t("Edit post"), node_edit(arg(2))); + theme("box", t("Edit post"), node_edit(arg(2))); break; case "view": print node_show(arg(2), arg(3)); break; case t("Preview"): $edit = node_validate($edit, $error); - $theme->box(t("Preview post"), node_preview($edit, $error)); + theme("box", t("Preview post"), node_preview($edit, $error)); break; case t("Submit"): - $theme->box(t("Submit post"), node_submit($edit)); + theme("box", t("Submit post"), node_submit($edit)); break; case t("Delete"): - $theme->box(t("Delete post"), node_delete($edit)); + theme("box", t("Delete post"), node_delete($edit)); break; default: $result = pager_query("SELECT nid, type FROM node WHERE promote = '1' AND status = '1' ORDER BY static DESC, created DESC", variable_get("default_nodes_main", 10)); @@ -1274,10 +1274,10 @@ function node_page() { } } else { - $theme->box(t("Access denied"), message_access()); + theme("box", t("Access denied"), message_access()); } - $theme->footer(); + theme("footer"); } function node_update_index() { diff --git a/modules/page.module b/modules/page.module index 8e9ab201f..ed5f881b3 100644 --- a/modules/page.module +++ b/modules/page.module @@ -105,7 +105,7 @@ function page_link($type) { } function page_body($node) { - global $theme, $op; + global $op; if ($node->format == 0) { // HTML type $output = check_output($node->body); @@ -122,7 +122,7 @@ function page_body($node) { } function page_view($node, $main = 0) { - global $theme; + /* ** Extract the page body. If body is dynamic (using PHP code), the body @@ -132,14 +132,14 @@ function page_view($node, $main = 0) { $node->teaser = $node->body = page_body($node); if ($main) { - $theme->node($node, $main); + theme("node", $node, $main); } else { /* ** Add the node specific links: */ - $theme->box($node->title, "$node->body<div align=\"right\">". $theme->links(link_node($node, $main)) ."</div>"); + theme("box", $node->title, "$node->body<div align=\"right\">". theme("links", link_node($node, $main)) ."</div>"); } } diff --git a/modules/page/page.module b/modules/page/page.module index 8e9ab201f..ed5f881b3 100644 --- a/modules/page/page.module +++ b/modules/page/page.module @@ -105,7 +105,7 @@ function page_link($type) { } function page_body($node) { - global $theme, $op; + global $op; if ($node->format == 0) { // HTML type $output = check_output($node->body); @@ -122,7 +122,7 @@ function page_body($node) { } function page_view($node, $main = 0) { - global $theme; + /* ** Extract the page body. If body is dynamic (using PHP code), the body @@ -132,14 +132,14 @@ function page_view($node, $main = 0) { $node->teaser = $node->body = page_body($node); if ($main) { - $theme->node($node, $main); + theme("node", $node, $main); } else { /* ** Add the node specific links: */ - $theme->box($node->title, "$node->body<div align=\"right\">". $theme->links(link_node($node, $main)) ."</div>"); + theme("box", $node->title, "$node->body<div align=\"right\">". theme("links", link_node($node, $main)) ."</div>"); } } diff --git a/modules/poll.module b/modules/poll.module index 2ad8c4ad6..0e6a453ba 100644 --- a/modules/poll.module +++ b/modules/poll.module @@ -215,17 +215,17 @@ function poll_node($field) { } function poll_page() { - global $theme; - $theme->header(); + + theme("header"); $result = db_query("SELECT n.nid, n.title, p.active, SUM(c.chvotes) AS votes FROM node n LEFT JOIN poll p ON n.nid=p.nid LEFT JOIN poll_choices c ON n.nid=c.nid WHERE type = 'poll' AND status = '1' AND moderate = '0' GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC"); $output = "<ul>"; while ($node = db_fetch_object($result)) { $output .= "<li>".l($node->title, "node/view/$node->nid") ." - ". format_plural($node->votes, "1 vote", "%count votes") ." - ". ($node->active ? t("open") : t("closed")) ."</li>"; } $output .= "</ul>"; - $theme->box(t("Polls"), $output); - $theme->footer(); + theme("box", t("Polls"), $output); + theme("footer"); } function poll_perm() { @@ -272,7 +272,7 @@ function poll_teaser($node) { function poll_view_voting(&$node, $main, $block, $links) { // Display the vote form - global $theme; + $url = request_uri(); $output .= "<form action=\"$url\" method=\"post\">"; @@ -293,7 +293,7 @@ function poll_view_voting(&$node, $main, $block, $links) { $output .= "</td><td valign=\"middle\"><div align=\"right\"> ". form_submit(t("Vote")) ."</div></td></tr></table>"; } - $output .= $block ? "<div align=\"center\">". $theme->links($links) ."</div>" : ""; + $output .= $block ? "<div align=\"center\">". theme("links", $links) ."</div>" : ""; $output .= "</form>"; return $output; @@ -301,7 +301,7 @@ function poll_view_voting(&$node, $main, $block, $links) { function poll_view_results(&$node, $main, $block, $links) { // Display the results - global $theme; + // Count the votes and find the maximum if ($node->choice) { @@ -317,10 +317,6 @@ function poll_view_results(&$node, $main, $block, $links) { ** (note: style is not allowed outside <head>, but the alternative is very ** ugly and it seems to work in all browsers) */ - $output .= "<style type=\"text/css\">"; - $output .= "td.pollfg { background-color: ". $theme->foreground ."; font-size: 5pt; }"; - $output .= "td.pollbg { background-color: ". $theme->background ."; font-size: 5pt; }"; - $output .= "</style>"; if ($node->choice) { foreach ($node->choice as $key => $value) { @@ -343,7 +339,7 @@ function poll_view_results(&$node, $main, $block, $links) { } $output .= "<br /><div align=\"center\">". t("Total votes") .": $votestotal"; - $output .= ($block ? "<br />". $theme->links($links) : "") ."</div>"; + $output .= ($block ? "<br />". theme("links", $links) : "") ."</div>"; return $output; } @@ -363,7 +359,7 @@ function poll_view_processvote(&$node) { } function poll_view(&$node, $main = 0, $block = 0) { - global $theme, $user; + global $user; /* ** When several polls are displayed on the same page (e.g. on the front page and in the side bar) @@ -398,7 +394,7 @@ function poll_view(&$node, $main = 0, $block = 0) { // We also use poll_view() for the side-block if (!$block) { - $theme->node($node, $main); + theme("node", $node, $main); } } diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 2ad8c4ad6..0e6a453ba 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -215,17 +215,17 @@ function poll_node($field) { } function poll_page() { - global $theme; - $theme->header(); + + theme("header"); $result = db_query("SELECT n.nid, n.title, p.active, SUM(c.chvotes) AS votes FROM node n LEFT JOIN poll p ON n.nid=p.nid LEFT JOIN poll_choices c ON n.nid=c.nid WHERE type = 'poll' AND status = '1' AND moderate = '0' GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC"); $output = "<ul>"; while ($node = db_fetch_object($result)) { $output .= "<li>".l($node->title, "node/view/$node->nid") ." - ". format_plural($node->votes, "1 vote", "%count votes") ." - ". ($node->active ? t("open") : t("closed")) ."</li>"; } $output .= "</ul>"; - $theme->box(t("Polls"), $output); - $theme->footer(); + theme("box", t("Polls"), $output); + theme("footer"); } function poll_perm() { @@ -272,7 +272,7 @@ function poll_teaser($node) { function poll_view_voting(&$node, $main, $block, $links) { // Display the vote form - global $theme; + $url = request_uri(); $output .= "<form action=\"$url\" method=\"post\">"; @@ -293,7 +293,7 @@ function poll_view_voting(&$node, $main, $block, $links) { $output .= "</td><td valign=\"middle\"><div align=\"right\"> ". form_submit(t("Vote")) ."</div></td></tr></table>"; } - $output .= $block ? "<div align=\"center\">". $theme->links($links) ."</div>" : ""; + $output .= $block ? "<div align=\"center\">". theme("links", $links) ."</div>" : ""; $output .= "</form>"; return $output; @@ -301,7 +301,7 @@ function poll_view_voting(&$node, $main, $block, $links) { function poll_view_results(&$node, $main, $block, $links) { // Display the results - global $theme; + // Count the votes and find the maximum if ($node->choice) { @@ -317,10 +317,6 @@ function poll_view_results(&$node, $main, $block, $links) { ** (note: style is not allowed outside <head>, but the alternative is very ** ugly and it seems to work in all browsers) */ - $output .= "<style type=\"text/css\">"; - $output .= "td.pollfg { background-color: ". $theme->foreground ."; font-size: 5pt; }"; - $output .= "td.pollbg { background-color: ". $theme->background ."; font-size: 5pt; }"; - $output .= "</style>"; if ($node->choice) { foreach ($node->choice as $key => $value) { @@ -343,7 +339,7 @@ function poll_view_results(&$node, $main, $block, $links) { } $output .= "<br /><div align=\"center\">". t("Total votes") .": $votestotal"; - $output .= ($block ? "<br />". $theme->links($links) : "") ."</div>"; + $output .= ($block ? "<br />". theme("links", $links) : "") ."</div>"; return $output; } @@ -363,7 +359,7 @@ function poll_view_processvote(&$node) { } function poll_view(&$node, $main = 0, $block = 0) { - global $theme, $user; + global $user; /* ** When several polls are displayed on the same page (e.g. on the front page and in the side bar) @@ -398,7 +394,7 @@ function poll_view(&$node, $main = 0, $block = 0) { // We also use poll_view() for the side-block if (!$block) { - $theme->node($node, $main); + theme("node", $node, $main); } } diff --git a/modules/queue.module b/modules/queue.module index 65c3df71e..fbeca356a 100644 --- a/modules/queue.module +++ b/modules/queue.module @@ -80,7 +80,7 @@ function queue_vote($node, $vote) { } function queue_overview() { - global $theme, $user; + global $user; $result = db_query("SELECT n.*, u.name, u.uid FROM node n LEFT JOIN users u ON n.uid = u.uid WHERE n.moderate = 1"); @@ -100,13 +100,13 @@ function queue_overview() { } $output .= "</table>"; - $theme->header(); - $theme->box(t("Moderation queue"), $output); - $theme->footer(); + theme("header"); + theme("box", t("Moderation queue"), $output); + theme("footer"); } function queue_view($nid) { - global $op, $edit, $theme, $user; + global $op, $edit, $user; /* ** An associative array with the possible voting options: @@ -149,19 +149,19 @@ function queue_view($nid) { } } - $theme->header(); + theme("header"); node_view($node); if ($output) { - $theme->box(t("Moderate"), $output); + theme("box", t("Moderate"), $output); } if ($node->comment && variable_get("queue_show_comments", 1)) { module_invoke("comment", "render", $node); } - $theme->footer(); + theme("footer"); } function queue_page() { - global $user, $theme, $vote; + global $user, $vote; if ($user->uid && user_access("access submission queue")) { if (arg(1)) { @@ -172,9 +172,9 @@ function queue_page() { } } else { - $theme->header(); - $theme->box(t("Moderation queue"), message_access()); - $theme->footer(); + theme("header"); + theme("box", t("Moderation queue"), message_access()); + theme("footer"); } } diff --git a/modules/search.module b/modules/search.module index 47710d647..bb2bff481 100644 --- a/modules/search.module +++ b/modules/search.module @@ -304,7 +304,7 @@ function search_save($edit) { } function search_view() { - global $theme, $edit, $type, $keys; + global $edit, $type, $keys; if (user_access("search content")) { @@ -335,39 +335,39 @@ function search_view() { $form .= $help_link; } - $theme->header(); + theme("header"); if ($form) { - $theme->box(t("Search"), $form); + theme("box", t("Search"), $form); } if ($keys) { if ($output) { - $theme->box(t("Result"), $output); + theme("box", t("Result"), $output); } else { - $theme->box(t("Result"), t("Your search yielded no results.")); + theme("box", t("Result"), t("Your search yielded no results.")); } } - $theme->footer(); + theme("footer"); } else { - $theme->header(); - $theme->box(t("Access denied"), message_access()); - $theme->footer(); + theme("header"); + theme("box", t("Access denied"), message_access()); + theme("footer"); } } function search_page() { - global $theme; + switch (arg(1)) { case "help": - $theme->header(); - $theme->box(t("Search Help"), search_help()); - $theme->footer(); + theme("header"); + theme("box", t("Search Help"), search_help()); + theme("footer"); break; default: search_view(); diff --git a/modules/search/search.module b/modules/search/search.module index 47710d647..bb2bff481 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -304,7 +304,7 @@ function search_save($edit) { } function search_view() { - global $theme, $edit, $type, $keys; + global $edit, $type, $keys; if (user_access("search content")) { @@ -335,39 +335,39 @@ function search_view() { $form .= $help_link; } - $theme->header(); + theme("header"); if ($form) { - $theme->box(t("Search"), $form); + theme("box", t("Search"), $form); } if ($keys) { if ($output) { - $theme->box(t("Result"), $output); + theme("box", t("Result"), $output); } else { - $theme->box(t("Result"), t("Your search yielded no results.")); + theme("box", t("Result"), t("Your search yielded no results.")); } } - $theme->footer(); + theme("footer"); } else { - $theme->header(); - $theme->box(t("Access denied"), message_access()); - $theme->footer(); + theme("header"); + theme("box", t("Access denied"), message_access()); + theme("footer"); } } function search_page() { - global $theme; + switch (arg(1)) { case "help": - $theme->header(); - $theme->box(t("Search Help"), search_help()); - $theme->footer(); + theme("header"); + theme("box", t("Search Help"), search_help()); + theme("footer"); break; default: search_view(); diff --git a/modules/statistics.module b/modules/statistics.module index c3644070d..d4e8d3c11 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -845,24 +845,24 @@ function statistics_block($op = "list", $delta = 0) { function statistics_page() { - global $theme; + if (user_access("access content")) { - $theme->header(); + theme("header"); statistics_page_user(); - $theme->footer(); + theme("footer"); } else { - $theme->header(); - $theme->box(t("Access denied"), message_access()); - $theme->footer(); + theme("header"); + theme("box", t("Access denied"), message_access()); + theme("footer"); } } /* Generates the statistics user page */ function statistics_page_user($uid = 0, $date = 0, $all = 0) { - global $theme; + if (!$date) { $date = time(); @@ -873,7 +873,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) { $output .= statistics_summary("daycount", $displaycount); $output .= "</table>"; - $theme->box(t(variable_get("statistics_userpage_day_head", "")), $output, "main"); + theme("box", t(variable_get("statistics_userpage_day_head", "")), $output, "main"); } @@ -882,7 +882,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) { $output .= statistics_summary("totalcount", $displaycount); $output .= "</table>"; - $theme->box(t(variable_get("statistics_userpage_all_head", "")), $output, "main"); + theme("box", t(variable_get("statistics_userpage_all_head", "")), $output, "main"); } if ($displaycount = variable_get("statistics_userpage_last_cnt", "10")) { @@ -890,14 +890,14 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) { $output .= statistics_summary("timestamp", $displaycount); $output .= "</table>"; - $theme->box(t(variable_get("statistics_userpage_last_head", "")), $output, "main"); + theme("box", t(variable_get("statistics_userpage_last_head", "")), $output, "main"); } } function statistics_summary($dbfield, $dbrows) { /* valid dbfields: totalcount, daycount, timestamp */ - global $theme; + $output = ""; $result = db_query("SELECT statistics.nid,node.title FROM statistics LEFT JOIN node ON statistics.nid = node.nid ORDER BY %s DESC LIMIT %s", $dbfield, $dbrows); @@ -907,7 +907,7 @@ function statistics_summary($dbfield, $dbrows) { $output .= "<tr><td><b>". l($nid["title"], "node/view/". $nid["nid"], array("title" => t("View this posting."))) ."</b></td><td align=\"right\"><small>". t("Submitted by %a on %b", array("%a" => format_name($content), "%b" => format_date($content->created, "large"))) ."</small></td></tr>"; $output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">". check_output($content->teaser) ."</div></td></tr>"; - $output .= "<tr><td align=\"right\" colspan=\"2\">[ ". $theme->links($links) ." ]<br /><br /></td></tr>"; + $output .= "<tr><td align=\"right\" colspan=\"2\">[ ". theme("links", $links) ." ]<br /><br /></td></tr>"; } return $output; diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index c3644070d..d4e8d3c11 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -845,24 +845,24 @@ function statistics_block($op = "list", $delta = 0) { function statistics_page() { - global $theme; + if (user_access("access content")) { - $theme->header(); + theme("header"); statistics_page_user(); - $theme->footer(); + theme("footer"); } else { - $theme->header(); - $theme->box(t("Access denied"), message_access()); - $theme->footer(); + theme("header"); + theme("box", t("Access denied"), message_access()); + theme("footer"); } } /* Generates the statistics user page */ function statistics_page_user($uid = 0, $date = 0, $all = 0) { - global $theme; + if (!$date) { $date = time(); @@ -873,7 +873,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) { $output .= statistics_summary("daycount", $displaycount); $output .= "</table>"; - $theme->box(t(variable_get("statistics_userpage_day_head", "")), $output, "main"); + theme("box", t(variable_get("statistics_userpage_day_head", "")), $output, "main"); } @@ -882,7 +882,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) { $output .= statistics_summary("totalcount", $displaycount); $output .= "</table>"; - $theme->box(t(variable_get("statistics_userpage_all_head", "")), $output, "main"); + theme("box", t(variable_get("statistics_userpage_all_head", "")), $output, "main"); } if ($displaycount = variable_get("statistics_userpage_last_cnt", "10")) { @@ -890,14 +890,14 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) { $output .= statistics_summary("timestamp", $displaycount); $output .= "</table>"; - $theme->box(t(variable_get("statistics_userpage_last_head", "")), $output, "main"); + theme("box", t(variable_get("statistics_userpage_last_head", "")), $output, "main"); } } function statistics_summary($dbfield, $dbrows) { /* valid dbfields: totalcount, daycount, timestamp */ - global $theme; + $output = ""; $result = db_query("SELECT statistics.nid,node.title FROM statistics LEFT JOIN node ON statistics.nid = node.nid ORDER BY %s DESC LIMIT %s", $dbfield, $dbrows); @@ -907,7 +907,7 @@ function statistics_summary($dbfield, $dbrows) { $output .= "<tr><td><b>". l($nid["title"], "node/view/". $nid["nid"], array("title" => t("View this posting."))) ."</b></td><td align=\"right\"><small>". t("Submitted by %a on %b", array("%a" => format_name($content), "%b" => format_date($content->created, "large"))) ."</small></td></tr>"; $output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">". check_output($content->teaser) ."</div></td></tr>"; - $output .= "<tr><td align=\"right\" colspan=\"2\">[ ". $theme->links($links) ." ]<br /><br /></td></tr>"; + $output .= "<tr><td align=\"right\" colspan=\"2\">[ ". theme("links", $links) ." ]<br /><br /></td></tr>"; } return $output; diff --git a/modules/taxonomy.module b/modules/taxonomy.module index 01447d37a..dd67863cb 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -683,7 +683,7 @@ function taxonomy_render_nodes($result) { } function taxonomy_page() { - global $theme; + // taxonomy querystring always parsed here // TODO: support term *names* in URL (e.g. taxonomy/view/or/milk,beer,red+wine) @@ -696,9 +696,9 @@ function taxonomy_page() { taxonomy_feed($taxonomy); break; default: - $theme->header(); + theme("header"); taxonomy_render_nodes(taxonomy_select_nodes($taxonomy)); - $theme->footer(); + theme("footer"); break; } } @@ -708,7 +708,7 @@ function taxonomy_page() { */ function taxonomy_admin() { - global $op, $edit, $theme; + global $op, $edit; if (user_access("administer taxonomy")) { if (empty($op)) { diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 01447d37a..dd67863cb 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -683,7 +683,7 @@ function taxonomy_render_nodes($result) { } function taxonomy_page() { - global $theme; + // taxonomy querystring always parsed here // TODO: support term *names* in URL (e.g. taxonomy/view/or/milk,beer,red+wine) @@ -696,9 +696,9 @@ function taxonomy_page() { taxonomy_feed($taxonomy); break; default: - $theme->header(); + theme("header"); taxonomy_render_nodes(taxonomy_select_nodes($taxonomy)); - $theme->footer(); + theme("footer"); break; } } @@ -708,7 +708,7 @@ function taxonomy_page() { */ function taxonomy_admin() { - global $op, $edit, $theme; + global $op, $edit; if (user_access("administer taxonomy")) { if (empty($op)) { diff --git a/modules/tracker.module b/modules/tracker.module index 231f0afec..e0ea2f9a0 100644 --- a/modules/tracker.module +++ b/modules/tracker.module @@ -67,27 +67,27 @@ function tracker_menu() { function tracker_page() { - global $theme, $user; + global $user; if (user_access("access comments")) { if (arg(1) == $user->uid) { - $theme->header(t("Your recent comments")); - $theme->box(t("Tracker"), tracker_menu()); - $theme->box(t("Your recent comments"), tracker_comments(arg(1))); - $theme->footer(); + theme("header", t("Your recent comments")); + theme("box", t("Tracker"), tracker_menu()); + theme("box", t("Your recent comments"), tracker_comments(arg(1))); + theme("footer"); } else if (arg(1)) { $account = user_load(array("uid" => arg(1))); - $theme->header(t("%u's recent comments", array("%u" => $account->name))); - $theme->box(t("Tracker"), tracker_menu()); - $theme->box(t("%u's recent comments", array("%u" => $account->name)), tracker_comments(arg(1))); - $theme->footer(); + theme("header", t("%u's recent comments", array("%u" => $account->name))); + theme("box", t("Tracker"), tracker_menu()); + theme("box", t("%u's recent comments", array("%u" => $account->name)), tracker_comments(arg(1))); + theme("footer"); } else { - $theme->header(t("All recent comments")); - $theme->box(t("Tracker"), tracker_menu()); - $theme->box(t("All recent comments"), tracker_comments()); - $theme->footer(); + theme("header", t("All recent comments")); + theme("box", t("Tracker"), tracker_menu()); + theme("box", t("All recent comments"), tracker_comments()); + theme("footer"); } } } diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index 231f0afec..e0ea2f9a0 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -67,27 +67,27 @@ function tracker_menu() { function tracker_page() { - global $theme, $user; + global $user; if (user_access("access comments")) { if (arg(1) == $user->uid) { - $theme->header(t("Your recent comments")); - $theme->box(t("Tracker"), tracker_menu()); - $theme->box(t("Your recent comments"), tracker_comments(arg(1))); - $theme->footer(); + theme("header", t("Your recent comments")); + theme("box", t("Tracker"), tracker_menu()); + theme("box", t("Your recent comments"), tracker_comments(arg(1))); + theme("footer"); } else if (arg(1)) { $account = user_load(array("uid" => arg(1))); - $theme->header(t("%u's recent comments", array("%u" => $account->name))); - $theme->box(t("Tracker"), tracker_menu()); - $theme->box(t("%u's recent comments", array("%u" => $account->name)), tracker_comments(arg(1))); - $theme->footer(); + theme("header", t("%u's recent comments", array("%u" => $account->name))); + theme("box", t("Tracker"), tracker_menu()); + theme("box", t("%u's recent comments", array("%u" => $account->name)), tracker_comments(arg(1))); + theme("footer"); } else { - $theme->header(t("All recent comments")); - $theme->box(t("Tracker"), tracker_menu()); - $theme->box(t("All recent comments"), tracker_comments()); - $theme->footer(); + theme("header", t("All recent comments")); + theme("box", t("Tracker"), tracker_menu()); + theme("box", t("All recent comments"), tracker_comments()); + theme("footer"); } } } diff --git a/modules/user.module b/modules/user.module index 3c1244817..cb170f579 100644 --- a/modules/user.module +++ b/modules/user.module @@ -999,7 +999,7 @@ function user_menu() { } function user_view($uid = 0) { - global $theme, $user; + global $user; if (!$uid) { $uid = $user->uid; @@ -1015,10 +1015,10 @@ function user_view($uid = 0) { } } - $theme->header(); - $theme->box(t("User account"), user_menu()); - $theme->box(t("View user information"), $output); - $theme->footer(); + theme("header"); + theme("box", t("User account"), user_menu()); + theme("box", t("View user information"), $output); + theme("footer"); } else if ($uid && $account = user_load(array("uid" => $uid, "status" => 1))) { $output = form_item(t("Name"), $account->name); @@ -1029,23 +1029,23 @@ function user_view($uid = 0) { } } - $theme->header(); - $theme->box(t("View user information"), $output); - $theme->footer(); + theme("header"); + theme("box", t("View user information"), $output); + theme("footer"); } else { - $theme->header(); - $theme->box(t("Log in"), user_login()); + theme("header"); + theme("box", t("Log in"), user_login()); if (variable_get("user_register", 1)) { - $theme->box(t("Create new user account"), user_register()); + theme("box", t("Create new user account"), user_register()); } - $theme->box(t("E-mail new password"), user_pass()); - $theme->footer(); + theme("box", t("E-mail new password"), user_pass()); + theme("footer"); } } function user_page() { - global $edit, $op, $theme; + global $edit, $op; if (empty($op)) { $op = arg(1); @@ -1054,45 +1054,45 @@ function user_page() { switch ($op) { case t("E-mail new password"); case "password": - $theme->header(); - $theme->box(t("E-mail new password"), user_pass($edit)); - $theme->footer(); + theme("header"); + theme("box", t("E-mail new password"), user_pass($edit)); + theme("footer"); break; case t("Create new account"): case "register": $output = user_register($edit); - $theme->header(); + theme("header"); if (variable_get("user_register", 1)) { - $theme->box(t("Create new account"), $output); + theme("box", t("Create new account"), $output); } else { print message_access(); } - $theme->footer(); + theme("footer"); break; case t("Log in"): case "login": $output = user_login($edit); - $theme->header(); - $theme->box(t("Log in"), $output); - $theme->footer(); + theme("header"); + theme("box", t("Log in"), $output); + theme("footer"); break; case t("Delete account"): case t("delete"); $output = user_delete(); - $theme->header(); - $theme->box(t("User account"), user_menu()); - $theme->box(t("Delete account"), $output); - $theme->footer(); + theme("header"); + theme("box", t("User account"), user_menu()); + theme("box", t("Delete account"), $output); + theme("footer"); break; case t("Save user information"): case "edit": $output = user_edit($edit); $theme = theme_init(); - $theme->header(); - $theme->box(t("User account"), user_menu()); - $theme->box(t("Edit user information"), $output); - $theme->footer(); + theme("header"); + theme("box", t("User account"), user_menu()); + theme("box", t("Edit user information"), $output); + theme("footer"); break; case "view": user_view(arg(2)); @@ -1102,9 +1102,9 @@ function user_page() { print user_logout(); break; case "help": - $theme->header(); - $theme->box(t("Distributed authentication"), user_help_users_da()); - $theme->footer(); + theme("header"); + theme("box", t("Distributed authentication"), user_help_users_da()); + theme("footer"); break; default: print user_view(); @@ -1817,10 +1817,10 @@ function user_help_devel_da() { and we return TRUE. </p> <pre>function blogger_page() { - global $theme; - $theme->header(); - $theme->box("Blogger", blogger_auth_help()); - $theme->footer(); + + $theme("header"); + $theme("box", "Blogger", blogger_auth_help()); + $theme("footer"); }</pre> <p>The _page function is not currently used, but it might be in the future. For now, just copy what you see here, substituting your module name for <i>blogger</i>.</p> diff --git a/modules/user/user.module b/modules/user/user.module index 3c1244817..cb170f579 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -999,7 +999,7 @@ function user_menu() { } function user_view($uid = 0) { - global $theme, $user; + global $user; if (!$uid) { $uid = $user->uid; @@ -1015,10 +1015,10 @@ function user_view($uid = 0) { } } - $theme->header(); - $theme->box(t("User account"), user_menu()); - $theme->box(t("View user information"), $output); - $theme->footer(); + theme("header"); + theme("box", t("User account"), user_menu()); + theme("box", t("View user information"), $output); + theme("footer"); } else if ($uid && $account = user_load(array("uid" => $uid, "status" => 1))) { $output = form_item(t("Name"), $account->name); @@ -1029,23 +1029,23 @@ function user_view($uid = 0) { } } - $theme->header(); - $theme->box(t("View user information"), $output); - $theme->footer(); + theme("header"); + theme("box", t("View user information"), $output); + theme("footer"); } else { - $theme->header(); - $theme->box(t("Log in"), user_login()); + theme("header"); + theme("box", t("Log in"), user_login()); if (variable_get("user_register", 1)) { - $theme->box(t("Create new user account"), user_register()); + theme("box", t("Create new user account"), user_register()); } - $theme->box(t("E-mail new password"), user_pass()); - $theme->footer(); + theme("box", t("E-mail new password"), user_pass()); + theme("footer"); } } function user_page() { - global $edit, $op, $theme; + global $edit, $op; if (empty($op)) { $op = arg(1); @@ -1054,45 +1054,45 @@ function user_page() { switch ($op) { case t("E-mail new password"); case "password": - $theme->header(); - $theme->box(t("E-mail new password"), user_pass($edit)); - $theme->footer(); + theme("header"); + theme("box", t("E-mail new password"), user_pass($edit)); + theme("footer"); break; case t("Create new account"): case "register": $output = user_register($edit); - $theme->header(); + theme("header"); if (variable_get("user_register", 1)) { - $theme->box(t("Create new account"), $output); + theme("box", t("Create new account"), $output); } else { print message_access(); } - $theme->footer(); + theme("footer"); break; case t("Log in"): case "login": $output = user_login($edit); - $theme->header(); - $theme->box(t("Log in"), $output); - $theme->footer(); + theme("header"); + theme("box", t("Log in"), $output); + theme("footer"); break; case t("Delete account"): case t("delete"); $output = user_delete(); - $theme->header(); - $theme->box(t("User account"), user_menu()); - $theme->box(t("Delete account"), $output); - $theme->footer(); + theme("header"); + theme("box", t("User account"), user_menu()); + theme("box", t("Delete account"), $output); + theme("footer"); break; case t("Save user information"): case "edit": $output = user_edit($edit); $theme = theme_init(); - $theme->header(); - $theme->box(t("User account"), user_menu()); - $theme->box(t("Edit user information"), $output); - $theme->footer(); + theme("header"); + theme("box", t("User account"), user_menu()); + theme("box", t("Edit user information"), $output); + theme("footer"); break; case "view": user_view(arg(2)); @@ -1102,9 +1102,9 @@ function user_page() { print user_logout(); break; case "help": - $theme->header(); - $theme->box(t("Distributed authentication"), user_help_users_da()); - $theme->footer(); + theme("header"); + theme("box", t("Distributed authentication"), user_help_users_da()); + theme("footer"); break; default: print user_view(); @@ -1817,10 +1817,10 @@ function user_help_devel_da() { and we return TRUE. </p> <pre>function blogger_page() { - global $theme; - $theme->header(); - $theme->box("Blogger", blogger_auth_help()); - $theme->footer(); + + $theme("header"); + $theme("box", "Blogger", blogger_auth_help()); + $theme("footer"); }</pre> <p>The _page function is not currently used, but it might be in the future. For now, just copy what you see here, substituting your module name for <i>blogger</i>.</p> |