Example #1
0
 /**
  * 
  * @return string
  */
 public function getOriginalRequestUri()
 {
     return MultiLanguage::addLangToUrl($this->resolveRequestUri());
 }
 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;
 }
Example #3
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();
 }
Example #4
0
 /**
  * 
  * @return type
  */
 public function getBaseUrl()
 {
     $this->setBaseUrl(MultiLanguage::getBaseUrl());
     return parent::getBaseUrl();
 }
Example #5
0
<?php

@session_start();
@(include "MultiLanguage.class.php");
$Main = new MultiLanguage();
?>
<html>
<meta charset="UTF-8">
<title>Example Script</title>
<body>
	<b>Change Language : </b> 
		<a href="?language=english">English</a> &nbsp;&nbsp;&nbsp;
		<a href="?language=spanish">Spanish</a> &nbsp;&nbsp;&nbsp;
		<a href="?language=french">French</a> &nbsp;&nbsp;&nbsp;
		<hr>
	<table border="1" width="50%">
		<caption>Default Language Demo</caption>
		<tr>
			<th><?php 
echo ucfirst($_SESSION['language']);
?>
</th>
		</tr>
		<tr>
			<td><?php 
$Main->LanguageString("Hello");
?>
</td>
		</tr>
		<tr>
			<td><?php