get_string('theme', 'material');
$site_name = $config->get_string('title');
$data_href = get_base_href();
$main_page = $config->get_string('main_page');
$contact_link = contact_link();
$site_link = make_link();
$header_html = "";
ksort($page->html_headers);
foreach($page->html_headers as $line) {
$header_html .= "\t\t$line\n";
}
$left_block_html = "";
$main_block_html = "";
$head_block_html = "";
$sub_block_html = "";
$drawer_block_html = ""; //use exampled in user.theme.php & view.theme.php
$toolbar_block_html = ""; // not used at this point
$subtoolbar_block_html = ""; // use exampled in user.theme.php
$navigation = "";
$h_search = "
";
foreach($page->blocks as $block) {
switch($block->section) {
case "toolbar":
$toolbar_block_html .= $this->get_html($block, "toolbar");
break;
case "subtoolbar":
$subtoolbar_block_html .= $this->get_html($block, "subtoolbar");
break;
case "left":
if($block->header == "Navigation"){
$subtoolbar_block_html = $this->rework_navigation($block);
break;
}
// $left_block_html .= $block->get_html(true);
$left_block_html .= $this->get_html($block, "full", true, "left-blocks nav-card mdl-cell--4-col-tablet");
break;
case "head":
$head_block_html .= $this->get_html($block, "third", true, "nav-card head-blocks");
break;
case "drawer":
$drawer_block_html .= $this->get_html($block, "full", true, "nav-card drawer-blocks");
break;
case "main":
// $main_block_html .= $block->get_html(false);
$main_block_html .= $this->get_html($block, "main", true, "");
break;
case "subheading":
// $sub_block_html .= $block->body; // $this->block_to_html($block, true);
$sub_block_html .= $this->get_html($block, "third", true, "nav-card");
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;"';
}
*/
$flash = $page->get_cookie("flash_message");
$flash_html = "";
if($flash) {
$flash_html = "".nl2br(html_escape($flash))." [X]";
}
print <<
{$page->title}
$header_html
EOD;
}
public function rework_navigation(Block $block){
$h = $block->header;
$b = $block->body;
$i = $block->id;
$dom = new DomDocument();
$dom->loadHTML($b);
$output = array();
$html = "\n\n\n";
return $html;
}
/**
* Get the HTML for this block. from core
*
* @param bool $hidable
* @return string
*/
public function get_html(Block $block, $section="main", $hidable=false, $extra_class="") {
$h = $block->header;
$b = $block->body;
$i = $block->id;//blotter extention id has `!`
if($section == "toolbar"){
$html = "\n\n\n";
return $html;
}
if($section == "subtoolbar"){
$html = "\n\n\n";
return $html;
}
if($section == "full"){
$html = "";
$h_toggler = $hidable ? " shm-toggler" : "";
if(!empty($h)) $html .="$h
";
if(!empty($b)) $html .="$b
";
$html .= " \n";
return $html;
}
if($section == "third"){
$html = "";
$h_toggler = $hidable ? " shm-toggler" : "";
if(!empty($h)) $html .="$h
";
if(!empty($b)) $html .="$b
";
$html .= " \n";
return $html;
}
$html = "";
$h_toggler = $hidable ? " shm-toggler" : "";
if(!empty($h)) $html .= "$h
";
if(!empty($b)) $html .= "$b
";
$html .= "\n";
return $html;
}
}
//@todo fix ext/blotter id tag
//@todo fix table row error for ext/ip_ban
//@todo fix table row error for ext/image_hash_ban
//@todo fix table row error for ext/untag
//@todo fix ext private-messages gives Uncaught TypeError: Cannot read property 'href' of null when no messages are there..