From 187de1832206a8a7f5f72ed37f6b9e86d00326b4 Mon Sep 17 00:00:00 2001 From: shish <shish@7f39781d-f577-437e-ae19-be835c7a54ca> Date: Tue, 1 May 2007 12:44:30 +0000 Subject: [PATCH] heading support brought to stable, for people who want to pull the rss_images extension from unstable svn git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.0@46 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 bfe62f35..880e9946 100644 --- a/themes/default/default.php +++ b/themes/default/default.php @@ -14,6 +14,11 @@ function block_to_html($block) { 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); @@ -73,6 +78,7 @@ print <<<EOD <head> <title>{$this->title}</title> <link rel="stylesheet" href="$data_href/themes/default/style.css" type="text/css"> +$header_html <script src='$data_href/themes/default/sidebar.js' type='text/javascript'></script> $script_html </head>