public static function DGParser($w)
 {
     $T = new Template($w);
     $T->loadMe();
     if ($T != null and $T->getA() != null) {
         return $T->getA()->name;
     } else {
         return "-";
     }
 }
 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;
     }
 }
 public function activate($id)
 {
     $S = new Template($id);
     $S->changeA("aktiv", "1");
     $this->addAssocV3("aktiv", "=", "1");
     $this->addAssocV3("templateType", "=", $S->getA()->templateType);
     while ($t = $this->getNextEntry()) {
         $t->changeA("aktiv", "0");
         $t->saveMe();
     }
     $S->saveMe();
 }
 public function getCMSHTML(Seite $Seite)
 {
     #$this->setParser("text","Util::nothingParser");
     $Template = new Template($this->A->TemplateID);
     $html = $Template->getA()->html;
     $text = $this->getA()->text;
     #if($Template->getA()->templateType == "contentTemplate") $text = nl2br($text);
     #if($Template->getA()->templateType == "dlTemplate") $text = nl2br($text);
     #$text = ereg_replace("src=\"([0-9a-zA-Z/\. ]*)\"","test=\"\\1\"", $text);
     $text = preg_replace_callback("=src\\=\"([0-9a-zA-Z/\\. ]*)\"=", "preg_callback", $text);
     if ($this->getA()->contentType == "preset") {
         $T = new Template($this->getA()->presetTemplateID);
         $presetHTML = $T->getA()->html;
         if ($this->getA()->formHandlerID != 0) {
             $presetHTML = str_replace("%%%HANDLER%%%", $this->getA()->formHandlerID, $presetHTML);
         }
         $html = str_replace("%%%TEXT%%%", $presetHTML, $html);
     }
     $html = str_replace("%%%HEADER%%%", $this->getA()->header, $html);
     if ($this->getA()->contentType == "downloads") {
         $dls = new DownloadsGUI();
         $dls->addAssocV3("ContentID", "=", $this->ID);
         $dls->addOrderV3("datum", "DESC");
         $html = str_replace("%%%DOWNLOADS%%%", $dls->getCMSHTML(), $html);
     }
     if ($this->getA()->contentType == "php") {
         $n = $this->getA()->customContent;
         $c = new $n();
         $html = str_replace("%%%TEXT%%%", $c->getCMSHTML($Seite, $this), $html);
     }
     $html = str_replace("%%%TEXT%%%", $text, $html);
     $html = str_replace("%%%CONTENTID%%%", $this->ID, $html);
     if ($this->A("ContentImage") != "") {
         $imageSmall = str_replace(basename($this->A("ContentImage")), "small/" . basename($this->A("ContentImage")), $this->A("ContentImage"));
         $imageBig = str_replace(basename($this->A("ContentImage")), "big/" . basename($this->A("ContentImage")), $this->A("ContentImage"));
         $html = str_replace("%%%IMAGE%%%", "<a href=\"/multiCMS/specifics/{$imageBig}\" rel=\"lightbox\"><img class=\"contentImage\" src=\"/multiCMS/specifics/{$imageSmall}\" /></a>", $html);
     }
     $html = SeiteGUI::replaceFunctionCalls($html, $this);
     return $html;
 }
Example #5
0
 public function getCMSHTML($startseite = 0, $DomainID = null)
 {
     $this->loadMe();
     try {
         $test = new MultiLanguage(-1);
         $Dom = new Domain($DomainID);
         $contentLanguage = $Dom->A("DomainDefaultSpracheID");
         $userLang = CCMultiLanguage::getUserLanguage();
         if ($userLang != null and $userLang->getID() != null and $userLang->getID() != $Dom->A("DomainDefaultSpracheID")) {
             $contentLanguage = $userLang->getID();
             $mL = MultiLanguage::getTranslation($userLang->getID(), "Seite", $this->getID(), "header");
             if ($mL != null) {
                 $this->changeA("header", $mL);
             }
         }
     } catch (ClassNotFoundException $e) {
     }
     try {
         new Tracker(-1);
         Tracker::trackUser($this->ID, $this->A->DomainID, "page");
         Tracker::trackPage($this->ID, $this->A->DomainID);
     } catch (ClassNotFoundException $e) {
     }
     $Template = new Template($this->A->TemplateID);
     $html = $Template->getA()->html;
     $html = str_replace("%%%HEADER%%%", $this->A("header"), $html);
     $html = str_replace("%%%DOMAIN%%%", strtolower($_SERVER["HTTP_HOST"]), $html);
     $html = SeiteGUI::replaceFunctionCalls($html, $this);
     $Contents = new mContentGUI();
     $Contents->addOrderV3("sort", "ASC");
     $Contents->addAssocV3("SeiteID", "=", $this->ID);
     $Contents->addAssocV3("ContentSpracheID", "=", "0", "AND", "2");
     if (isset($contentLanguage)) {
         $Contents->addAssocV3("ContentSpracheID", "=", $contentLanguage, "OR", "2");
     }
     $Contents->lCV3();
     $content = "";
     while ($C = $Contents->getNextEntry()) {
         $CGUI = $C->getGUIClass();
         $content .= $CGUI->getCMSHTML($this);
     }
     if (!isset($_GET["contentOnly"])) {
         $html = str_replace("%%%CONTENT%%%", $content, $html);
     } else {
         $html = $content;
     }
     if ($Contents->numLoaded() == 0) {
         $nS = new SeiteGUI($startseite);
     }
     return $Contents->numLoaded() != 0 ? $html : $nS->getCMSHTML();
 }