From d45e3af21500dfe62032e564fc593fab838eb84b Mon Sep 17 00:00:00 2001 From: shish Date: Wed, 25 Apr 2007 18:04:55 +0000 Subject: [PATCH] hiding main blocks is confusing git-svn-id: file:///home/shish/svn/shimmie2/trunk@13 7f39781d-f577-437e-ae19-be835c7a54ca --- themes/default/default.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/themes/default/default.php b/themes/default/default.php index bfe62f35..63fa65e1 100644 --- a/themes/default/default.php +++ b/themes/default/default.php @@ -4,24 +4,30 @@ $base_href = $config->get_string('base_href'); $data_href = $config->get_string('data_href'); $contact_link = $config->get_string('contact_link'); -function block_to_html($block) { +function block_to_html($block, $hidable=false) { $h = $block->header; $b = $block->body; - $i = str_replace(' ', '_', $h); $html = ""; - if(!is_null($h)) $html .= "\n

$h

\n"; - if(!is_null($b)) $html .= "
$b
\n"; + if($hidable) { + $i = str_replace(' ', '_', $h); + if(!is_null($h)) $html .= "\n

$h

\n"; + if(!is_null($b)) $html .= "
$b
\n"; + } + else { + if(!is_null($h)) $html .= "\n

$h

\n"; + if(!is_null($b)) $html .= "
$b
\n"; + } return $html; } $sideblock_html = ""; foreach($this->sideblocks as $block) { - $sideblock_html .= block_to_html($block); + $sideblock_html .= block_to_html($block, true); } $mainblock_html = ""; foreach($this->mainblocks as $block) { - $mainblock_html .= block_to_html($block); + $mainblock_html .= block_to_html($block, false); } $scripts = glob("scripts/*.js");