block name seeding

git-svn-id: file:///home/shish/svn/shimmie2/trunk@673 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-12-30 12:03:05 +00:00
parent aa998fcc06
commit 43dc8a6710

View File

@ -19,10 +19,10 @@ class Layout {
foreach($page->blocks as $block) { foreach($page->blocks as $block) {
switch($block->section) { switch($block->section) {
case "left": case "left":
$left_block_html .= $this->block_to_html($block, true); $left_block_html .= $this->block_to_html($block, true, "left");
break; break;
case "main": case "main":
$main_block_html .= $this->block_to_html($block, false); $main_block_html .= $this->block_to_html($block, false, "main");
break; break;
default: default:
print "<p>error: {$block->header} using an unknown section ({$block->section})"; print "<p>error: {$block->header} using an unknown section ({$block->section})";
@ -73,11 +73,11 @@ $header_html
EOD; EOD;
} }
function block_to_html($block, $hidable=false) { function block_to_html($block, $hidable=false, $salt="") {
$h = $block->header; $h = $block->header;
$b = $block->body; $b = $block->body;
$html = ""; $html = "";
$i = str_replace(' ', '_', $h); $i = str_replace(' ', '_', $h) . $salt;
if($hidable) { if($hidable) {
$toggle = " onclick=\"toggle('$i')\""; $toggle = " onclick=\"toggle('$i')\"";
} }