public function getCMSHTML()
 {
     $Template = new Template($this->A->TemplateID);
     if ($Template->getA() == null) {
         emoFatalError("multiCMS kann die Seite leider nicht erzeugen", "Das ausgew&auml;hlte Domain-Template wurde nicht gefunden.<br />Bitte w&auml;hlen Sie ein neues Template bei der Domain " . $this->A("url") . " (" . $this->A("title") . ") aus", "multiCMS", "./multiCMS");
     }
     #die("The selected domain-template does not exist.");
     $html = $Template->getA()->html;
     $navi = new mNavigationGUI();
     $Seite = new SeiteGUI($this->seite != 0 ? $this->seite : $this->A->startseite);
     #$Scripts = new ScriptsGUI();
     $Seite->loadMe();
     if ($Seite->A("permalink") != "" and !isset($_GET["permalink"]) and $this->A->startseite != $Seite->getID()) {
         $ex = explode("\n", $this->A("url"));
         header("HTTP/1.1 301 Moved Permanently");
         header("Location: http" . ((isset($_SERVER["HTTPS"]) and $_SERVER["HTTPS"] == "on") ? "s" : "") . "://{$ex['0']}/" . $this->A("permalinkPrefix") . $Seite->A("permalink"));
         header("Connection: close");
         exit;
     }
     if ($Seite->getA() == null) {
         header("HTTP/1.0 404 Not Found");
         emoFatalError("Die gesuchte Seite kann leider nicht gefunden werden", "Die Seite, die Sie suchen, existiert nicht (mehr).<br />Vielleicht m&ouml;chten Sie die Suche auf der <a href=\"/\">Startseite</a> fortsetzen.", "multiCMS", "./multiCMS");
     }
     if (strpos($html, "%%%SEITE%%%") === false) {
         $html = str_replace("%%%PAGE%%%", $Seite->getCMSHTML($this->A->startseite, $this->ID), $html);
     } else {
         $html = str_replace("%%%SEITE%%%", $Seite->getCMSHTML($this->A->startseite, $this->ID), $html);
     }
     $metaTagDesc = $Seite->A("metaTagDescription");
     if ($metaTagDesc == "") {
         $StartSeite = new Seite($this->A->startseite);
         $StartSeite->loadMe();
         $metaTagDesc = $StartSeite->A("metaTagDescription");
     }
     $html = str_replace("%%%NAVIGATION%%%", $navi->getCMSHTML(0, $this->seite != 0 ? $this->seite : $this->A->startseite, $this->ID), $html);
     $html = str_replace("%%%HEADER%%%", $this->A->header, $html);
     $html = str_replace("%%%TITLE%%%", ($this->A->title != "" ? $this->A->title . " - " : "") . $Seite->A("header"), $html);
     #$html = str_replace("%%%SCRIPTS%%%",$Scripts->getCMSHTML($this->ID), $html);
     $html = str_replace("%%%DESCRIPTION%%%", $metaTagDesc, $html);
     $html = SeiteGUI::replaceFunctionCalls($html, $this);
     if (isset($_GET["contentOnly"])) {
         echo $Seite->getCMSHTML($this->A->startseite, $this->ID);
     } else {
         echo $html;
     }
 }
 private function getList($pid, $SeiteID, $DomainID)
 {
     $html = "";
     $Dom = new Domain($DomainID);
     $multiLang = false;
     try {
         $test = new MultiLanguage(-1);
         $userLang = CCMultiLanguage::getUserLanguage();
         if ($userLang != null and $userLang->getID() != null and $userLang->getID() != $Dom->A("DomainDefaultSpracheID")) {
             $multiLang = true;
         }
     } catch (ClassNotFoundException $e) {
     }
     while ($C = $this->getNextEntry()) {
         if ($multiLang) {
             $mL = MultiLanguage::getTranslation($userLang->getID(), "Navigation", $C->getID(), "name");
             if ($mL == null) {
                 continue;
             }
             $C->changeA("name", $mL);
         }
         $CA = $C->getA();
         if ($this->domainURL == "") {
             $D = new Domain($C->A("DomainID"));
             $this->domainURL = $D->getA()->url;
             if ($this->domainURL == "") {
                 $this->domainURL = "none";
             }
         }
         $sub = new mNavigationGUI();
         $sub->addOrderV3("sort", "ASC");
         $sub->addAssocV3("parentID", "=", $C->getID());
         $sub->addAssocV3("t1.DomainID", "=", $DomainID);
         $sub->addAssocV3("hidden", "=", "0");
         $sub->addJoinV3("Template", "activeTemplateID", "=", "TemplateID");
         $sub->addJoinV3(" Template", "inactiveTemplateID", "=", "TemplateID");
         $sub->addJoinV3("Seite", "SeiteID", "=", "SeiteID");
         $sub->setFieldsV3(array("t2.html as activeHTML", "t3.html as inactiveHTML", "t1.name", "t1.DomainID", "t1.SeiteID", "linkURL", "linkType", "displaySub", "t4.permalink", "httpsLink"));
         $sub->lCV3();
         $sub->subNavigation($this->isSubNavigation, $this->isSubNavigationRoot);
         $subOpened = new mNavigation();
         $subOpened->addAssocV3("parentID", "=", $C->getID());
         $subOpened->addAssocV3("SeiteID", "=", $SeiteID);
         $subOpened->lCV3();
         if ($CA->linkType == "separator") {
             $html .= "<div class=\"separator\">" . $CA->name . "</div>";
         }
         /*.= "
         			<li class=\"hld\" style=\"cursor:pointer;\" onclick=\"dd('naviul_".$C->getID()."');\"><img id=\"naviul_".$C->getID()."Img\" class=\"sslico\" src=\"./$this->domainURL/images/dd.gif\" title=\"Menü ausklappen\" />".$CA->name."</li>";
         		*/
         $rootDomain = "http" . ($CA->httpsLink == "1" ? "s" : "") . "://{$_SERVER['HTTP_HOST']}";
         if ($this->isSubNavigationRoot != null) {
             $rootDomain = $this->isSubNavigationRoot;
         }
         if ($CA->linkType == "cmsPage") {
             if (!isset($CA->permalink) or $CA->permalink == "") {
                 $link = "{$rootDomain}/index.php?p=" . $CA->SeiteID . "" . (isset($_GET["d"]) ? "&d={$_GET['d']}" : "") . "";
             } else {
                 $link = $rootDomain . "/" . ($this->isSubNavigation ? "" : $Dom->A("permalinkPrefix")) . $CA->permalink;
             }
             $html .= ($CA->SeiteID == $SeiteID or $subOpened->numLoaded() > 0) ? str_replace("%%%LINK%%%", "<a href=\"{$link}\">" . $CA->name . "</a>", $CA->activeHTML) : str_replace("%%%LINK%%%", "<a href=\"{$link}\">" . $CA->name . "</a>", $CA->inactiveHTML);
             #if(!isset($CA->permalink) OR $CA->permalink == "")
             $html = str_replace("%%%URL%%%", "?p=" . $CA->SeiteID . "" . (isset($_GET["d"]) ? "&d={$_GET['d']}" : "") . "", $html);
             #else
             #	$html = str_replace("%%%URL%%%", "page-".$CA->permalink, $html);
             $html = str_replace("%%%TEXT%%%", $CA->name, $html);
         }
         if ($CA->linkType == "url") {
             $html .= str_replace("%%%LINK%%%", "<a href=\"" . $CA->linkURL . "\">" . $CA->name . "</a>", $CA->inactiveHTML);
             #"<li class=\"hl\"><a href=\"".$CA->linkURL."\">".$CA->name."</a></li>";
             $html = str_replace("%%%URL%%%", $CA->linkURL, $html);
             $html = str_replace("%%%TEXT%%%", $CA->name, $html);
         }
         if ($CA->linkType == "HTML") {
             $html .= str_replace("%%%LINK%%%", "<a href=\"" . $CA->linkURL . "\">" . $CA->name . "</a>", $CA->activeHTML);
             #"<li class=\"hl\"><a href=\"".$CA->linkURL."\">".$CA->name."</a></li>";
             $html = str_replace("%%%URL%%%", $CA->linkURL, $html);
             $html = str_replace("%%%TEXT%%%", $CA->name, $html);
         }
         if ($sub->numLoaded() > 0) {
             if ($C->A("displaySub") == "1" or $subOpened->numLoaded() > 0 or $C->A("SeiteID") == $SeiteID) {
                 if ($Dom->A("horizontalNav") == "0") {
                     $html .= "<div class=\"subcategory\">" . $sub->getCMSHTML($C->getID(), $SeiteID, $DomainID) . "</div>";
                 } else {
                     $this->horizontalNav .= "<div class=\"subcategory\">" . $sub->getCMSHTML($C->getID(), $SeiteID, $DomainID) . "</div>";
                 }
             }
         }
     }
     return $html;
 }