diff --git a/includes/common.inc b/includes/common.inc index 9df7cc320d1..dc8a942b81a 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1186,6 +1186,5 @@ module_init(); $locale = locale_init(); // initialize theme: -$theme = theme_init(); - +$theme = init_theme(); ?> diff --git a/includes/pager.inc b/includes/pager.inc index a567499b2ee..602f6e78a66 100644 --- a/includes/pager.inc +++ b/includes/pager.inc @@ -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 .= "
"; @@ -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); } /* ******************************************************************* diff --git a/includes/theme.inc b/includes/theme.inc index 7df69fa2d0d..eadafe75a0a 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1,29 +1,25 @@ "; $output .= "". $title ? $title : variable_get(site_name, "drupal") .""; $output .= theme_head($main); - $output .= ""; + $output .= ""; $output .= "
"; - print $output; - theme("box", t("Navigation"), @implode("
", link_page())); - theme_blocks("all", $this); - print "
"; + $output .= theme("box", t("Navigation"), @implode("
", link_page())); + $output .= render_blocks("all"); + $output .= "
"; + + return $output; } +/** + Returns themed set of links. + + @param $links an array of \a links to be themed. + @param $delimiter (optional) \a delimiter used to seperate the links. + + @return a string contraining the \a links output. +**/ function theme_links($links, $delimiter = " | ") { return implode($delimiter, $links); } +/** + Returns themed image. + + @param $name the \a name of the image file. + + @return a string contraining the \a image output. +**/ function theme_image($name) { return "misc/$name"; } +/** + Returns a themed breadcrumb menu. + + @param $breadcrumb an array containing the breadcrumb links. + + @return a string contraining the \a breadcrumb output. +**/ function theme_breadcrumb($breadcrumb) { - print "
". implode($breadcrumb, " » ") ."
"; + return "
". implode($breadcrumb, " » ") ."
"; } +/** + Returns themed node. + + The passed $node object provides a all relevant information for displaying a node: + \li \c $node->nid + \li \c $node->type i.e. story, blog, forum. + \li \c $node->title + \li \c $node->created a unix timestamp. + \li \c $node->teaser + \li \c $node->body + \li \c $node->changed a unix timestamp. + \li \c $node->uid the id of the poster. + \li \c $node->username the username of the poster. + + @param $node the \a node to be themed. + @param $main + + @return a string contraining the \a node output. +**/ function theme_node($node, $main) { if (module_exist("taxonomy")) { $terms = taxonomy_link("taxonomy terms", $node); @@ -60,7 +98,7 @@ function theme_node($node, $main) { $output = "

$node->title

by ". format_name($node); if (count($terms)) { - $output .= " (". theme("links", $terms) .")
"; + $output .= " (". print theme("links", $terms) .")
"; } if ($main && $node->teaser) { @@ -71,58 +109,77 @@ function theme_node($node, $main) { } if ($links = link_node($node, $main)) { - $output .= "
[ ". theme("links", $links) ." ]"; + $output .= "
[ ". print theme("links", $links) ." ]"; } $output .= "
"; - print $output; -} - -function theme_box($subject, $content, $region = "main") { - $output = "

$subject

$content

"; - print $output; + return $output; } /** - * Render a block. - * - * You can style your blocks by defining .block (all blocks), - * .block-module (all blocks of module module), - * and \#block-module-delta (specific block of - * module module with delta delta) in your - * theme's CSS. - * - * @param $block object "indexed with" fields from database - * table 'blocks' ($block->module, $block->delta, $block->region, - * ...) and fields returned by module_block("view") - * ($block->subject, $block->content, ...). - */ + Returns themed box. + + @param $subject the \a subject of the box. + @param $content the \a content of the box. + @param $requion the \a region of the box. + + @return a string contraining the \a box output. +**/ +function theme_box($subject, $content, $region = "main") { + $output = "

$subject

$content

"; + return $output; +} + +/** + Returns a themed block. + + You can style your blocks by defining .block (all blocks), + .block-module (all blocks of module module), + and \#block-module-delta (specific block of + module module with delta delta) in your + theme's CSS. + + @param $block object "indexed with" fields from database table 'blocks' ($block->module, $block->delta, $block->region, ...) and fields returned by module_block("view") ($block->subject, $block->content, ...). + + @return a string contraining the \a box output. +**/ function theme_block($block) { $output = "
module\" id=\"block-$block->module-$block->delta\">"; $output .= "

$block->subject

