summaryrefslogtreecommitdiff
path: root/includes/theme.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-02-01 19:54:19 +0000
committerDries Buytaert <dries@buytaert.net>2003-02-01 19:54:19 +0000
commitcfd31c93f1f4a4453f7f67e9bf5d3826f9cfce2f (patch)
treedc94a1c50d1c55d2a9a83a07ba1a5c8f03b7238c /includes/theme.inc
parentbb9f9868ebddf9ebf17b9496f2f541dd0b6e7176 (diff)
downloadbrdo-cfd31c93f1f4a4453f7f67e9bf5d3826f9cfce2f.tar.gz
brdo-cfd31c93f1f4a4453f7f67e9bf5d3826f9cfce2f.tar.bz2
Patch by Ax:
- Bad usage of css ID's: they may be used for a single element only, but were used as #node, #block, which can occur multiple times in a single page. - Moved HTML from theme to template - thats what templates are all about! - Added support for head() hook - Added support for diffentiating between boxes and blocks. - Typo: secundary -> secondary
Diffstat (limited to 'includes/theme.inc')
-rw-r--r--includes/theme.inc16
1 files changed, 14 insertions, 2 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index 7a023991a..d206c22ec 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -69,6 +69,12 @@ class BaseTheme {
print $output;
}
+ function block($subject, $content, $region = "main") {
+ global $theme;
+
+ $theme->box($subject, $content, $region);
+ }
+
function footer() {
$output = "</td></tr></table>";
$output .= "</body></html>";
@@ -148,7 +154,13 @@ function theme_init() {
return $obj;
}
-function theme_blocks($region, &$theme) {
+/**
+ * Render blocks available for $user and $region calling $theme->block($region).
+ *
+ * @param string $region main|left|right
+ * @param
+ */
+function theme_blocks($region) {
global $user, $PHP_SELF;
$result = db_query("SELECT * FROM blocks WHERE (status = '1' OR custom = '1') ". ($region != "all" ? "AND region = '%s' " : "") ."ORDER BY weight, module", $region == "left" ? 0 : 1);
@@ -157,7 +169,7 @@ function theme_blocks($region, &$theme) {
if ((($block->status && (!$user->uid || !$block->custom)) || ($block->custom && $user->block[$block->module][$block->delta])) && (!$block->path || preg_match("|$block->path|", $PHP_SELF))) {
$block_data = module_invoke($block->module, "block", "view", $block->delta);
if ($block_data["content"]) {
- $theme->box($block_data["subject"], $block_data["content"], $region);
+ theme_invoke("block", $block_data["subject"], $block_data["content"], $region);
}
}
}