Commit 951b553a authored by Dries's avatar Dries

parent 00ee7f74
......@@ -1186,6 +1186,5 @@ function drupal_page_footer() {
$locale = locale_init();
// initialize theme:
$theme = theme_init();
$theme = init_theme();
?>
......@@ -28,7 +28,7 @@ function pager_display($tags = "", $limit = 10, $element = 0, $type = "default",
*
* @see pager_display
*/
function pager_display_default($tags = "", $limit = 10, $element = 0, $attributes = array()) {
function theme_pager_display_default($tags = "", $limit = 10, $element = 0, $attributes = array()) {
global $pager_total;
if ($pager_total[$element] > $limit) {
$output .= "<div id=\"pager\" class=\"container-inline\">";
......@@ -51,13 +51,13 @@ function pager_display_default($tags = "", $limit = 10, $element = 0, $attribute
*
* @see pager_display
*/
function pager_display_simple($tags = "", $limit = 10, $element = 0, $attributes = array()) {
function theme_pager_display_simple($tags = "", $limit = 10, $element = 0, $attributes = array()) {
/*
** It's left as an exercise to theme writers to create an alternative
** pager for pager_display_simple(). if your theme does not offer a
** replacement, the theme.inc pager_display_default() is used.
*/
return pager_display_default($tags, $limit, $element, $attributes);
return theme_pager_display_default($tags, $limit, $element, $attributes);
}
/**
......@@ -68,13 +68,13 @@ function pager_display_simple($tags = "", $limit = 10, $element = 0, $attributes
*
* @see pager_display
*/
function pager_display_admin($tags = "", $limit = 10, $element = 0, $attributes = array()) {
function theme_pager_display_admin($tags = "", $limit = 10, $element = 0, $attributes = array()) {
/*
** It's left as an exercise to theme writers to create an alternative
** pager for pager_display_admin(). if your theme does not offer a
** replacement, the pager.inc pager_display_default() is used.
*/
return pager_display_default($tags, $limit, $element, $attributes);
return theme_pager_display_default($tags, $limit, $element, $attributes);
}
/* *******************************************************************
......
This diff is collapsed.
......@@ -124,7 +124,7 @@ function import_update() {
}
}
function import_theme_format_item($item, $feed = 0) {
function theme_import_format_item($item, $feed = 0) {
global $user;
if ($user->uid && module_exist("blog") && user_access("maintain personal blog")) {
......@@ -148,7 +148,7 @@ function import_bundle_block($attributes) {
$items = array();
while ($item = db_fetch_object($result)) {
$items[] = theme("import_theme_format_item", $item);
$items[] = theme("import_format_item", $item);
}
$output = "<div class=\"import-block\"><div class=\"bundle\">";
......@@ -163,11 +163,11 @@ function import_feed_block($feed) {
$items = array();
while ($item = db_fetch_object($result)) {
$items[] = theme("import_theme_format_item", $item);
$items[] = theme("import_format_item", $item);
}
$output = "<div class=\"import-block\"><div class=\"feed\">";
$output .= theme("theme_item_list", $items);
$output .= theme("item_list", $items);
$output .= "</div></div>";
return $output;
......@@ -656,10 +656,10 @@ 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");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", t("Latest news"), $output);
print theme("footer");
}
function import_page_feed($fid) {
......@@ -691,11 +691,11 @@ 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");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", $feed->title, $header);
print theme("box", t("Latest news"), $output);
print theme("footer");
}
function import_page_bundle($bid) {
......@@ -730,11 +730,11 @@ 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");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", $bundle->title, $header);
print theme("box", t("Latest news"), $output);
print theme("footer");
}
......@@ -750,10 +750,10 @@ function import_page_sources() {
$output .= "<div style=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."</div><br />";
theme("header");
theme("box", t("News feeds"), import_page_info());
theme("box", t("News sources"), $output);
theme("footer");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", t("News sources"), $output);
print theme("footer");
}
function import_page_fd() {
......@@ -788,8 +788,8 @@ function import_page_feeds() {
function import_page_blocks($blocks) {
theme("header");
theme("box", t("News feeds"), import_page_info());
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print "<table cellpadding=\"0\" cellspacing=\"5\" border=\"0\" style=\"width: 100%;\">\n";
print " <tr>\n";
......@@ -797,7 +797,7 @@ function import_page_blocks($blocks) {
$i = 1;
print " <td style=\"vertical-align: top; width: 33%;\">\n";
while ($block = each($blocks)) {
theme("box", $block["value"]["subject"], $block["value"]["content"]);
print theme("box", $block["value"]["subject"], $block["value"]["content"]);
if ($i == ceil(count($blocks) / 3)) {
break;
}
......@@ -808,7 +808,7 @@ function import_page_blocks($blocks) {
print " </tr>\n";
print "</table>\n";
theme("footer");
print theme("footer");
}
function import_page() {
......
......@@ -124,7 +124,7 @@ function import_update() {
}
}
function import_theme_format_item($item, $feed = 0) {
function theme_import_format_item($item, $feed = 0) {
global $user;
if ($user->uid && module_exist("blog") && user_access("maintain personal blog")) {
......@@ -148,7 +148,7 @@ function import_bundle_block($attributes) {
$items = array();
while ($item = db_fetch_object($result)) {
$items[] = theme("import_theme_format_item", $item);
$items[] = theme("import_format_item", $item);
}
$output = "<div class=\"import-block\"><div class=\"bundle\">";
......@@ -163,11 +163,11 @@ function import_feed_block($feed) {
$items = array();
while ($item = db_fetch_object($result)) {
$items[] = theme("import_theme_format_item", $item);
$items[] = theme("import_format_item", $item);
}
$output = "<div class=\"import-block\"><div class=\"feed\">";
$output .= theme("theme_item_list", $items);
$output .= theme("item_list", $items);
$output .= "</div></div>";
return $output;
......@@ -656,10 +656,10 @@ 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");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", t("Latest news"), $output);
print theme("footer");
}
function import_page_feed($fid) {
......@@ -691,11 +691,11 @@ 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");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", $feed->title, $header);
print theme("box", t("Latest news"), $output);
print theme("footer");
}
function import_page_bundle($bid) {
......@@ -730,11 +730,11 @@ 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");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", $bundle->title, $header);
print theme("box", t("Latest news"), $output);
print theme("footer");
}
......@@ -750,10 +750,10 @@ function import_page_sources() {
$output .= "<div style=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."</div><br />";
theme("header");
theme("box", t("News feeds"), import_page_info());
theme("box", t("News sources"), $output);
theme("footer");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", t("News sources"), $output);
print theme("footer");
}
function import_page_fd() {
......@@ -788,8 +788,8 @@ function import_page_feeds() {
function import_page_blocks($blocks) {
theme("header");
theme("box", t("News feeds"), import_page_info());
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print "<table cellpadding=\"0\" cellspacing=\"5\" border=\"0\" style=\"width: 100%;\">\n";
print " <tr>\n";
......@@ -797,7 +797,7 @@ function import_page_blocks($blocks) {
$i = 1;
print " <td style=\"vertical-align: top; width: 33%;\">\n";
while ($block = each($blocks)) {
theme("box", $block["value"]["subject"], $block["value"]["content"]);
print theme("box", $block["value"]["subject"], $block["value"]["content"]);
if ($i == ceil(count($blocks) / 3)) {
break;
}
......@@ -808,7 +808,7 @@ function import_page_blocks($blocks) {
print " </tr>\n";
print "</table>\n";
theme("footer");
print theme("footer");
}
function import_page() {
......
......@@ -197,7 +197,7 @@ function archive_page() {
$op = $_POST["op"];
$edit = $_POST["edit"];
theme("header");
print theme("header");
if (user_access("access content")) {
if ($op == t("Show")) {
......@@ -224,7 +224,7 @@ function archive_page() {
$start = "<div class=\"container-inline\">";
$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 .= "</div>";
theme("box", t("Archives"), form($start));
print theme("box", t("Archives"), form($start));
/*
** Fetch nodes for the selected date, or current date if none
......@@ -243,7 +243,7 @@ function archive_page() {
message_access();
}
theme("footer");
print theme("footer");
}
function archive_settings() {
......
......@@ -197,7 +197,7 @@ function archive_page() {
$op = $_POST["op"];
$edit = $_POST["edit"];
theme("header");
print theme("header");
if (user_access("access content")) {
if ($op == t("Show")) {
......@@ -224,7 +224,7 @@ function archive_page() {
$start = "<div class=\"container-inline\">";
$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 .= "</div>";
theme("box", t("Archives"), form($start));
print theme("box", t("Archives"), form($start));
/*
** Fetch nodes for the selected date, or current date if none
......@@ -243,7 +243,7 @@ function archive_page() {
message_access();
}
theme("footer");
print theme("footer");
}
function archive_settings() {
......
......@@ -119,7 +119,7 @@ function blog_page_user($uid) {
$breadcrumb[] = l(t("Home"), NULL);
$breadcrumb[] = l(t("Blogs"), "blog");
$breadcrumb[] = t("%name's blog", array("%name" => $account->name));
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
$result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND uid = '$account->uid' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10));
while ($node = db_fetch_object($result)) {
......@@ -135,7 +135,7 @@ function blog_page_last() {
// Breadcrumb navigation:
$breadcrumb[] = l(t("Home"), NULL);
$breadcrumb[] = t("Blogs");
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
$result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10));
......@@ -153,7 +153,7 @@ function blog_validate(&$node) {
*/
if (isset($node->body) && count(explode(" ", $node->body)) < variable_get("minimum_blog_size", 0)) {
$error["body"] = theme("theme_error", t("The body of your blog is too short."));
$error["body"] = theme("error", t("The body of your blog is too short."));
}
return $error;
......@@ -207,20 +207,20 @@ function blog_page() {
}
break;
default:
theme("header");
print theme("header");
if (arg(1)) {
blog_page_user(arg(1));
}
else {
blog_page_last();
}
theme("footer");
print theme("footer");
}
}
else {
theme("header");
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header");
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}
......@@ -237,12 +237,12 @@ function blog_view($node, $main = 0) {
$breadcrumb[] = l(t("Home"), NULL);
$breadcrumb[] = l(t("%name's blog", array("%name" => $node->name)), "blog/$node->uid");
// print the breadcrumb
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
}
// prepair the node content
$node = blog_content($node);
// print the node
theme("node", $node, $main);
print theme("node", $node, $main);
}
function blog_link($type, $node = 0, $main) {
......
......@@ -119,7 +119,7 @@ function blog_page_user($uid) {
$breadcrumb[] = l(t("Home"), NULL);
$breadcrumb[] = l(t("Blogs"), "blog");
$breadcrumb[] = t("%name's blog", array("%name" => $account->name));
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
$result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND uid = '$account->uid' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10));
while ($node = db_fetch_object($result)) {
......@@ -135,7 +135,7 @@ function blog_page_last() {
// Breadcrumb navigation:
$breadcrumb[] = l(t("Home"), NULL);
$breadcrumb[] = t("Blogs");
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
$result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10));
......@@ -153,7 +153,7 @@ function blog_validate(&$node) {
*/
if (isset($node->body) && count(explode(" ", $node->body)) < variable_get("minimum_blog_size", 0)) {
$error["body"] = theme("theme_error", t("The body of your blog is too short."));
$error["body"] = theme("error", t("The body of your blog is too short."));
}
return $error;
......@@ -207,20 +207,20 @@ function blog_page() {
}
break;
default:
theme("header");
print theme("header");
if (arg(1)) {
blog_page_user(arg(1));
}
else {
blog_page_last();
}
theme("footer");
print theme("footer");
}
}
else {
theme("header");
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header");
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}
......@@ -237,12 +237,12 @@ function blog_view($node, $main = 0) {
$breadcrumb[] = l(t("Home"), NULL);
$breadcrumb[] = l(t("%name's blog", array("%name" => $node->name)), "blog/$node->uid");
// print the breadcrumb
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
}
// prepair the node content
$node = blog_content($node);
// print the node
theme("node", $node, $main);
print theme("node", $node, $main);
}
function blog_link($type, $node = 0, $main) {
......
......@@ -390,7 +390,7 @@ function book_view($node, $main = 0) {
*/
if ($main) {
theme("node", $node, $main);
print theme("node", $node, $main);
}
else {
if ($node->moderate) {
......@@ -400,10 +400,10 @@ function book_view($node, $main = 0) {
if (arg(1) == "view") {
$node = book_navigation($node);
// Print the breadcrumb
theme("breadcrumb", $node->breadcrumb);
print theme("breadcrumb", $node->breadcrumb);
}
// Print the node
theme("node", $node, $main);
print theme("node", $node, $main);
}
}
......@@ -441,8 +441,8 @@ function book_show($node, $cid) {
/*
** View the node
*/
theme("breadcrumb", $node->breadcrumb);
theme("node", $node, 0);
print theme("breadcrumb", $node->breadcrumb);
print theme("node", $node, 0);
}
else {
......@@ -621,9 +621,9 @@ function book_render() {
}
}
theme("header");
theme("box", t("Books"), "$output");
theme("footer");
print theme("header");
print theme("box", t("Books"), "$output");
print theme("footer");
}
function book_page() {
......@@ -632,9 +632,9 @@ function book_page() {
switch (arg(1)) {
case "view":
$node = node_load(array("nid" => arg(2)));
theme("header");
print theme("header");
book_show($node, arg(3));
theme("footer");
print theme("footer");
break;
case "print":
print book_print(arg(2), $depth = 1);
......@@ -644,9 +644,9 @@ function book_page() {
}
}
else {
theme("header");
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header");
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}
......
......@@ -390,7 +390,7 @@ function book_view($node, $main = 0) {
*/
if ($main) {
theme("node", $node, $main);
print theme("node", $node, $main);
}
else {
if ($node->moderate) {
......@@ -400,10 +400,10 @@ function book_view($node, $main = 0) {
if (arg(1) == "view") {
$node = book_navigation($node);
// Print the breadcrumb
theme("breadcrumb", $node->breadcrumb);
print theme("breadcrumb", $node->breadcrumb);
}
// Print the node
theme("node", $node, $main);
print theme("node", $node, $main);
}
}
......@@ -441,8 +441,8 @@ function book_show($node, $cid) {
/*
** View the node
*/
theme("breadcrumb", $node->breadcrumb);
theme("node", $node, 0);
print theme("breadcrumb", $node->breadcrumb);
print theme("node", $node, 0);
}
else {
......@@ -621,9 +621,9 @@ function book_render() {
}
}
theme("header");
theme("box", t("Books"), "$output");
theme("footer");
print theme("header");
print theme("box", t("Books"), "$output");
print theme("footer");
}
function book_page() {
......@@ -632,9 +632,9 @@ function book_page() {
switch (arg(1)) {
case "view":
$node = node_load(array("nid" => arg(2)));
theme("header");
print theme("header");
book_show($node, arg(3));
theme("footer");
print theme("footer");
break;
case "print":
print book_print(arg(2), $depth = 1);
......@@ -644,9 +644,9 @@ function book_page() {
}
}
else {
theme("header");
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header");
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}
......
......@@ -192,9 +192,9 @@ function cloud_page() {
if (user_access("access site cloud")) {
theme("header");
theme("box", t("Site cloud"), cloud_help("cloud") . cloud_list(100));
theme("footer");
print theme("header");
print theme("box", t("Site cloud"), cloud_help("cloud") . cloud_list(100));
print theme("footer");
}
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -157,9 +157,9 @@ function drupal_auth($username, $password, $server) {
function drupal_page() {
theme("header");
theme("box", "Drupal", drupal_help("user/help#drupal"));
theme("footer");
print theme("header");
print theme("box", "Drupal", drupal_help("user/help#drupal"));
print theme("footer");
}
function drupal_login($arguments) {
......
......@@ -157,9 +157,9 @@ function drupal_auth($username, $password, $server) {
function drupal_page() {
theme("header");
theme("box", "Drupal", drupal_help("user/help#drupal"));
theme("footer");
print theme("header");
print theme("box", "Drupal", drupal_help("user/help#drupal"));
print theme("footer");
}
function drupal_login($arguments) {
......
......@@ -149,12 +149,12 @@ function forum_view($node, $main = 0) {
$breadcrumb[] = l(t("Forums"), "forum");
$breadcrumb[] = l($term_data->name, "forum/$term_data->tid");
// print the breadcrumb
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
}
// prepair the node content
$node = forum_content($node);
// print the node
theme("node", $node, $main);
print theme("node", $node, $main);
}
function forum_validate(&$node) {
......@@ -434,28 +434,44 @@ function forum_page() {
$topics = forum_get_topics($tid, $sortby, $forum_per_page);
}
theme("forum_theme_display", $forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset);
print theme("forum_display", $forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset);
}
else {
$message = t("Warning");
theme("header", $message);
theme("box", $message, _forum_message_taxonomy());
theme("footer");
print theme("header", $message);
print theme("box", $message, _forum_message_taxonomy());
print theme("footer");
}
}
else {
$message = t("Access denied");
theme("header", $message);
theme("box", $message, message_access());
theme("footer");
print theme("header", $message);
print theme("box", $message, message_access());
print theme("footer");
}
}
/*
** Theme functions
*/
/**
@addtogroup theme_system
function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset) {
Forum module specific theme functions.
@{
**/