"; $output .= "
$block->content
"; $output .= "
"; - print $output; + return $output; } +/** + Returns themed page footer. + + @return a string contraining the \a footer output. +**/ function theme_footer() { $output = "
"; $output .= theme_closure(); $output .= ""; - print $output; + return $output; } /** - * Return a marker. Used to indicate new comments or required form - * fields. - */ + Returns themed marker, useful for marking new comments or required form elements. + + @return a string contraining the \a mark output. +**/ function theme_mark() { return "*"; } /** - * Return a formatted array of items. - */ + Returns themed list of items. + + @param $items (optional) an array of the items to be displayed in a list. + @param $title (optional) the title of the list. + + @return a string contraining the \a list output. +**/ function theme_item_list($items = array(), $title = NULL) { $output .= "
"; if (isset($title)) { @@ -141,13 +198,119 @@ function theme_item_list($items = array(), $title = NULL) { } /** - * Return an error message. - */ + Returns themed error message. + + @param $message the error message to be themed. + + @return a string contraining the \a error output. +**/ function theme_error($message) { return "
$message
"; } -function theme_list($refresh = 0) { +/** + Execute hook _head which is run at the start of the page, and output should be in the head tags. + + @param $main (optional) + + @return a string contraining the \a error output. +**/ +function theme_head($main = 0) { + global $base_url; + $output .= ""; + $output .= "\n"; + $output .= "\n"; + $head = module_invoke_all("head", $main); + $output .= implode($head, "\n"); + return $output; +} + +/** + Execute hook _footer() which is run at the end of the page right + before the tag. + + @param $main (optional) + + @return a string contraining the \a cloasure output. +**/ +function theme_closure($main = 0) { + $footer = module_invoke_all("footer", $main); + return implode($footer, "\n"); +} + +/** + Call _onload hook in all modules to enable modules to insert javascript + that will get run once the page has been loaded by the browser. + + @param $theme_onloads (optional) addition onload directives. + + @return a string contraining the \a onload output. +**/ +function theme_onload_attribute($theme_onloads = array()) { + if (!is_array($theme_onloads)) { + $theme_onloads = array($theme_onloads); + } + // Merge theme onloads (javascript rollovers, image preloads, etc.) + // with module onloads (htmlarea, etc.) + $onloads = array_merge(module_invoke_all("onload"), $theme_onloads); + if (count($onloads)) { + return " onload=\"" . implode("; ", $onloads) . "\""; + } + return ""; +} + +/** + Render blocks available for (global) $user and $region calling $theme->block($block). + + @param $region main|left|right + + @return a string contraining the \a blocks output. + **/ +function render_blocks($region) { + global $user; + + $result = db_query("SELECT * FROM {blocks} WHERE (status = '1' OR custom = '1') ". ($region != "all" ? "AND region = %d " : "") ."ORDER BY weight, module", $region == "left" ? 0 : 1); + + $output = ""; + while ($result && ($block = db_fetch_array($result))) { + if ((($block['status'] && (!$user->uid || !$block['custom'])) || ($block['custom'] && $user->block[$block['module']][$block['delta']])) && (!$block['path'] || preg_match($block['path'], str_replace("?q=", "", request_uri())))) { + $block = array_merge($block, module_invoke($block['module'], 'block', 'view', $block['delta'])); + if ($block['content']) { + $output .= theme('block', (object)$block); + } + } + } + return $output; +} + +/** + Hook Help - returns theme specific help and information. + + @param section defines the \a section of the help to be returned. + + @return a string contraining the help output. +**/ +function theme_help($section) { + $ouptout = ""; + + switch ($section) { + case 'admin/system/themes#description': + $output = t("The base theme"); + break; + } + return $output; +} + +/** + Provides a list of currently avalible themes. + + @param $refresh + + @return an array of the currently avalible themes. +**/ +function list_themes($refresh = 0) { static $list; if ($refresh) { @@ -167,108 +330,63 @@ function theme_list($refresh = 0) { return $list; } -function theme_head($main = 0) { - global $base_url; - $output .= ""; - $output .= "\n"; - $output .= "\n"; - $head = module_invoke_all("head", $main); - $output .= implode($head, "\n"); - return $output; -} - /** - * Execute hook _footer() which is run at the end of the page right - * before the tag - */ -function theme_closure($main = 0) { - $footer = module_invoke_all("footer", $main); - return implode($footer, "\n"); -} + Initialized the theme system. -function theme_init() { + @return the name of the currently selected theme. +**/ +function init_theme() { global $user; - $themes = theme_list(); + $themes = list_themes(); $name = $user->theme ? $user->theme : variable_get("theme_default", 0); + $theme->path = ""; + $theme->name = ""; + if (is_object($themes[$name])) { include_once($themes[$name]->filename); - $class = "Theme_$name"; - $instance =& new $class(); - $instance->path = dirname($themes[$name]->filename); - } - else { - $instance =& new BaseTheme; + $theme->path = dirname($themes[$name]->filename); + $theme->name = $name; } - $instance->theme = $name; - - return $instance; + return $theme; } /** - * Render blocks available for (global) $user and $region calling $theme->block($block). - * - * @param $region main|left|right - */ -function theme_blocks($region) { - global $user; + Returns the path to the currently selected theme. - $result = db_query("SELECT * FROM {blocks} WHERE (status = '1' OR custom = '1') ". ($region != "all" ? "AND region = %d " : "") ."ORDER BY weight, module", $region == "left" ? 0 : 1); - - while ($result && ($block = db_fetch_array($result))) { - if ((($block['status'] && (!$user->uid || !$block['custom'])) || ($block['custom'] && $user->block[$block['module']][$block['delta']])) && (!$block['path'] || preg_match($block['path'], str_replace("?q=", "", request_uri())))) { - $block = array_merge($block, module_invoke($block['module'], 'block', 'view', $block['delta'])); - if ($block['content']) { - theme('block', (object) $block); - } - } - } + @return the path to the the currently selected theme. +**/ +function path_to_theme() { + global $theme; + return $theme->path; } +/** + External interface of the theme system to all other modules, and core files. + + All requests for themed functions must go through this function. It examines + the request and routes it to the appropriate theme function. If the current + theme does not implement the requested function, then the base theme function + is called. + Example: \verbatim $header_text = theme("header"); \endverbatim + + @return the path to the the currently selected theme. +**/ function theme() { global $theme; $args = func_get_args(); - $function = array_shift($args); - $name = $theme->theme; - - if (function_exists($name ."_". $function)) { - return call_user_func_array($name ."_". $function, $args); + if (($theme->name != "") && (function_exists($theme->name ."_". $function))) { + return call_user_func_array($theme->name ."_". $function, $args); } - else if (method_exists($theme, $function)) { - return call_user_method_array($function, $theme, $args); - // temporary fall-back; can be removed as soon the $theme-object is no more - } - else if (function_exists("theme_". $function)) { + elseif (function_exists("theme_". $function)){ return call_user_func_array("theme_". $function, $args); } - else { - return call_user_func_array($function, $args); - // temporary fall-back; can be removed as soon the $theme-object is no more - } -} - -/** - * Call _onload hook in all modules to enable modules to insert javascript - * that will get run once the page has been loaded by the browser - */ -function theme_onload_attribute($theme_onloads = array()) { - if (!is_array($theme_onloads)) { - $theme_onloads = array($theme_onloads); - } - // Merge theme onloads (javascript rollovers, image preloads, etc.) - // with module onloads (htmlarea, etc.) - $onloads = array_merge(module_invoke_all("onload"), $theme_onloads); - if (count($onloads)) { - return " onload=\"" . implode("; ", $onloads) . "\""; - } - return; } +/** @} End of defgroup theme_system **/ ?> diff --git a/modules/aggregator.module b/modules/aggregator.module index fd932f3cbc1..c44dbd5fcfc 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -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 = "
"; @@ -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 = "
"; - $output .= theme("theme_item_list", $items); + $output .= theme("item_list", $items); $output .= "
"; return $output; @@ -656,10 +656,10 @@ function import_page_last() { } $output .= "\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 .= "\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 .= "\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 .= "
". l("", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."

"; - 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 "\n"; print " \n"; @@ -797,7 +797,7 @@ function import_page_blocks($blocks) { $i = 1; print " \n"; print "
\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 "
\n"; - theme("footer"); + print theme("footer"); } function import_page() { diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index fd932f3cbc1..c44dbd5fcfc 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -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 = "
"; @@ -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 = "
"; - $output .= theme("theme_item_list", $items); + $output .= theme("item_list", $items); $output .= "
"; return $output; @@ -656,10 +656,10 @@ function import_page_last() { } $output .= "\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 .= "\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 .= "\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 .= "
". l("", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."

"; - 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 "\n"; print " \n"; @@ -797,7 +797,7 @@ function import_page_blocks($blocks) { $i = 1; print " \n"; print "
\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 "
\n"; - theme("footer"); + print theme("footer"); } function import_page() { diff --git a/modules/archive.module b/modules/archive.module index a8a5e0cb8ce..0677b17660b 100644 --- a/modules/archive.module +++ b/modules/archive.module @@ -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 = "
"; $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 .= "
"; - 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() { diff --git a/modules/archive/archive.module b/modules/archive/archive.module index a8a5e0cb8ce..0677b17660b 100644 --- a/modules/archive/archive.module +++ b/modules/archive/archive.module @@ -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 = "
"; $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 .= "
"; - 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() { diff --git a/modules/blog.module b/modules/blog.module index c8aa80a438b..9acaf7bb0ff 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -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) { diff --git a/modules/blog/blog.module b/modules/blog/blog.module index c8aa80a438b..9acaf7bb0ff 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -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) { diff --git a/modules/book.module b/modules/book.module index ec855509555..5b94c60fe35 100644 --- a/modules/book.module +++ b/modules/book.module @@ -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"); } } diff --git a/modules/book/book.module b/modules/book/book.module index ec855509555..5b94c60fe35 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -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"); } } diff --git a/modules/cloud.module b/modules/cloud.module index b606280175c..0983dc84e40 100644 --- a/modules/cloud.module +++ b/modules/cloud.module @@ -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"); } } diff --git a/modules/comment.module b/modules/comment.module index 14c57ae5b37..d6bc2457f48 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -242,17 +242,17 @@ function comment_reply($pid, $nid) { */ if (node_comment_mode($nid) != 2) { - theme("box", t("Reply"), t("This discussion is closed: you can't post new comments.")); + print theme("box", t("Reply"), t("This discussion is closed: you can't post new comments.")); } else if (user_access("post comments")) { - theme("box", t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid))); + print theme("box", t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid))); } else { - theme("box", t("Reply"), t("You are not authorized to post comments.")); + print 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.")); + print theme("box", t("Reply"), t("You are not authorized to view comments.")); } } @@ -277,7 +277,7 @@ function comment_preview($edit) { comment_view($comment, t("reply to this comment")); - theme("box", t("Reply"), comment_form($edit)); + print 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 INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0", $edit["pid"])); @@ -528,7 +528,7 @@ function comment_links($comment, $return = 1) { } } - if ($moderation = comment_moderation_form($comment)) { + if ($moderation = theme("comment_moderation_form", $comment)) { $links[] = $moderation; } @@ -550,10 +550,10 @@ function comment_view($comment, $links = "", $visible = 1) { if ($visible) { $comment->comment = check_output($comment->comment); - theme("comment", $comment, $links); + print theme("comment", $comment, $links); } else { - theme("comment_folded", $comment); + print theme("comment_folded", $comment); } } @@ -722,7 +722,7 @@ function comment_render($node, $cid = 0) { if (db_num_rows($result) && (variable_get("comment_controls", 0) == 0 || variable_get("comment_controls", 0) == 2)) { print "
\n"; - theme("comment_controls", $threshold, $mode, $order, $comments_per_page); + print theme("comment_controls", $threshold, $mode, $order, $comments_per_page); print form_hidden("nid", $nid); print "
"; } @@ -734,16 +734,16 @@ function comment_render($node, $cid = 0) { $comment->depth = count(explode(".", $comment->thread)) - 1; if ($mode == 1) { - theme("comment_flat_collapsed", $comment, $threshold_min); + print theme("comment_flat_collapsed", $comment, $threshold_min); } else if ($mode == 2) { - theme("comment_flat_expanded", $comment, $threshold_min); + print theme("comment_flat_expanded", $comment, $threshold_min); } else if ($mode == 3) { - theme("comment_thread_min", $comment, $threshold_min); + print theme("comment_thread_min", $comment, $threshold_min); } else if ($mode == 4) { - theme("comment_thread_max", $comment, $threshold_min); + print theme("comment_thread_max", $comment, $threshold_min); } } @@ -763,7 +763,7 @@ function comment_render($node, $cid = 0) { if (db_num_rows($result) && (variable_get("comment_controls", 0) == 1 || variable_get("comment_controls", 0) == 2)) { print "
\n"; - theme("comment_controls", $threshold, $mode, $order, $comments_per_page); + print theme("comment_controls", $threshold, $mode, $order, $comments_per_page); print form_hidden("nid", $nid); print "
"; } @@ -774,7 +774,7 @@ function comment_render($node, $cid = 0) { */ if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_form_location", 0)) { - theme("box", t("Post new comment"), comment_form(array("nid" => $nid))); + print theme("box", t("Post new comment"), comment_form(array("nid" => $nid))); } /* @@ -874,9 +874,9 @@ function comment_page() { switch ($op) { case "edit": - theme("header"); + print theme("header"); comment_edit(check_query(arg(2))); - theme("footer"); + print theme("footer"); break; case t("Moderate comments"): case t("Moderate comment"): @@ -884,21 +884,21 @@ function comment_page() { drupal_goto(url(comment_referer_load())); break; case "reply": - theme("header"); + print theme("header"); comment_reply(check_query(arg(3)), check_query(arg(2))); - theme("footer"); + print theme("footer"); break; case t("Preview comment"): - theme("header"); + print theme("header"); comment_preview($edit); - theme("footer"); + print 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"); + print theme("header"); + print theme("box", $error_title, $error_body); + print theme("footer"); } else { drupal_goto(url(comment_referer_load())); @@ -1005,7 +1005,7 @@ function comment_admin_overview($status = 0) { $result = pager_query($sql, 50); while ($comment = db_fetch_object($result)) { - $rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme_mark() : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."". format_date($comment->timestamp, "small") ."". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid")); + $rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("mark") : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."". format_date($comment->timestamp, "small") ."". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid")); } if ($pager = pager_display(NULL, 50, 0, "admin", tablesort_pager())) { @@ -1264,7 +1264,7 @@ function comment_admin() { ** overridden by themes. */ -function comment_mode_form($mode) { +function theme_comment_mode_form($mode) { $modes = _comment_get_modes(); foreach ($modes as $key => $value) { @@ -1274,7 +1274,7 @@ function comment_mode_form($mode) { return "\n"; } -function comment_order_form($order) { +function theme_comment_order_form($order) { $orders = _comment_get_orders(); foreach ($orders as $key=>$value) { @@ -1284,14 +1284,14 @@ function comment_order_form($order) { return "\n"; } -function comment_per_page_form($comments_per_page) { +function theme_comment_per_page_form($comments_per_page) { for ($i = 10; $i < 100; $i = $i + 20) { $options .= " "; } return "\n"; } -function comment_threshold($threshold) { +function theme_comment_threshold($threshold) { $result = db_query("SELECT fid, filter FROM {moderation_filters} "); $options .= " "; while ($filter = db_fetch_object($result)) { @@ -1302,14 +1302,14 @@ function comment_threshold($threshold) { } } -function comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_page = 50) { +function theme_comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_page = 50) { static $output; if (!$output) { - $output .= comment_mode_form($mode); - $output .= comment_order_form($order); - $output .= comment_per_page_form($comments_per_page); - $output .= comment_threshold($threshold); + $output .= theme("comment_mode_form", $mode); + $output .= theme("comment_order_form", $order); + $output .= theme("comment_per_page_form", $comments_per_page); + $output .= theme("comment_threshold", $threshold); $output .= " ". form_submit(t("Save settings")); @@ -1319,7 +1319,7 @@ function comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_p return theme("box", t("Comment viewing options"), $output); } -function comment_moderation_form($comment) { +function theme_comment_moderation_form($comment) { global $comment_votes, $user, $node; static $votes; @@ -1360,9 +1360,9 @@ function comment_moderation_form($comment) { return $output; } -function comment($comment, $links = 0) { +function theme_comment($comment, $links = 0) { $output .= "
"; - $output .= "
$comment->subject". ($comment->new ? " ". theme("theme_mark") : "") ."
"; + $output .= "
$comment->subject". ($comment->new ? " ". theme("mark") : "") ."
"; $output .= "
". $comment->moderation ."
"; $output .= "
". t("by %a on %b", array("%a" => format_name($comment), "%b" => format_date($comment->timestamp))) ."
"; $output .= "
". check_output($comment->comment) ."
"; @@ -1371,21 +1371,21 @@ function comment($comment, $links = 0) { print $output; } -function comment_folded($comment) { +function theme_comment_folded($comment) { print "
". l($comment->subject, comment_referer_load() ."/$comment->cid#$comment->cid") ." ". t("by") ." ". format_name($comment) ."
"; } -function comment_flat_collapsed($comment, $threshold) { +function theme_comment_flat_collapsed($comment, $threshold) { if (comment_visible($comment, $threshold)) { print comment_view($comment, "", 0); } } -function comment_flat_expanded($comment, $threshold) { +function theme_comment_flat_expanded($comment, $threshold) { comment_view($comment, comment_links($comment, 0), comment_visible($comment, $threshold)); } -function comment_thread_min($comment, $threshold, $pid = 0) { +function theme_comment_thread_min($comment, $threshold, $pid = 0) { if (comment_visible($comment, $threshold)) { print "
depth * 25) ."\">
\n"; print comment_view($comment, "", 0); @@ -1394,7 +1394,7 @@ function comment_thread_min($comment, $threshold, $pid = 0) { } } -function comment_thread_max($comment, $threshold, $level = 0) { +function theme_comment_thread_max($comment, $threshold, $level = 0) { /* ** We had quite a few browser specific issues: expanded comments below ** the top level got truncated on the right hand side. A range of @@ -1415,7 +1415,7 @@ function comment_thread_max($comment, $threshold, $level = 0) { } } -function comment_post_forbidden() { +function theme_comment_post_forbidden() { global $user; if ($user->uid) { return t("You can't post comments."); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 14c57ae5b37..d6bc2457f48 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -242,17 +242,17 @@ function comment_reply($pid, $nid) { */ if (node_comment_mode($nid) != 2) { - theme("box", t("Reply"), t("This discussion is closed: you can't post new comments.")); + print theme("box", t("Reply"), t("This discussion is closed: you can't post new comments.")); } else if (user_access("post comments")) { - theme("box", t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid))); + print theme("box", t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid))); } else { - theme("box", t("Reply"), t("You are not authorized to post comments.")); + print 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.")); + print theme("box", t("Reply"), t("You are not authorized to view comments.")); } } @@ -277,7 +277,7 @@ function comment_preview($edit) { comment_view($comment, t("reply to this comment")); - theme("box", t("Reply"), comment_form($edit)); + print 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 INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0", $edit["pid"])); @@ -528,7 +528,7 @@ function comment_links($comment, $return = 1) { } } - if ($moderation = comment_moderation_form($comment)) { + if ($moderation = theme("comment_moderation_form", $comment)) { $links[] = $moderation; } @@ -550,10 +550,10 @@ function comment_view($comment, $links = "", $visible = 1) { if ($visible) { $comment->comment = check_output($comment->comment); - theme("comment", $comment, $links); + print theme("comment", $comment, $links); } else { - theme("comment_folded", $comment); + print theme("comment_folded", $comment); } } @@ -722,7 +722,7 @@ function comment_render($node, $cid = 0) { if (db_num_rows($result) && (variable_get("comment_controls", 0) == 0 || variable_get("comment_controls", 0) == 2)) { print "
\n"; - theme("comment_controls", $threshold, $mode, $order, $comments_per_page); + print theme("comment_controls", $threshold, $mode, $order, $comments_per_page); print form_hidden("nid", $nid); print "
"; } @@ -734,16 +734,16 @@ function comment_render($node, $cid = 0) { $comment->depth = count(explode(".", $comment->thread)) - 1; if ($mode == 1) { - theme("comment_flat_collapsed", $comment, $threshold_min); + print theme("comment_flat_collapsed", $comment, $threshold_min); } else if ($mode == 2) { - theme("comment_flat_expanded", $comment, $threshold_min); + print theme("comment_flat_expanded", $comment, $threshold_min); } else if ($mode == 3) { - theme("comment_thread_min", $comment, $threshold_min); + print theme("comment_thread_min", $comment, $threshold_min); } else if ($mode == 4) { - theme("comment_thread_max", $comment, $threshold_min); + print theme("comment_thread_max", $comment, $threshold_min); } } @@ -763,7 +763,7 @@ function comment_render($node, $cid = 0) { if (db_num_rows($result) && (variable_get("comment_controls", 0) == 1 || variable_get("comment_controls", 0) == 2)) { print "
\n"; - theme("comment_controls", $threshold, $mode, $order, $comments_per_page); + print theme("comment_controls", $threshold, $mode, $order, $comments_per_page); print form_hidden("nid", $nid); print "
"; } @@ -774,7 +774,7 @@ function comment_render($node, $cid = 0) { */ if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_form_location", 0)) { - theme("box", t("Post new comment"), comment_form(array("nid" => $nid))); + print theme("box", t("Post new comment"), comment_form(array("nid" => $nid))); } /* @@ -874,9 +874,9 @@ function comment_page() { switch ($op) { case "edit": - theme("header"); + print theme("header"); comment_edit(check_query(arg(2))); - theme("footer"); + print theme("footer"); break; case t("Moderate comments"): case t("Moderate comment"): @@ -884,21 +884,21 @@ function comment_page() { drupal_goto(url(comment_referer_load())); break; case "reply": - theme("header"); + print theme("header"); comment_reply(check_query(arg(3)), check_query(arg(2))); - theme("footer"); + print theme("footer"); break; case t("Preview comment"): - theme("header"); + print theme("header"); comment_preview($edit); - theme("footer"); + print 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"); + print theme("header"); + print theme("box", $error_title, $error_body); + print theme("footer"); } else { drupal_goto(url(comment_referer_load())); @@ -1005,7 +1005,7 @@ function comment_admin_overview($status = 0) { $result = pager_query($sql, 50); while ($comment = db_fetch_object($result)) { - $rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme_mark() : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."
". format_date($comment->timestamp, "small") ."". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid")); + $rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("mark") : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."". format_date($comment->timestamp, "small") ."". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid")); } if ($pager = pager_display(NULL, 50, 0, "admin", tablesort_pager())) { @@ -1264,7 +1264,7 @@ function comment_admin() { ** overridden by themes. */ -function comment_mode_form($mode) { +function theme_comment_mode_form($mode) { $modes = _comment_get_modes(); foreach ($modes as $key => $value) { @@ -1274,7 +1274,7 @@ function comment_mode_form($mode) { return "\n"; } -function comment_order_form($order) { +function theme_comment_order_form($order) { $orders = _comment_get_orders(); foreach ($orders as $key=>$value) { @@ -1284,14 +1284,14 @@ function comment_order_form($order) { return "\n"; } -function comment_per_page_form($comments_per_page) { +function theme_comment_per_page_form($comments_per_page) { for ($i = 10; $i < 100; $i = $i + 20) { $options .= " "; } return "\n"; } -function comment_threshold($threshold) { +function theme_comment_threshold($threshold) { $result = db_query("SELECT fid, filter FROM {moderation_filters} "); $options .= " "; while ($filter = db_fetch_object($result)) { @@ -1302,14 +1302,14 @@ function comment_threshold($threshold) { } } -function comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_page = 50) { +function theme_comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_page = 50) { static $output; if (!$output) { - $output .= comment_mode_form($mode); - $output .= comment_order_form($order); - $output .= comment_per_page_form($comments_per_page); - $output .= comment_threshold($threshold); + $output .= theme("comment_mode_form", $mode); + $output .= theme("comment_order_form", $order); + $output .= theme("comment_per_page_form", $comments_per_page); + $output .= theme("comment_threshold", $threshold); $output .= " ". form_submit(t("Save settings")); @@ -1319,7 +1319,7 @@ function comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_p return theme("box", t("Comment viewing options"), $output); } -function comment_moderation_form($comment) { +function theme_comment_moderation_form($comment) { global $comment_votes, $user, $node; static $votes; @@ -1360,9 +1360,9 @@ function comment_moderation_form($comment) { return $output; } -function comment($comment, $links = 0) { +function theme_comment($comment, $links = 0) { $output .= "
"; - $output .= "
$comment->subject". ($comment->new ? " ". theme("theme_mark") : "") ."
"; + $output .= "
$comment->subject". ($comment->new ? " ". theme("mark") : "") ."
"; $output .= "
". $comment->moderation ."
"; $output .= "
". t("by %a on %b", array("%a" => format_name($comment), "%b" => format_date($comment->timestamp))) ."
"; $output .= "
". check_output($comment->comment) ."
"; @@ -1371,21 +1371,21 @@ function comment($comment, $links = 0) { print $output; } -function comment_folded($comment) { +function theme_comment_folded($comment) { print "
". l($comment->subject, comment_referer_load() ."/$comment->cid#$comment->cid") ." ". t("by") ." ". format_name($comment) ."
"; } -function comment_flat_collapsed($comment, $threshold) { +function theme_comment_flat_collapsed($comment, $threshold) { if (comment_visible($comment, $threshold)) { print comment_view($comment, "", 0); } } -function comment_flat_expanded($comment, $threshold) { +function theme_comment_flat_expanded($comment, $threshold) { comment_view($comment, comment_links($comment, 0), comment_visible($comment, $threshold)); } -function comment_thread_min($comment, $threshold, $pid = 0) { +function theme_comment_thread_min($comment, $threshold, $pid = 0) { if (comment_visible($comment, $threshold)) { print "
depth * 25) ."\">
\n"; print comment_view($comment, "", 0); @@ -1394,7 +1394,7 @@ function comment_thread_min($comment, $threshold, $pid = 0) { } } -function comment_thread_max($comment, $threshold, $level = 0) { +function theme_comment_thread_max($comment, $threshold, $level = 0) { /* ** We had quite a few browser specific issues: expanded comments below ** the top level got truncated on the right hand side. A range of @@ -1415,7 +1415,7 @@ function comment_thread_max($comment, $threshold, $level = 0) { } } -function comment_post_forbidden() { +function theme_comment_post_forbidden() { global $user; if ($user->uid) { return t("You can't post comments."); diff --git a/modules/drupal.module b/modules/drupal.module index 888253a1f09..a2621e59dd4 100644 --- a/modules/drupal.module +++ b/modules/drupal.module @@ -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) { diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module index 888253a1f09..a2621e59dd4 100644 --- a/modules/drupal/drupal.module +++ b/modules/drupal/drupal.module @@ -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) { diff --git a/modules/forum.module b/modules/forum.module index 63755b56ee9..e305d025cd6 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -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. + @{ +**/ + +/** + Controls the output of the forum body. + + @param forums + @param topics + @param parents + @param tid + @param sortby + @param forum_per_page + @param offset + + @return string the output for the forum body. +**/ +function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset) { // forum list, topics list, topic browser and "add new topic" link $title = t("Forums"); @@ -480,10 +496,10 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p if (count($forums) || count($parents)) { $output = "
"; - $output .= theme("forum_theme_list", $forums, $parents, $tid); + $output .= theme("forum_list", $forums, $parents, $tid); if ($tid && !in_array($tid, variable_get("forum_containers", array()))) { - $output .= theme("forum_theme_topic_list", $tid, $topics, $sortby, $forum_per_page, $offset); + $output .= theme("forum_topic_list", $tid, $topics, $sortby, $forum_per_page, $offset); } $output .= "
"; } @@ -492,13 +508,22 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p $output = ''; } - theme("header", $title); - theme("breadcrumb", $breadcrumb); - theme("box", $title, $output); - theme("footer"); + print theme("header", $title); + print theme("breadcrumb", $breadcrumb); + print theme("box", $title, $output); + print theme("footer"); } -function forum_theme_list($forums, $parents, $tid) { +/** + Outputs the forum listing. + + @param forums + @param parents + @param tid + + @return string the output for the forum listing. +**/ +function theme_forum_list($forums, $parents, $tid) { global $user; if ($forums) { @@ -552,8 +577,18 @@ function forum_theme_list($forums, $parents, $tid) { return table($header, $rows); } +/** + Outputs the topic listing. -function forum_theme_topic_list($tid, $topics, $sortby, $forum_per_page, $offset) { + @param tid + @param topics + @param sortby + @param forum_per_page + @param offset + + @return string the output for the topic list. +**/ +function theme_forum_topic_list($tid, $topics, $sortby, $forum_per_page, $offset) { global $id, $status, $user, $pager_total, $forum_topic_list_header; if ($topics) { @@ -593,6 +628,8 @@ function forum_theme_topic_list($tid, $topics, $sortby, $forum_per_page, $offset return $output; } +/** @} End of addtogroup theme_system **/ + function _forum_icon($new_posts, $num_posts = 0, $comment_mode = 0) { $base_path = variable_get("forum_icon_path", ""); diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 63755b56ee9..e305d025cd6 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -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. + @{ +**/ + +/** + Controls the output of the forum body. + + @param forums + @param topics + @param parents + @param tid + @param sortby + @param forum_per_page + @param offset + + @return string the output for the forum body. +**/ +function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset) { // forum list, topics list, topic browser and "add new topic" link $title = t("Forums"); @@ -480,10 +496,10 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p if (count($forums) || count($parents)) { $output = "
"; - $output .= theme("forum_theme_list", $forums, $parents, $tid); + $output .= theme("forum_list", $forums, $parents, $tid); if ($tid && !in_array($tid, variable_get("forum_containers", array()))) { - $output .= theme("forum_theme_topic_list", $tid, $topics, $sortby, $forum_per_page, $offset); + $output .= theme("forum_topic_list", $tid, $topics, $sortby, $forum_per_page, $offset); } $output .= "
"; } @@ -492,13 +508,22 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p $output = ''; } - theme("header", $title); - theme("breadcrumb", $breadcrumb); - theme("box", $title, $output); - theme("footer"); + print theme("header", $title); + print theme("breadcrumb", $breadcrumb); + print theme("box", $title, $output); + print theme("footer"); } -function forum_theme_list($forums, $parents, $tid) { +/** + Outputs the forum listing. + + @param forums + @param parents + @param tid + + @return string the output for the forum listing. +**/ +function theme_forum_list($forums, $parents, $tid) { global $user; if ($forums) { @@ -552,8 +577,18 @@ function forum_theme_list($forums, $parents, $tid) { return table($header, $rows); } +/** + Outputs the topic listing. -function forum_theme_topic_list($tid, $topics, $sortby, $forum_per_page, $offset) { + @param tid + @param topics + @param sortby + @param forum_per_page + @param offset + + @return string the output for the topic list. +**/ +function theme_forum_topic_list($tid, $topics, $sortby, $forum_per_page, $offset) { global $id, $status, $user, $pager_total, $forum_topic_list_header; if ($topics) { @@ -593,6 +628,8 @@ function forum_theme_topic_list($tid, $topics, $sortby, $forum_per_page, $offset return $output; } +/** @} End of addtogroup theme_system **/ + function _forum_icon($new_posts, $num_posts = 0, $comment_mode = 0) { $base_path = variable_get("forum_icon_path", ""); diff --git a/modules/import.module b/modules/import.module index fd932f3cbc1..c44dbd5fcfc 100644 --- a/modules/import.module +++ b/modules/import.module @@ -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 = "
"; @@ -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 = "
"; - $output .= theme("theme_item_list", $items); + $output .= theme("item_list", $items); $output .= "
"; return $output; @@ -656,10 +656,10 @@ function import_page_last() { } $output .= "
\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 .= "
\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 .= "\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 .= "
". l("", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."

"; - 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 "\n"; print " \n"; @@ -797,7 +797,7 @@ function import_page_blocks($blocks) { $i = 1; print " \n"; print "
\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 "
\n"; - theme("footer"); + print theme("footer"); } function import_page() { diff --git a/modules/jabber.module b/modules/jabber.module index 67b6d483aca..19aaa2fbc13 100644 --- a/modules/jabber.module +++ b/modules/jabber.module @@ -162,9 +162,9 @@ function jabber_auth($username, $password, $server) { function jabber_page() { - theme("header"); - theme("box", "Jabber", jabber_help("user/help#jabber")); - theme("footer"); + print theme("header"); + print theme("box", "Jabber", jabber_help("user/help#jabber")); + print theme("footer"); } function jabber_user($type, $edit, $user) { diff --git a/modules/node.module b/modules/node.module index 847d83682e2..5ac010d76f7 100644 --- a/modules/node.module +++ b/modules/node.module @@ -73,11 +73,11 @@ function node_title_list($result, $title = NULL) { $items[] = l($node->title, "node/view/$node->nid", array("title" => format_plural($number, "%count comment", "%count comments"))); } - return theme("theme_node_list", $items, $title); + return theme("node_list", $items, $title); } function theme_node_list($items, $title = NULL) { - return theme("theme_item_list", $items, $title); + return theme("item_list", $items, $title); } // Update the 'last viewed' timestamp of the specified node for current user. @@ -407,7 +407,7 @@ function node_view($node, $main = 0) { $node->teaser = check_output($node->teaser); $node->body = check_output($node->body); - theme("node", $node, $main); + print theme("node", $node, $main); } } @@ -991,7 +991,7 @@ function node_validate($node, &$error) { if (isset($node->title)) { $node->title = strip_tags($node->title); if (!$node->title) { - $error["title"] = theme("theme_error", t("You have to specify a valid title.")); + $error["title"] = theme("error", t("You have to specify a valid title.")); } } @@ -1041,7 +1041,7 @@ function node_validate($node, &$error) { $node->uid = $account->uid; } else { - $error["name"] = theme("theme_error", t("The name '%u' does not exist.", array ("%u" => $node->name))); + $error["name"] = theme("error", t("The name '%u' does not exist.", array ("%u" => $node->name))); } /* @@ -1052,7 +1052,7 @@ function node_validate($node, &$error) { $node->created = strtotime($node->date); } else { - $error["date"] = theme("theme_error", t("You have to specifiy a valid date.")); + $error["date"] = theme("error", t("You have to specifiy a valid date.")); } } else { @@ -1482,29 +1482,29 @@ function node_page() { $node = node_load(array("nid" => arg(2), "status" => 1), $_GET["revision"]); } - theme("header", $node->title); + print theme("header", $node->title); $name = module_invoke(arg(2), "node", "name"); switch ($op) { case "add": - theme("box", t("Submit %name", array("%name" => $name)), node_add(arg(2))); + print theme("box", t("Submit %name", array("%name" => $name)), node_add(arg(2))); break; case "edit": - theme("box", t("Edit %name", array("%name" => $name)), node_edit(arg(2))); + print theme("box", t("Edit %name", array("%name" => $name)), node_edit(arg(2))); break; case "view": print node_show($node, arg(3)); break; case t("Preview"): $edit = node_validate($edit, $error); - theme("box", t("Preview %name", array("%name" => $name)), node_preview($edit, $error)); + print theme("box", t("Preview %name", array("%name" => $name)), node_preview($edit, $error)); break; case t("Submit"): - theme("box", t("Submit %name", array("%name" => $name)), node_submit($edit)); + print theme("box", t("Submit %name", array("%name" => $name)), node_submit($edit)); break; case t("Delete"): - theme("box", t("Delete %name", array("%name" => $name)), node_delete($edit)); + print theme("box", t("Delete %name", array("%name" => $name)), 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)); @@ -1515,12 +1515,12 @@ function node_page() { print pager_display(NULL, variable_get("default_nodes_main", 10)); } - 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"); } } diff --git a/modules/node/node.module b/modules/node/node.module index 847d83682e2..5ac010d76f7 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -73,11 +73,11 @@ function node_title_list($result, $title = NULL) { $items[] = l($node->title, "node/view/$node->nid", array("title" => format_plural($number, "%count comment", "%count comments"))); } - return theme("theme_node_list", $items, $title); + return theme("node_list", $items, $title); } function theme_node_list($items, $title = NULL) { - return theme("theme_item_list", $items, $title); + return theme("item_list", $items, $title); } // Update the 'last viewed' timestamp of the specified node for current user. @@ -407,7 +407,7 @@ function node_view($node, $main = 0) { $node->teaser = check_output($node->teaser); $node->body = check_output($node->body); - theme("node", $node, $main); + print theme("node", $node, $main); } } @@ -991,7 +991,7 @@ function node_validate($node, &$error) { if (isset($node->title)) { $node->title = strip_tags($node->title); if (!$node->title) { - $error["title"] = theme("theme_error", t("You have to specify a valid title.")); + $error["title"] = theme("error", t("You have to specify a valid title.")); } } @@ -1041,7 +1041,7 @@ function node_validate($node, &$error) { $node->uid = $account->uid; } else { - $error["name"] = theme("theme_error", t("The name '%u' does not exist.", array ("%u" => $node->name))); + $error["name"] = theme("error", t("The name '%u' does not exist.", array ("%u" => $node->name))); } /* @@ -1052,7 +1052,7 @@ function node_validate($node, &$error) { $node->created = strtotime($node->date); } else { - $error["date"] = theme("theme_error", t("You have to specifiy a valid date.")); + $error["date"] = theme("error", t("You have to specifiy a valid date.")); } } else { @@ -1482,29 +1482,29 @@ function node_page() { $node = node_load(array("nid" => arg(2), "status" => 1), $_GET["revision"]); } - theme("header", $node->title); + print theme("header", $node->title); $name = module_invoke(arg(2), "node", "name"); switch ($op) { case "add": - theme("box", t("Submit %name", array("%name" => $name)), node_add(arg(2))); + print theme("box", t("Submit %name", array("%name" => $name)), node_add(arg(2))); break; case "edit": - theme("box", t("Edit %name", array("%name" => $name)), node_edit(arg(2))); + print theme("box", t("Edit %name", array("%name" => $name)), node_edit(arg(2))); break; case "view": print node_show($node, arg(3)); break; case t("Preview"): $edit = node_validate($edit, $error); - theme("box", t("Preview %name", array("%name" => $name)), node_preview($edit, $error)); + print theme("box", t("Preview %name", array("%name" => $name)), node_preview($edit, $error)); break; case t("Submit"): - theme("box", t("Submit %name", array("%name" => $name)), node_submit($edit)); + print theme("box", t("Submit %name", array("%name" => $name)), node_submit($edit)); break; case t("Delete"): - theme("box", t("Delete %name", array("%name" => $name)), node_delete($edit)); + print theme("box", t("Delete %name", array("%name" => $name)), 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)); @@ -1515,12 +1515,12 @@ function node_page() { print pager_display(NULL, variable_get("default_nodes_main", 10)); } - 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"); } } diff --git a/modules/page.module b/modules/page.module index ff6e8c2e110..aa75896e384 100644 --- a/modules/page.module +++ b/modules/page.module @@ -121,7 +121,7 @@ function page_view($node, $main) { // prepair the node content $node = page_content($node); // print the node - theme("node", $node, $main); + print theme("node", $node, $main); } function page_form(&$node, &$help, &$error) { diff --git a/modules/page/page.module b/modules/page/page.module index ff6e8c2e110..aa75896e384 100644 --- a/modules/page/page.module +++ b/modules/page/page.module @@ -121,7 +121,7 @@ function page_view($node, $main) { // prepair the node content $node = page_content($node); // print the node - theme("node", $node, $main); + print theme("node", $node, $main); } function page_form(&$node, &$help, &$error) { diff --git a/modules/path.module b/modules/path.module index 5ab2ebea54f..7b88f77aa80 100644 --- a/modules/path.module +++ b/modules/path.module @@ -84,7 +84,7 @@ function path_form($edit = "", $error = "") { if ($error) { foreach ($error as $message) { - $form .= theme("theme_error", $message); + $form .= theme("error", $message); } } diff --git a/modules/path/path.module b/modules/path/path.module index 5ab2ebea54f..7b88f77aa80 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -84,7 +84,7 @@ function path_form($edit = "", $error = "") { if ($error) { foreach ($error as $message) { - $form .= theme("theme_error", $message); + $form .= theme("error", $message); } } diff --git a/modules/poll.module b/modules/poll.module index b4bd980ced8..e2b7085e9af 100644 --- a/modules/poll.module +++ b/modules/poll.module @@ -87,12 +87,12 @@ function poll_validate(&$node) { } if ($node->chvotes[$i] < 0) { - $error["chvotes][$i"] = theme("theme_error", t("Negative values are not allowed.")); + $error["chvotes][$i"] = theme("error", t("Negative values are not allowed.")); } } if ($actualchoices < 2) { - $error["choice][0"] = theme("theme_error", t("You must fill in at least two choices.")); + $error["choice][0"] = theme("error", t("You must fill in at least two choices.")); } } @@ -247,15 +247,15 @@ function poll_node($field) { function poll_page() { - theme("header"); + print theme("header"); $result = db_query("SELECT n.nid, n.title, p.active, SUM(c.chvotes) AS votes FROM {node} n INNER JOIN {poll} p ON n.nid=p.nid INNER 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 = "
    "; while ($node = db_fetch_object($result)) { $output .= "
  • ".l($node->title, "node/view/$node->nid") ." - ". format_plural($node->votes, "1 vote", "%count votes") ." - ". ($node->active ? t("open") : t("closed")) ."
  • "; } $output .= "
"; - theme("box", t("Polls"), $output); - theme("footer"); + print theme("box", t("Polls"), $output); + print theme("footer"); } function poll_perm() { @@ -383,7 +383,7 @@ function poll_view(&$node, $main = 0, $block = 0) { // We also use poll_view() for the side-block if (!$block) { - theme("node", $node, $main); + print theme("node", $node, $main); } } diff --git a/modules/poll/poll.module b/modules/poll/poll.module index b4bd980ced8..e2b7085e9af 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -87,12 +87,12 @@ function poll_validate(&$node) { } if ($node->chvotes[$i] < 0) { - $error["chvotes][$i"] = theme("theme_error", t("Negative values are not allowed.")); + $error["chvotes][$i"] = theme("error", t("Negative values are not allowed.")); } } if ($actualchoices < 2) { - $error["choice][0"] = theme("theme_error", t("You must fill in at least two choices.")); + $error["choice][0"] = theme("error", t("You must fill in at least two choices.")); } } @@ -247,15 +247,15 @@ function poll_node($field) { function poll_page() { - theme("header"); + print theme("header"); $result = db_query("SELECT n.nid, n.title, p.active, SUM(c.chvotes) AS votes FROM {node} n INNER JOIN {poll} p ON n.nid=p.nid INNER 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 = "
    "; while ($node = db_fetch_object($result)) { $output .= "
  • ".l($node->title, "node/view/$node->nid") ." - ". format_plural($node->votes, "1 vote", "%count votes") ." - ". ($node->active ? t("open") : t("closed")) ."
  • "; } $output .= "
"; - theme("box", t("Polls"), $output); - theme("footer"); + print theme("box", t("Polls"), $output); + print theme("footer"); } function poll_perm() { @@ -383,7 +383,7 @@ function poll_view(&$node, $main = 0, $block = 0) { // We also use poll_view() for the side-block if (!$block) { - theme("node", $node, $main); + print theme("node", $node, $main); } } diff --git a/modules/profile.module b/modules/profile.module index 74de3729a0f..7325569c43e 100644 --- a/modules/profile.module +++ b/modules/profile.module @@ -111,7 +111,7 @@ function profile_user($type, $edit, &$user) { function profile_required($title) { // this pleads "theme, theme" ;) - return $title ." ". theme("theme_mark"); + return $title ." ". theme("mark"); } function _profile_form($edit, $mode) { diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 74de3729a0f..7325569c43e 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -111,7 +111,7 @@ function profile_user($type, $edit, &$user) { function profile_required($title) { // this pleads "theme, theme" ;) - return $title ." ". theme("theme_mark"); + return $title ." ". theme("mark"); } function _profile_form($edit, $mode) { diff --git a/modules/queue.module b/modules/queue.module index 92f2decb168..5de10711adb 100644 --- a/modules/queue.module +++ b/modules/queue.module @@ -116,9 +116,9 @@ function queue_overview() { } $output .= ""; - theme("header"); - theme("box", t("Moderation queue"), $output); - theme("footer"); + print theme("header"); + print theme("box", t("Moderation queue"), $output); + print theme("footer"); } function queue_view($nid) { @@ -168,15 +168,15 @@ function queue_view($nid) { } } - theme("header"); + print theme("header"); node_view($node); if ($output) { - theme("box", t("Moderate"), $output); + print theme("box", t("Moderate"), $output); } if ($node->comment && variable_get("queue_show_comments", 1)) { module_invoke("comment", "render", $node); } - theme("footer"); + print theme("footer"); } function queue_page() { @@ -191,9 +191,9 @@ function queue_page() { } } else { - theme("header"); - theme("box", t("Moderation queue"), message_access()); - theme("footer"); + print theme("header"); + print theme("box", t("Moderation queue"), message_access()); + print theme("footer"); } } diff --git a/modules/search.module b/modules/search.module index 447c5a3c0d0..6d9b1e842f9 100644 --- a/modules/search.module +++ b/modules/search.module @@ -362,27 +362,27 @@ function search_view($keys) { $form .= "
". $help_link; } - theme("header", t("Search")); + print theme("header", t("Search")); if ($form) { - theme("box", t("Search"), $form); + print theme("box", t("Search"), $form); } if ($keys) { if ($output) { - theme("box", t("Search Results"), $output); + print theme("box", t("Search Results"), $output); } else { - theme("box", t("Search Results"), t("Your search yielded no results.")); + print theme("box", t("Search Results"), t("Your search yielded no results.")); } } - theme("footer"); + print theme("footer"); } else { - theme("header", t("Access denied")); - theme("box", t("Access denied"), message_access()); - theme("footer"); + print theme("header", t("Access denied")); + print theme("box", t("Access denied"), message_access()); + print theme("footer"); } } @@ -392,9 +392,9 @@ function search_page() { switch (arg(1)) { case "help": - theme("header"); - theme("box", t("Search Help"), search_help()); - theme("footer"); + print theme("header"); + print theme("box", t("Search Help"), search_help()); + print theme("footer"); break; default: search_view($keys); diff --git a/modules/search/search.module b/modules/search/search.module index 447c5a3c0d0..6d9b1e842f9 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -362,27 +362,27 @@ function search_view($keys) { $form .= "
". $help_link; } - theme("header", t("Search")); + print theme("header", t("Search")); if ($form) { - theme("box", t("Search"), $form); + print theme("box", t("Search"), $form); } if ($keys) { if ($output) { - theme("box", t("Search Results"), $output); + print theme("box", t("Search Results"), $output); } else { - theme("box", t("Search Results"), t("Your search yielded no results.")); + print theme("box", t("Search Results"), t("Your search yielded no results.")); } } - theme("footer"); + print theme("footer"); } else { - theme("header", t("Access denied")); - theme("box", t("Access denied"), message_access()); - theme("footer"); + print theme("header", t("Access denied")); + print theme("box", t("Access denied"), message_access()); + print theme("footer"); } } @@ -392,9 +392,9 @@ function search_page() { switch (arg(1)) { case "help": - theme("header"); - theme("box", t("Search Help"), search_help()); - theme("footer"); + print theme("header"); + print theme("box", t("Search Help"), search_help()); + print theme("footer"); break; default: search_view($keys); diff --git a/modules/statistics.module b/modules/statistics.module index b2c6416360f..645e25541c5 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -692,7 +692,7 @@ function statistics_display_online_block() { if ($items) { $output .= "

"; - $output .= theme("theme_item_list", $items, variable_get("statistics_block_online_subtitle", "Online users:")); + $output .= theme("item_list", $items, variable_get("statistics_block_online_subtitle", "Online users:")); } } } @@ -758,14 +758,14 @@ function statistics_page() { if (user_access("access content")) { - theme("header"); + print theme("header"); statistics_page_user(); - 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"); } } @@ -782,7 +782,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) { $output .= statistics_summary("daycount", $displaycount); $output .= ""; - theme("box", t(variable_get("statistics_userpage_day_head", "")), $output, "main"); + print theme("box", t(variable_get("statistics_userpage_day_head", "")), $output, "main"); } @@ -791,7 +791,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) { $output .= statistics_summary("totalcount", $displaycount); $output .= ""; - theme("box", t(variable_get("statistics_userpage_all_head", "")), $output, "main"); + print theme("box", t(variable_get("statistics_userpage_all_head", "")), $output, "main"); } if ($displaycount = variable_get("statistics_userpage_last_cnt", "10")) { @@ -799,7 +799,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) { $output .= statistics_summary("timestamp", $displaycount); $output .= ""; - theme("box", t(variable_get("statistics_userpage_last_head", "")), $output, "main"); + print theme("box", t(variable_get("statistics_userpage_last_head", "")), $output, "main"); } } diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index b2c6416360f..645e25541c5 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -692,7 +692,7 @@ function statistics_display_online_block() { if ($items) { $output .= "

"; - $output .= theme("theme_item_list", $items, variable_get("statistics_block_online_subtitle", "Online users:")); + $output .= theme("item_list", $items, variable_get("statistics_block_online_subtitle", "Online users:")); } } } @@ -758,14 +758,14 @@ function statistics_page() { if (user_access("access content")) { - theme("header"); + print theme("header"); statistics_page_user(); - 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"); } } @@ -782,7 +782,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) { $output .= statistics_summary("daycount", $displaycount); $output .= ""; - theme("box", t(variable_get("statistics_userpage_day_head", "")), $output, "main"); + print theme("box", t(variable_get("statistics_userpage_day_head", "")), $output, "main"); } @@ -791,7 +791,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) { $output .= statistics_summary("totalcount", $displaycount); $output .= ""; - theme("box", t(variable_get("statistics_userpage_all_head", "")), $output, "main"); + print theme("box", t(variable_get("statistics_userpage_all_head", "")), $output, "main"); } if ($displaycount = variable_get("statistics_userpage_last_cnt", "10")) { @@ -799,7 +799,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) { $output .= statistics_summary("timestamp", $displaycount); $output .= ""; - theme("box", t(variable_get("statistics_userpage_last_head", "")), $output, "main"); + print theme("box", t(variable_get("statistics_userpage_last_head", "")), $output, "main"); } } diff --git a/modules/system.module b/modules/system.module index 2b920d50187..88c74db7385 100644 --- a/modules/system.module +++ b/modules/system.module @@ -57,7 +57,7 @@ function system_link($type) { menu("admin/system", t("configuration"), "system_admin", 3); menu("admin/system/themes", t("themes"), "system_admin", 2); - foreach (theme_list(1) as $theme) { + foreach (list_themes(1) as $theme) { // NOTE: refresh the list because some themes might have been enabled/disabled. include_once "$theme->filename"; $function = $theme->name ."_settings"; @@ -81,7 +81,7 @@ function system_link($type) { function system_user($type, &$edit, $user) { $options = "\n"; - if ($type == "edit_form" && count($themes = theme_list()) > 1) { + if ($type == "edit_form" && count($themes = list_themes()) > 1) { foreach ($themes as $key => $value) { $options .= "\n"; } @@ -168,7 +168,7 @@ function system_view_module($name) { } function system_view_theme($name) { - $themes = theme_list(); + $themes = list_themes(); $theme = $themes[$name]; if ($theme) { include_once "$theme->filename"; @@ -301,16 +301,9 @@ function system_listing($type, $directory, $required = array()) { $info->description = module_invoke($file->name, "help", "admin/system/modules#description") ? module_invoke($file->name, "help", "admin/system/modules#description") : module_invoke($file->name, "system", "description"); } elseif ($type == "theme") { - $class = "Theme_$file->name"; - if (class_exists($class)) { - $theme =& new $class; - $info->name = $theme->system("name") ? $theme->system("name") : $file->name; - $info->description = $theme->system("description"); + $info->name = $file->name; + $info->description = module_invoke($file->name, "help", "admin/system/themes#description"); $themes[] = $info->name; - } - else { - unset($files[$filename]); - } } // Update the contents of the system table: diff --git a/modules/system/system.module b/modules/system/system.module index 2b920d50187..88c74db7385 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -57,7 +57,7 @@ function system_link($type) { menu("admin/system", t("configuration"), "system_admin", 3); menu("admin/system/themes", t("themes"), "system_admin", 2); - foreach (theme_list(1) as $theme) { + foreach (list_themes(1) as $theme) { // NOTE: refresh the list because some themes might have been enabled/disabled. include_once "$theme->filename"; $function = $theme->name ."_settings"; @@ -81,7 +81,7 @@ function system_link($type) { function system_user($type, &$edit, $user) { $options = "\n"; - if ($type == "edit_form" && count($themes = theme_list()) > 1) { + if ($type == "edit_form" && count($themes = list_themes()) > 1) { foreach ($themes as $key => $value) { $options .= "\n"; } @@ -168,7 +168,7 @@ function system_view_module($name) { } function system_view_theme($name) { - $themes = theme_list(); + $themes = list_themes(); $theme = $themes[$name]; if ($theme) { include_once "$theme->filename"; @@ -301,16 +301,9 @@ function system_listing($type, $directory, $required = array()) { $info->description = module_invoke($file->name, "help", "admin/system/modules#description") ? module_invoke($file->name, "help", "admin/system/modules#description") : module_invoke($file->name, "system", "description"); } elseif ($type == "theme") { - $class = "Theme_$file->name"; - if (class_exists($class)) { - $theme =& new $class; - $info->name = $theme->system("name") ? $theme->system("name") : $file->name; - $info->description = $theme->system("description"); + $info->name = $file->name; + $info->description = module_invoke($file->name, "help", "admin/system/themes#description"); $themes[] = $info->name; - } - else { - unset($files[$filename]); - } } // Update the contents of the system table: diff --git a/modules/taxonomy.module b/modules/taxonomy.module index df7bec44678..281b8d2f0ea 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -717,9 +717,9 @@ function taxonomy_page() { taxonomy_feed($taxonomy); break; default: - theme("header"); + print theme("header"); taxonomy_render_nodes(taxonomy_select_nodes($taxonomy)); - theme("footer"); + print theme("footer"); break; } } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index df7bec44678..281b8d2f0ea 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -717,9 +717,9 @@ function taxonomy_page() { taxonomy_feed($taxonomy); break; default: - theme("header"); + print theme("header"); taxonomy_render_nodes(taxonomy_select_nodes($taxonomy)); - theme("footer"); + print theme("footer"); break; } } diff --git a/modules/title.module b/modules/title.module index 6dbd6304001..a2fdd0b9d2d 100644 --- a/modules/title.module +++ b/modules/title.module @@ -32,9 +32,9 @@ function title_page() { else if (db_num_rows($result) == 1) { $node = db_fetch_object($result); $node = node_load(array("nid" => $node->nid)); - theme("header"); + print theme("header"); print node_show($node, NULL); - theme("footer"); + print theme("footer"); } else { $header = array(t("Type"), t("Title"), t("Author")); @@ -49,15 +49,15 @@ function title_page() { $output .= table($header, $rows); $output .= "
"; - theme("header"); - theme("box", t("Matching Posts"), $output); - theme("footer"); + print theme("header"); + print theme("box", t("Matching Posts"), $output); + 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"); } } diff --git a/modules/tracker.module b/modules/tracker.module index 78d27c793ab..fcde4f1f66a 100644 --- a/modules/tracker.module +++ b/modules/tracker.module @@ -61,12 +61,12 @@ function tracker_posts($id = 0) { } $type = ucfirst(module_invoke($node->type, "node", "name")); - $title = l($node->title, "node/view/$node->nid") ." ". (node_is_new($node->nid, $node->changed) ? theme("theme_mark") : ""); + $title = l($node->title, "node/view/$node->nid") ." ". (node_is_new($node->nid, $node->changed) ? theme("mark") : ""); $author = format_name($node); $comments = array(); while ($comment = db_fetch_object($cresult)) { - $comments[] = "
  • ". t("%subject by %author", array("%subject" => l($comment->subject, "node/view/$node->nid#$comment->cid"), "%author" => format_name($comment))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("theme_mark") : "") ."
  • \n"; + $comments[] = "
  • ". t("%subject by %author", array("%subject" => l($comment->subject, "node/view/$node->nid#$comment->cid"), "%author" => format_name($comment))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("mark") : "") ."
  • \n"; } if ($comments) { @@ -104,9 +104,9 @@ function tracker_page() { global $user; if (user_access("access content")) { - theme("header", t("Recent posts")); - theme("box", t("Recent posts"), tracker_posts(arg(1))); - theme("footer"); + print theme("header", t("Recent posts")); + print theme("box", t("Recent posts"), tracker_posts(arg(1))); + print theme("footer"); } } diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index 78d27c793ab..fcde4f1f66a 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -61,12 +61,12 @@ function tracker_posts($id = 0) { } $type = ucfirst(module_invoke($node->type, "node", "name")); - $title = l($node->title, "node/view/$node->nid") ." ". (node_is_new($node->nid, $node->changed) ? theme("theme_mark") : ""); + $title = l($node->title, "node/view/$node->nid") ." ". (node_is_new($node->nid, $node->changed) ? theme("mark") : ""); $author = format_name($node); $comments = array(); while ($comment = db_fetch_object($cresult)) { - $comments[] = "
  • ". t("%subject by %author", array("%subject" => l($comment->subject, "node/view/$node->nid#$comment->cid"), "%author" => format_name($comment))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("theme_mark") : "") ."
  • \n"; + $comments[] = "
  • ". t("%subject by %author", array("%subject" => l($comment->subject, "node/view/$node->nid#$comment->cid"), "%author" => format_name($comment))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("mark") : "") ."
  • \n"; } if ($comments) { @@ -104,9 +104,9 @@ function tracker_page() { global $user; if (user_access("access content")) { - theme("header", t("Recent posts")); - theme("box", t("Recent posts"), tracker_posts(arg(1))); - theme("footer"); + print theme("header", t("Recent posts")); + print theme("box", t("Recent posts"), tracker_posts(arg(1))); + print theme("footer"); } } diff --git a/modules/user.module b/modules/user.module index 853638672af..ddf63b4a1f8 100644 --- a/modules/user.module +++ b/modules/user.module @@ -447,7 +447,7 @@ function user_block($op = "list", $delta = 0) { } $items[] = l(t("Request new password"), "user/password", array("title" => t("Request new password via e-mail."))); - $output .= theme("theme_item_list", $items); + $output .= theme("item_list", $items); $block["subject"] = t("User login"); $block["content"] = ""; @@ -467,7 +467,7 @@ function user_block($op = "list", $delta = 0) { $items[] = l((strlen($account->name) > 15 ? substr($account->name, 0, 15) . '...' : $account->name), "user/view/$account->uid"); } - $output = theme("theme_user_list", $items); + $output = theme("user_list", $items); $block["subject"] = t("Who's new"); $block["content"] = $output; @@ -478,11 +478,11 @@ function user_block($op = "list", $delta = 0) { } function theme_user_list($items, $title = NULL) { - return theme("theme_item_list", $items, $title); + return theme("item_list", $items, $title); } function theme_menu_list($items, $title = NULL) { - return theme("theme_item_list", $items, $title); + return theme("item_list", $items, $title); } function user_link($type) { @@ -693,7 +693,7 @@ function user_login($edit = array(), $msg = "") { */ if ($error) { - $output .= theme("theme_error", $error); + $output .= theme("error", $error); } /* @@ -726,7 +726,7 @@ function user_login($edit = array(), $msg = "") { if (variable_get("user_register", 1)) { $items[] = l(t("Create new account"), "user/register"); } - $output .= theme("theme_item_list", $items); + $output .= theme("item_list", $items); return form($output, "post", url("user")); } @@ -803,7 +803,7 @@ function user_pass($edit = array()) { // Display error message if necessary. if ($error) { - $output .= theme("theme_error", $error); + $output .= theme("error", $error); } /* @@ -818,7 +818,7 @@ function user_pass($edit = array()) { if (variable_get("user_register", 1)) { $items[] = l(t("Create new account"), "user/register"); } - $output .= theme("theme_item_list", $items); + $output .= theme("item_list", $items); return form($output, "post", url("user")); } @@ -927,7 +927,7 @@ function user_register($edit = array()) { } else { if ($error) { - $output .= theme("theme_error", $error); + $output .= theme("error", $error); } } @@ -948,7 +948,7 @@ function user_register($edit = array()) { $output .= form_submit(t("Create new account")); $items[] = l(t("Request new password"), "user/password"); $items[] = l(t("Log in"), "user/login"); - $output .= theme("theme_item_list", $items); + $output .= theme("item_list", $items); return form($output); } @@ -1032,7 +1032,7 @@ function user_edit($edit = array()) { } if ($error) { - $output .= theme("theme_error", $error); + $output .= theme("error", $error); } if (!$edit) { @@ -1070,9 +1070,9 @@ function user_view($uid = 0) { $output .= implode("\n", module_invoke_all("user", "view_private", "", $user)); - theme("header", $user->name); - theme("box", $user->name, $output); - theme("footer"); + print theme("header", $user->name); + print theme("box", $user->name, $output); + print theme("footer"); } else if ($uid && $account = user_load(array("uid" => $uid, "status" => 1))) { $output = form_item(t("Name"), $account->name); @@ -1083,19 +1083,19 @@ function user_view($uid = 0) { $output .= form_item(t("Administration"), l(t("edit account"), "admin/user/edit/$account->uid")); } - theme("header", $account->name); - theme("box", $account->name, $output); - theme("footer"); + print theme("header", $account->name); + print theme("box", $account->name, $output); + print theme("footer"); } else { $output = user_login(); - theme("header", t("User login")); - theme("box", t("User login"), $output); + print theme("header", t("User login")); + print theme("box", t("User login"), $output); if (variable_get("user_register", 1)) { - theme("box", t("Create new user account"), user_register()); + print theme("box", t("Create new user account"), user_register()); } - theme("box", t("Request new password"), user_pass()); - theme("footer"); + print theme("box", t("Request new password"), user_pass()); + print theme("footer"); } } @@ -1111,36 +1111,36 @@ function user_page() { switch ($op) { case t("E-mail new password"): case "password": - theme("header", t("E-mail new password")); - theme("box", t("E-mail new password"), user_pass($edit)); - theme("footer"); + print theme("header", t("E-mail new password")); + print theme("box", t("E-mail new password"), user_pass($edit)); + print theme("footer"); break; case t("Create new account"): case "register": $output = user_register($edit); - theme("header", t("Create new account")); + print theme("header", t("Create new account")); if (variable_get("user_register", 1)) { - theme("box", t("Create new account"), $output); + print theme("box", t("Create new account"), $output); } else { print message_access(); } - theme("footer"); + print theme("footer"); break; case t("Log in"): case "login": $output = user_login($edit); - theme("header", t("Log in")); - theme("box", t("Log in"), $output); - theme("footer"); + print theme("header", t("Log in")); + print theme("box", t("Log in"), $output); + print theme("footer"); break; case t("Save user information"): case "edit": $output = user_edit($edit); $GLOBALS["theme"] = theme_init(); - theme("header", t("Edit user information")); - theme("box", t("Edit user information"), $output); - theme("footer"); + print theme("header", t("Edit user information")); + print theme("box", t("Edit user information"), $output); + print theme("footer"); break; case "view": user_view(arg(2)); @@ -1150,9 +1150,9 @@ function user_page() { print user_logout(); break; case "help": - theme("header"); - theme("box", t("Distributed authentication"), user_help("user/help#user")); - theme("footer"); + print theme("header"); + print theme("box", t("Distributed authentication"), user_help("user/help#user")); + print theme("footer"); break; default: print user_view(); @@ -1236,7 +1236,7 @@ function user_admin_create($edit = array()) { else { if ($error) { - $output .= theme("theme_error", $error); + $output .= theme("error", $error); } $output .= form_textfield(t("Username"), "name", $edit["name"], 30, 55, t("Provide the username of the new account.")); @@ -1488,7 +1488,7 @@ function user_admin_edit($edit = array()) { $output .= status(t("user information changes have been saved.")); } else { - $output .= theme("theme_error", $error); + $output .= theme("error", $error); } } else if ($op == t("Delete account")) { @@ -1499,7 +1499,7 @@ function user_admin_edit($edit = array()) { } else { $error = t("Failed to delete account: the account has to be blocked first."); - $output .= theme("theme_error", $error); + $output .= theme("error", $error); } } @@ -1761,9 +1761,9 @@ function user_help($section = "admin/help#user") { $output .= "

    This second half of the _auth function examines the \$response from plant.blogger.com and returns a TRUE (1) or FALSE (0) as appropriate. This is a critical decision, so be sure that you have good logic here, and perform sufficient testing for all cases. In the case of Blogger, we search for the string 'fault' in the response. If that string is present, or there is no repsonse, our function returns FALSE. Otherwise, Blogger has returned valid data to our method request and we return TRUE. Note: Everything starting with \"//\" is a comment and is not executed.

    "; $output .= "
    function blogger_page() {
     
    -  theme("header");
    -  theme("box", "Blogger", blogger_help(\"user/help\"));
    -  theme("footer");
    +  print theme("header");
    +  print theme("box", "Blogger", blogger_help(\"user/help\"));
    +  print theme("footer");
     }
    "; $output .= "

    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 blogger.

    "; $output .= "
    function blogger_help(\$section) {
    diff --git a/modules/user/user.module b/modules/user/user.module
    index 853638672af..ddf63b4a1f8 100644
    --- a/modules/user/user.module
    +++ b/modules/user/user.module
    @@ -447,7 +447,7 @@ function user_block($op = "list", $delta = 0) {
               }
               $items[] = l(t("Request new password"), "user/password", array("title" => t("Request new password via e-mail.")));
     
    -          $output .= theme("theme_item_list", $items);
    +          $output .= theme("item_list", $items);
     
               $block["subject"] = t("User login");
               $block["content"] = "";
    @@ -467,7 +467,7 @@ function user_block($op = "list", $delta = 0) {
                 $items[] = l((strlen($account->name) > 15 ? substr($account->name, 0, 15) . '...' : $account->name), "user/view/$account->uid");
               }
     
    -          $output = theme("theme_user_list", $items);
    +          $output = theme("user_list", $items);
     
               $block["subject"] = t("Who's new");
               $block["content"] = $output;
    @@ -478,11 +478,11 @@ function user_block($op = "list", $delta = 0) {
     }
     
     function theme_user_list($items, $title = NULL) {
    -  return theme("theme_item_list", $items, $title);
    +  return theme("item_list", $items, $title);
     }
     
     function theme_menu_list($items, $title = NULL) {
    -  return theme("theme_item_list", $items, $title);
    +  return theme("item_list", $items, $title);
     }
     
     function user_link($type) {
    @@ -693,7 +693,7 @@ function user_login($edit = array(), $msg = "") {
       */
     
       if ($error) {
    -    $output .= theme("theme_error", $error);
    +    $output .= theme("error", $error);
       }
     
       /*
    @@ -726,7 +726,7 @@ function user_login($edit = array(), $msg = "") {
       if (variable_get("user_register", 1)) {
         $items[] = l(t("Create new account"), "user/register");
       }
    -  $output .= theme("theme_item_list", $items);
    +  $output .= theme("item_list", $items);
     
       return form($output, "post", url("user"));
     }
    @@ -803,7 +803,7 @@ function user_pass($edit = array()) {
     
         // Display error message if necessary.
         if ($error) {
    -      $output .= theme("theme_error", $error);
    +      $output .= theme("error", $error);
         }
     
         /*
    @@ -818,7 +818,7 @@ function user_pass($edit = array()) {
         if (variable_get("user_register", 1)) {
           $items[] = l(t("Create new account"), "user/register");
         }
    -    $output .= theme("theme_item_list", $items);
    +    $output .= theme("item_list", $items);
     
         return form($output, "post", url("user"));
       }
    @@ -927,7 +927,7 @@ function user_register($edit = array()) {
       }
       else {
         if ($error) {
    -      $output .= theme("theme_error", $error);
    +      $output .= theme("error", $error);
         }
       }
     
    @@ -948,7 +948,7 @@ function user_register($edit = array()) {
       $output .= form_submit(t("Create new account"));
       $items[] = l(t("Request new password"), "user/password");
       $items[] = l(t("Log in"), "user/login");
    -  $output .= theme("theme_item_list", $items);
    +  $output .= theme("item_list", $items);
     
       return form($output);
     }
    @@ -1032,7 +1032,7 @@ function user_edit($edit = array()) {
         }
     
         if ($error) {
    -      $output .= theme("theme_error", $error);
    +      $output .= theme("error", $error);
         }
     
         if (!$edit) {
    @@ -1070,9 +1070,9 @@ function user_view($uid = 0) {
     
         $output .= implode("\n", module_invoke_all("user", "view_private", "", $user));
     
    -    theme("header", $user->name);
    -    theme("box", $user->name, $output);
    -    theme("footer");
    +    print theme("header", $user->name);
    +    print theme("box", $user->name, $output);
    +    print theme("footer");
       }
       else if ($uid && $account = user_load(array("uid" => $uid, "status" => 1))) {
         $output = form_item(t("Name"), $account->name);
    @@ -1083,19 +1083,19 @@ function user_view($uid = 0) {
           $output .= form_item(t("Administration"), l(t("edit account"), "admin/user/edit/$account->uid"));
         }
     
    -    theme("header", $account->name);
    -    theme("box", $account->name, $output);
    -    theme("footer");
    +    print theme("header", $account->name);
    +    print theme("box", $account->name, $output);
    +    print theme("footer");
       }
       else {
         $output = user_login();
    -    theme("header", t("User login"));
    -    theme("box", t("User login"), $output);
    +    print theme("header", t("User login"));
    +    print theme("box", t("User login"), $output);
         if (variable_get("user_register", 1)) {
    -      theme("box", t("Create new user account"), user_register());
    +      print theme("box", t("Create new user account"), user_register());
         }
    -    theme("box", t("Request new password"), user_pass());
    -    theme("footer");
    +    print theme("box", t("Request new password"), user_pass());
    +    print theme("footer");
       }
     }
     
    @@ -1111,36 +1111,36 @@ function user_page() {
       switch ($op) {
         case t("E-mail new password"):
         case "password":
    -      theme("header", t("E-mail new password"));
    -      theme("box", t("E-mail new password"), user_pass($edit));
    -      theme("footer");
    +      print theme("header", t("E-mail new password"));
    +      print theme("box", t("E-mail new password"), user_pass($edit));
    +      print theme("footer");
           break;
         case t("Create new account"):
         case "register":
           $output = user_register($edit);
    -      theme("header", t("Create new account"));
    +      print theme("header", t("Create new account"));
           if (variable_get("user_register", 1)) {
    -        theme("box", t("Create new account"), $output);
    +        print theme("box", t("Create new account"), $output);
           }
           else {
             print message_access();
           }
    -      theme("footer");
    +      print theme("footer");
           break;
         case t("Log in"):
         case "login":
           $output = user_login($edit);
    -      theme("header", t("Log in"));
    -      theme("box", t("Log in"), $output);
    -      theme("footer");
    +      print theme("header", t("Log in"));
    +      print theme("box", t("Log in"), $output);
    +      print theme("footer");
           break;
         case t("Save user information"):
         case "edit":
           $output = user_edit($edit);
           $GLOBALS["theme"] = theme_init();
    -      theme("header", t("Edit user information"));
    -      theme("box", t("Edit user information"), $output);
    -      theme("footer");
    +      print theme("header", t("Edit user information"));
    +      print theme("box", t("Edit user information"), $output);
    +      print theme("footer");
           break;
         case "view":
           user_view(arg(2));
    @@ -1150,9 +1150,9 @@ function user_page() {
           print user_logout();
           break;
         case "help":
    -      theme("header");
    -      theme("box", t("Distributed authentication"), user_help("user/help#user"));
    -      theme("footer");
    +      print theme("header");
    +      print theme("box", t("Distributed authentication"), user_help("user/help#user"));
    +      print theme("footer");
           break;
         default:
           print user_view();
    @@ -1236,7 +1236,7 @@ function user_admin_create($edit = array()) {
       else {
     
         if ($error) {
    -      $output .= theme("theme_error", $error);
    +      $output .= theme("error", $error);
         }
     
         $output .= form_textfield(t("Username"), "name", $edit["name"], 30, 55, t("Provide the username of the new account."));
    @@ -1488,7 +1488,7 @@ function user_admin_edit($edit = array()) {
             $output .= status(t("user information changes have been saved."));
           }
           else {
    -        $output .= theme("theme_error", $error);
    +        $output .= theme("error", $error);
           }
         }
         else if ($op == t("Delete account")) {
    @@ -1499,7 +1499,7 @@ function user_admin_edit($edit = array()) {
           }
           else {
             $error = t("Failed to delete account: the account has to be blocked first.");
    -        $output .= theme("theme_error", $error);
    +        $output .= theme("error", $error);
           }
         }
     
    @@ -1761,9 +1761,9 @@ function user_help($section = "admin/help#user") {
           $output .= "

    This second half of the _auth function examines the \$response from plant.blogger.com and returns a TRUE (1) or FALSE (0) as appropriate. This is a critical decision, so be sure that you have good logic here, and perform sufficient testing for all cases. In the case of Blogger, we search for the string 'fault' in the response. If that string is present, or there is no repsonse, our function returns FALSE. Otherwise, Blogger has returned valid data to our method request and we return TRUE. Note: Everything starting with \"//\" is a comment and is not executed.

    "; $output .= "
    function blogger_page() {
     
    -  theme("header");
    -  theme("box", "Blogger", blogger_help(\"user/help\"));
    -  theme("footer");
    +  print theme("header");
    +  print theme("box", "Blogger", blogger_help(\"user/help\"));
    +  print theme("footer");
     }
    "; $output .= "

    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 blogger.

    "; $output .= "
    function blogger_help(\$section) {
    diff --git a/themes/example/example.theme b/themes/example/example.theme
    index d8ae776ede3..bf4b780ef62 100644
    --- a/themes/example/example.theme
    +++ b/themes/example/example.theme
    @@ -1,15 +1,18 @@
     
    \ No newline at end of file
    +
    +?>
    diff --git a/themes/marvin/marvin.theme b/themes/marvin/marvin.theme
    index d574dc7bcfa..6cf3df0845a 100644
    --- a/themes/marvin/marvin.theme
    +++ b/themes/marvin/marvin.theme
    @@ -14,169 +14,166 @@ function marvin_help($section) {
       return $output;
     }
     
    -class Theme_marvin extends BaseTheme {
    -
    -   function header($title = "") {
    +function marvin_header($title = "") {
    +  ?>
    +  
    +  
    +  
    +    
    +    
    +    <?php
    +      if ($title) {
    +        print $title ." - ". variable_get("site_name", "drupal");
    +      }
    +      else {
    +        print variable_get("site_name", "drupal") . ($slogan = variable_get("site_slogan", "")) ? " - $slogan" : "";
    +      }
         ?>
    -     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    -     <html>
    -     <head>
    -      <?php print theme_head($main); ?>
    -      <title>
    -       <?php
    -         if ($title) {
    -           print $title ." - ". variable_get("site_name", "drupal");
    -         }
    -         else {
    -           print variable_get("site_name", "drupal") . ($slogan = variable_get("site_slogan", "")) ? " - $slogan" : "";
    -         }
    -       ?>
    -      
    -      
    -     
    -     >
    -      
    -       
    -        
    -        
    -       
    -       
    -        
    -       
    -       
    -        \n";
    +  print " \n";
    +  print "
     
    - links(link_page()); - ?> -
    - + + + > + + + + + + + + + +
     
    + +
    + title\" -->\n"; - print "\n"; - print " path/images/drop.gif\" alt=\"\" title=\"\" />   $node->title\n"; - print " \n"; - print " "; - if ($colspan) { - print ""; - } - print " \n"; - print "  \n"; + $path = path_to_theme(); + print "\n\n"; + print "
    path/images/pixel.gif\" width=\"1\" height=\"1\" alt=\"\" title=\"\" />
    ". t("Submitted by %a on %b", array("%a" => format_name($node), "%b" => format_date($node->created, "large"))) ."
    ". $this->links($terms) ."
    \n"; + print " \"\"   $node->title\n"; + print " \n"; + print " "; + if ($colspan) { + print ""; + } + print " \n"; + print "  \n"; - if ($main && $node->teaser) { - print "

    $node->teaser

    \n"; - } - else { - print "

    $node->body

    \n"; - } + if ($main && $node->teaser) { + print "

    $node->teaser

    \n"; + } + else { + print "

    $node->body

    \n"; + } - print "  \n"; + print "  \n"; - if ($links = link_node($node, $main)) { - print " ". $this->links($links) ."\n"; - } + if ($links = link_node($node, $main)) { + print " ". theme("links", $links) ."\n"; + } - print "
    \"\"
    ". t("Submitted by %a on %b", array("%a" => format_name($node), "%b" => format_date($node->created, "large"))) ."
    ". theme("links", $terms) ."
    \n"; - print "

    \n\n"; - } + print "
    \n"; + print "

    \n\n"; +} - function comment($comment, $link = "") { - // Create comment header: - print "\n"; - print " \n"; - print " \n"; + print "
    \n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print "
    \n"; - print " \n"; - print " \n"; +function marvin_comment($comment, $link = "") { + // Create comment header: + print "
    \n"; + print " \n"; + print " \n"; + print " \n"; - // Print body of comment: - if ($comment->comment) { - print " \n"; - } + // Print body of comment: + if ($comment->comment) { + print " \n"; + } - // Print bottom link(s): - print " \n"; - print "
    \n"; + print " \n"; + print " \n"; + print " \n"; - print " \n"; + print "
    \n"; + print " \n"; + print " \n"; - // Subject: - print " \n"; - print " \n"; + // Subject: + print " \n"; + print " \n"; - print " \n"; + print " \n"; - // Author: - print " \n"; - print " \n"; - print " \n"; + // Author: + print " \n"; + print " \n"; + print " \n"; - // Date - print " \n"; - print " \n"; - print " \n"; + // Date + print " \n"; + print " \n"; + print " \n"; - print "
    ". t("Subject") .":
    $comment->subject
    ". t("Subject") .":
    $comment->subject
    ". t("Author") .":". format_name($comment) ."
    ". t("Author") .":". format_name($comment) ."
    ". t("Date") .":". format_date($comment->timestamp) ."
    ". t("Date") .":". format_date($comment->timestamp) ."
    \n"; - print "
    \n"; + print "
    $comment->comment
    $comment->comment
    [ $link ]
    \n"; - print "
    \n"; - print "
    \n\n"; - } + // Print bottom link(s): + print "
    [ $link ]
    \n"; + print "
    \n"; + print "
    \n\n"; +} - function box($subject, $content, $region = "main") { - print "\n\n"; - print "\n"; - print " \n"; - print " \n"; - print " \n"; - print "
    \n"; - print " \n"; - print " \n"; - print " \n"; - print "
    $subject
    $content
    \n"; - print "
    \n"; - print "
    \n\n"; - } +function marvin_box($subject, $content, $region = "main") { + print "\n\n"; + print "\n"; + print " \n"; + print " \n"; + print " \n"; + print "
    \n"; + print " \n"; + print " \n"; + print " \n"; + print "
    $subject
    $content
    \n"; + print "
    \n"; + print "
    \n\n"; +} - function links($links, $delimiter = " · ") { - return implode($delimiter, $links); - } - - function footer() { - ?> - - - - - - - - ". $this->links(link_page()) ."

    ". variable_get("site_footer", "") ."

    \n"; - ?> - - - - - - - + + + + + + + + ". theme("links", link_page()) ."

    ". variable_get("site_footer", "") ."

    \n"; + ?> + + + + + + + diff --git a/themes/unconed/unconed.theme b/themes/unconed/unconed.theme index 3a2b9148640..df2e014ff33 100644 --- a/themes/unconed/unconed.theme +++ b/themes/unconed/unconed.theme @@ -7,215 +7,296 @@ function unconed_help($section) { switch ($section) { case 'admin/system/themes#description': - $output = t("A PHP theme"); + $output = t("Internet Explorer, Mozilla, Opera"); break; } return $output; } - class Theme_unconed extends BaseTheme { - var $foreground = "#000000"; - var $background = "#ffffff"; +function unconed_header($title = "") { + global $base_url; + $foreground = "#000000"; + $background = "#ffffff"; - var $link = "#000000"; + $link = "#000000"; - var $cl80 = "#8f9399"; - var $clc0 = "#c8c8d0"; - var $cl00 = "#000000"; + $cl80 = "#8f9399"; + $clc0 = "#c8c8d0"; + $cl00 = "#000000"; - // color set #1: - var $brcolor1 = "#000000"; // border color - var $bgcolor1 = "#b5bece"; - var $fgcolor1 = "#000000"; // table body color - var $hlcolor1 = "#000000"; // high-light color - var $sectioncolor = "#202020"; + // color set #1: + $brcolor1 = "#000000"; // border color + $bgcolor1 = "#b5bece"; + $fgcolor1 = "#000000"; // table body color + $hlcolor1 = "#000000"; // high-light color + $sectioncolor = "#202020"; - // color set #2: - var $bgcolor2 = "#eeeeee"; - var $fgcolor2 = "#000000"; + // color set #2: + $bgcolor2 = "#eeeeee"; + $fgcolor2 = "#000000"; - // color set #3: - var $bgcolor3 = "#d7d7d7"; - var $fgcolor3 = "#000000"; + // color set #3: + $bgcolor3 = "#d7d7d7"; + $fgcolor3 = "#000000"; + srand((double)microtime()*1000000); + ?> + + + + + <?php echo ($title ? ($title . " - ") : "") . variable_get(site_name, "drupal"); ?> + + + > + + + + + -
    + + + + + + + +
    +
    logo
    +
    +
    +
    "; + print "
    "; + print ""; + print ""; + print "
    \"\"
    "; + print "
    "; + ?>
    + - - - - - <?php echo ($title ? ($title . " - ") : "") . variable_get(site_name, "drupal"); ?> - - - > - - - - -
    - - - - - - - -
    -
    logo
    -
    -
    -
    brcolor1; width: 100%;\">"; - print "
    "; - print ""; - print ""; - print "
    bgcolor2; text-align: center;\">
    fgcolor1;\">path . "/images/null.gif\" width=\"2\" height=\"2\" alt=\"\" title=\"\"/>
    "; - print "
    "; - ?>
    - title\" -->\n"; - ?> - -
    - - - - bgcolor2; width: 70%;\">" . t("Submitted by %a on %b", array("%a" => format_name($node), "%b" => format_date($node->created, "large"))) . " - - - - - bgcolor3 .";\">"; - } - ?> -
    title"; ?>
    bgcolor2; width: 30%; text-align: center;\">". $taxo .""; - ?> -
    - teaser) { - echo "

    $node->teaser

    "; - } - else { - echo "

    $node->body

    "; - } - ?> -
    bgcolor3 ."; text-align: right;\" colspan=\"2\">[ ". theme_links($links) ." ]

    - subject\" by $comment->name -->\n"; - - ?> - + // color set #3: + $bgcolor3 = "#d7d7d7"; + $fgcolor3 = "#000000"; + print "\n\n"; + ?> +
    bgcolor1;\">"; - echo " "; - echo " "; - - // print body of comment: - if ($comment) echo " "; - - // print bottom link(s): - echo " "; - echo "
    - "; - echo "
    bgcolor1;\">"; - echo " "; - - // subject: - echo " "; - echo " "; - echo " "; - - // author: - echo " "; - echo " "; - echo " "; - - // date - echo " "; - - echo "
    hlcolor1;\">" . t("subject") . ":
    "; - echo "
    fgcolor1;\">$comment->subject
    "; - echo "
    " . t("author") . ":" . format_name($comment) . " "; - echo "
    " . t("date") . ":". format_date($comment->timestamp) ."
    "; - echo "
    bgcolor2;\">$comment->comment
    bgcolor3; text-align: right;\">[ $link ]
    "; - ?>

    - - "; - print " "; - print "
    - "; - print "
    bgcolor1; text-align: center;\">
    fgcolor1;\">$subject
    bgcolor2;\">$content
    "; - - ?> -

    - - - + + + " . t("Submitted by %a on %b", array("%a" => format_name($node), "%b" => format_date($node->created, "large"))) . " + -
    title"; ?>
    ". $taxo .""; ?> -
    brcolor1; width: 100%;\">"; - print "
    "; - print ""; - print ""; - print "
    bgcolor2; text-align: center;\">
    fgcolor1;\">path . "/images/null.gif\" width=\"2\" height=\"2\" alt=\"\" title=\"\" />
    "; - print "
    "; - ?> - - -
    - + + + teaser) { + echo "

    $node->teaser

    "; + } + else { + echo "

    $node->body

    "; + } + ?> + - - - - - - + [ ". theme("links", $links) ." ]"; + } + ?> +
    subject\" by $comment->name -->\n"; + + ?> + + "; + echo " "; + echo " "; + + // print body of comment: + if ($comment) echo " "; + + // print bottom link(s): + echo " "; + echo "
    + "; + echo "
    "; + echo " "; + + // subject: + echo " "; + echo " "; + echo " "; + + // author: + echo " "; + echo " "; + echo " "; + + // date + echo " "; + + echo "
    " . t("subject") . ":
    "; + echo "
    $comment->subject
    "; + echo "
    " . t("author") . ":" . format_name($comment) . " "; + echo "
    " . t("date") . ":". format_date($comment->timestamp) ."
    "; + echo "
    $comment->comment
    [ $link ]
    "; + ?>
    subject, $block->content); +} + +function unconed_box($subject, $content, $region = "main") { + $foreground = "#000000"; + $background = "#ffffff"; + + $link = "#000000"; + + $cl80 = "#8f9399"; + $clc0 = "#c8c8d0"; + $cl00 = "#000000"; + + // color set #1: + $brcolor1 = "#000000"; // border color + $bgcolor1 = "#b5bece"; + $fgcolor1 = "#000000"; // table body color + $hlcolor1 = "#000000"; // high-light color + $sectioncolor = "#202020"; + + // color set #2: + $bgcolor2 = "#eeeeee"; + $fgcolor2 = "#000000"; + + // color set #3: + $bgcolor3 = "#d7d7d7"; + $fgcolor3 = "#000000"; + ?> + + "; + print " "; + print "
    + "; + print "
    $subject
    $content
    "; + + ?> + +
    + + + + + + + "; + print ""; + print ""; + print ""; + print "
    \"\"
    "; + print ""; + ?> + + +
    + + + + + + + + + diff --git a/themes/xtemplate/xtemplate.theme b/themes/xtemplate/xtemplate.theme index d706541b4d2..a24149fef8e 100644 --- a/themes/xtemplate/xtemplate.theme +++ b/themes/xtemplate/xtemplate.theme @@ -1,9 +1,6 @@ sidebar == "left") { - theme_blocks("all"); + print render_blocks("all"); } else if ($xtemplate->sidebar == "both") { - theme_blocks("left"); + print render_blocks("left"); } if ($blocks = ob_get_contents()) { @@ -171,10 +168,10 @@ function xtemplate_footer() { ob_start(); if ($xtemplate->sidebar == "right") { - theme_blocks("all"); + print render_blocks("all"); } else if ($xtemplate->sidebar == "both") { - theme_blocks("right"); + print render_blocks("right"); } if ($blocks = ob_get_contents()) {