get_string('theme', 'default');
$data_href = get_base_href();
$contact_link = $config->get_string('contact_link');
$header_html = "";
foreach($page->headers as $line) {
$header_html .= "\t\t$line\n";
}
$left_block_html = "";
$main_block_html = "";
$head_block_html = "";
$sub_block_html = "";
foreach($page->blocks as $block) {
switch($block->section) {
case "left":
$left_block_html .= $this->block_to_html($block, true, "left");
break;
case "head":
$head_block_html .= "
".$this->block_to_html($block, false, "head")." ";
break;
case "main":
$main_block_html .= $this->block_to_html($block, false, "main");
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;
}
}
$debug = get_debug_info();
$contact = empty($contact_link) ? "" : "Contact ";
$subheading = empty($page->subheading) ? "" : "
{$page->subheading}
";
$wrapper = "";
if(strlen($page->heading) > 100) {
$wrapper = ' style="height: 3em; overflow: auto;"';
}
print <<
{$page->title}
$header_html
$sub_block_html
$left_block_html
$main_block_html
EOD;
}
/**
* A handy function which does exactly what it says in the method name
*/
private function block_to_html($block, $hidable=false, $salt="") {
$h = $block->header;
$b = $block->body;
$html = "";
$i = str_replace(' ', '_', $h) . $salt;
if($hidable) $html .= "
";
if(!is_null($h)) $html .= "
";
if(!is_null($b)) {
if(strpos($b, "")) {
$html .= "$b
";
}
else {
$html .= "
";
}
}
return $html;
}
}
?>