From 32e4af6a23af20831a1dbf3e2db1a89235468f27 Mon Sep 17 00:00:00 2001 From: shish Date: Tue, 1 May 2007 12:41:44 +0000 Subject: [PATCH] support for adding headers to a page git-svn-id: file:///home/shish/svn/shimmie2/trunk@44 7f39781d-f577-437e-ae19-be835c7a54ca --- core/page.class.php | 6 ++++++ themes/default/default.php | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/core/page.class.php b/core/page.class.php index d51f9c9d..400b3f14 100644 --- a/core/page.class.php +++ b/core/page.class.php @@ -39,6 +39,7 @@ class Page { var $heading = ""; var $subheading = ""; var $quicknav = ""; + var $headers = array(); var $sideblocks = array(); var $mainblocks = array(); @@ -54,6 +55,11 @@ class Page { $this->subheading = $subheading; } + public function add_header($line, $position=50) { + while(isset($this->headers[$position])) $position++; + $this->headers[$position] = $line; + } + public function add_side_block($block, $position=50) { while(isset($this->sideblocks[$position])) $position++; $this->sideblocks[$position] = $block; diff --git a/themes/default/default.php b/themes/default/default.php index 63fa65e1..af9cc703 100644 --- a/themes/default/default.php +++ b/themes/default/default.php @@ -20,6 +20,11 @@ function block_to_html($block, $hidable=false) { return $html; } +$header_html = ""; +foreach($this->headers as $line) { + $header_html .= "\t\t$line"; +} + $sideblock_html = ""; foreach($this->sideblocks as $block) { $sideblock_html .= block_to_html($block, true); @@ -79,6 +84,7 @@ print << {$this->title} +$header_html $script_html