left_enabled = false; } public function render() { $left_block_html = ""; $main_block_html = ""; $sub_block_html = ""; foreach ($this->blocks as $block) { switch ($block->section) { case "left": $left_block_html .= $block->get_html(true); break; case "main": $main_block_html .= $block->get_html(false); break; case "subheading": $sub_block_html .= $block->body; // $this->block_to_html($block, true); break; default: print "

error: {$block->header} using an unknown section ({$block->section})"; break; } } if (empty($this->subheading)) { $subheading = ""; } else { $subheading = "

{$this->subheading}
"; } if ($this->left_enabled) { $left = ""; $withleft = "withleft"; } else { $left = ""; $withleft = ""; } $flash_html = $this->flash ? "".nl2br(html_escape(implode("\n", $this->flash)))."" : ""; $head_html = $this->head_html(); $footer_html = $this->footer_html(); print << $head_html

{$this->heading}

$subheading $sub_block_html
$left
$flash_html $main_block_html
EOD; } }