get_string('base_href');
$data_href = $config->get_string('data_href');
$contact_link = $config->get_string('contact_link');
function block_to_html($block, $hidable=false) {
$h = $block->header;
$b = $block->body;
$html = "";
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;
}
$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, true);
}
$mainblock_html = "";
foreach($this->mainblocks as $block) {
$mainblock_html .= block_to_html($block, false);
}
$scripts = glob("scripts/*.js");
$script_html = "";
foreach($scripts as $script) {
$script_html .= "\t\t\n";
}
if($config->get_bool('debug_enabled')) {
if(function_exists('memory_get_usage')) {
$i_mem = sprintf("%5.2f", ((memory_get_usage()+512)/1024)/1024);
}
else {
$i_mem = "???";
}
if(function_exists('getrusage')) {
$ru = getrusage();
$i_utime = sprintf("%5.2f", ($ru["ru_utime.tv_sec"]*1e6+$ru["ru_utime.tv_usec"])/1000000);
$i_stime = sprintf("%5.2f", ($ru["ru_stime.tv_sec"]*1e6+$ru["ru_stime.tv_usec"])/1000000);
}
else {
$i_utime = "???";
$i_stime = "???";
}
$i_files = count(get_included_files());
global $_execs;
$debug = "
Took $i_utime + $i_stime seconds and {$i_mem}MB of RAM";
$debug .= "; Used $i_files files and $_execs queries";
}
else {
$debug = "";
}
global $config;
$version = $config->get_string('version');
$contact = empty($contact_link) ? "" : "
Contact";
if(empty($this->subheading)) {
$subheading = "";
}
else {
$subheading = "{$this->subheading}
";
}
print <<
{$this->title}
$header_html
$script_html
{$this->heading}
$subheading
$sideblock_html
$mainblock_html
EOD;
?>