get_string(SetupConfig::THEME, 'material'); $site_name = $config->get_string(SetupConfig::TITLE); $data_href = get_base_href(); // $main_page = $config->get_string(SetupConfig::MAIN_PAGE); $contact_link = contact_link(); $site_link = make_link(); $header_html = $this->get_all_html_headers(); $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 ($this->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($this->subheading) ? "" : "

{$this->subheading}
"; $wrapper = ""; if(strlen($this->heading) > 100) { $wrapper = ' style="height: 3em; overflow: auto;"'; } */ $flash_html = $this->flash ? "".nl2br(html_escape(implode("\n", $this->flash)))."" : ""; print << {$this->title} $header_html
$h_search {$toolbar_block_html}
{$subtoolbar_block_html}
Drawer
$drawer_block_html
$head_block_html $sub_block_html
$left_block_html
$flash_html $main_block_html
$debug $contact
EOD; } public function rework_navigation(Block $block) { // $h = $block->header; $b = $block->body; $i = $block->id; $dom = new DomDocument(); $dom->loadHTML($b); // $output = []; $html = "
\n\n
\n"; return $html; } /** * Get the HTML for this block. from core */ public function get_html(Block $block, string $section="main", bool $hidable=false, string $extra_class=""): string { $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; } }