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 .= "
";
- 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 "$node->titleby ". 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 .= " ";
- print $output;
+ return $output;
}
+/**
+ Returns themed page footer.
+
+ @return a string contraining the \a footer output.
+**/
function theme_footer() {
$output = "$block->subject"; $output .= "$block->content ";
$output .= " | ";
+ return " ";
}
+/**
+ 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 = "