Example #1
0
        }
    }
}
# -- Include JS files into $doc from required modules --
foreach ($ma as $mod) {
    if ($mod->required()) {
        foreach ($mod->jsFiles as $file) {
            $link = $head->appendChild($doc->createElement('script'));
            $link->setAttribute('type', 'text/javascript');
            $link->setAttribute('src', $file);
        }
    }
}
# -- Make title of document --
$title = $head->appendChild($doc->createElement('title'));
$title->appendChild($doc->createTextNode(DOMAIN . ' - ' . $ma[$option]->getMenu()));
# -- Make base document structure --
$body->appendChild($doc->importNode($ma['base']->getContent(), true));
# -- Make main menu --
$left = $doc->getElementById('left');
$center = $doc->getElementById('center');
if (isset($left)) {
    foreach ($ma as $op => $mod) {
        $menu = $mod->getMenu();
        if (isset($menu)) {
            $div = $left->appendChild($doc->createElement('div'));
            $div->setAttribute('class', 'menuItem');
            $a = $div->appendChild($doc->createElement('a'));
            $a->setAttribute('href', '?op=' . $op);
            if ($mod->selected()) {
                $a->setAttribute('class', 'selected');