Example #1
0
 public function getHTML($id)
 {
     if ($_SESSION["S"]->checkIfUserLoggedIn() == true) {
         return -1;
     }
     $es = $_SESSION["CurrentAppPlugins"]->getMenuEntries();
     $ts = $_SESSION["CurrentAppPlugins"]->getMenuTargets();
     $icons = $_SESSION["CurrentAppPlugins"]->getIcons();
     $appIco = $_SESSION["applications"]->getApplicationIcon($_SESSION["applications"]->getActiveApplication());
     if (isset($_COOKIE["phynx_color"]) and $_COOKIE["phynx_color"] != "standard") {
         $suffix = strrchr($appIco, ".");
         $newLogo = str_replace($suffix, ucfirst($_COOKIE["phynx_color"]) . $suffix, $appIco);
         if (file_exists("." . $newLogo)) {
             $appIco = $newLogo;
         }
     }
     // <editor-fold defaultstate="collapsed" desc="Aspect:jP">
     $newAppIco = Aspect::joinPoint("appLogo", $this, __METHOD__);
     if ($newAppIco != null) {
         $appIco = $newAppIco;
     }
     // </editor-fold>
     $appMenuHidden = "";
     $appMenuDisplayed = "";
     $appMenuActive = (!$_SESSION["S"]->isUserAdmin() and (!isset($_COOKIE["phynx_layout"]) or $_COOKIE["phynx_layout"] == "fixed" or $_COOKIE["phynx_layout"] == "horizontal" or $_COOKIE["phynx_layout"] == "desktop" or $_COOKIE["phynx_layout"] == "vertical"));
     // <editor-fold defaultstate="collapsed" desc="Aspect:jP">
     $aspectAppMenuActive = Aspect::joinPoint("appMenuActive", $this, __METHOD__);
     if ($aspectAppMenuActive !== null) {
         $appMenuActive = $aspectAppMenuActive;
     }
     // </editor-fold>
     $appIco = Environment::getS("ApplicationIcon:" . Applications::activeApplication(), $appIco);
     if ($appIco != "") {
         if (count($_SESSION["applications"]->getApplicationsList()) > 1 and !$_SESSION["S"]->isAltUser()) {
             echo "<img src=\"{$appIco}\" style=\"margin-left:10px;float:left;\" alt=\"Abmelden/Anwendung wechseln\" title=\"Abmelden/Anwendung wechseln\" onclick=\"" . Environment::getS("onLogout", "phynxContextMenu.start(this, 'Menu','1','Anwendung wechseln:','right');") . "\" />";
         } else {
             echo "<img src=\"{$appIco}\" style=\"margin-left:10px;float:left;\" alt=\"Abmelden\" title=\"Abmelden\" onclick=\"" . Environment::getS("onLogout", "userControl.doLogout();") . "\" />";
         }
     }
     $bigWorld = false;
     if (isset($_COOKIE["phynx_layout"]) and ($_COOKIE["phynx_layout"] == "desktop" or $_COOKIE["phynx_layout"] == "vertical")) {
         $bigWorld = true;
     }
     if (!$_SESSION["S"]->isUserAdmin()) {
         $userHiddenPlugins = mUserdata::getHiddenPlugins();
         $U = new mUserdata();
         $U->addAssocV3("typ", "=", "TTP");
         $B = new Button(Environment::getS("renameApplication:" . $_SESSION["applications"]->getActiveApplication(), $_SESSION["applications"]->getActiveApplication()), "application");
         $B->type("icon");
         $B->className($bigWorld ? "tabImg" : "smallTabImg");
         #".(($t == null OR $t == "big") ? "class=\"tabImg\"" : "class=\"smallTabImg\"")."
         $B->hasMouseOverEffect(false);
         $B->id("busyBox");
         #$appMenuHidden = $this->getAppMenuOrder("appMenuHidden");
         $appMenuDisplayed = $this->getAppMenuOrder("appMenuDisplayed");
         #if($appMenuDisplayed != "" AND $appMenuHidden == "")
         #	$appMenuHidden = implode(";", array_diff(array_values($es), explode(";", $appMenuDisplayed)));
     }
     $appMenuH = "\n\t\t\t<li id=\"appMenu_emptyList\" style=\"height:auto;" . ($appMenuHidden != "emptyList" ? "display:none;" : "") . "\">Ziehen Sie Einträge auf diese Seite, um sie aus dem Menü auszublenden und nur hier anzuzeigen.</li>";
     $appMenuD = "";
     if ($appMenuActive) {
         $es = self::sort($es, $appMenuDisplayed);
     }
     #, $appMenuHidden);
     echo "\n\t\t\t<div id=\"navTabsWrapper\">";
     if ($appMenuActive) {
         echo "\n\t\t\t<div\n\t\t\t\tclass=\"navBackgroundColor navBorderColor " . ($bigWorld ? "" : " smallTab") . " navTab\"\n\t\t\t\tid=\"SpellbookMenuEntry\"\n\t\t\t>\n\t\t\t\t<div onclick=\"contentManager.loadPlugin('contentScreen', 'Spellbook', 'SpellbookGUI;-');\" style=\"padding:3px;padding-right:7px;padding-top:7px;height:18px;\">\n\t\t\t\t{$B}" . ($bigWorld ? Environment::getS("renameApplication:" . $_SESSION["applications"]->getActiveApplication(), $_SESSION["applications"]->getActiveApplication()) : "") . "\n\t\t\t\t</div>\n\t\t\t</div>";
     }
     $collapsedTabs = Environment::getS("collapsedTabs", "0") == "1";
     foreach ($es as $key => $value) {
         if (isset($userHiddenPlugins[$value])) {
             continue;
         }
         $single = $_SESSION["CurrentAppPlugins"]->isCollectionOfFlip($value);
         $anyC = new anyC();
         $text = $anyC->loadLanguageClass($single);
         if ($text != null and $text->getMenuEntry() != "") {
             $key = $text->getMenuEntry();
         }
         $t = !$_SESSION["S"]->isUserAdmin() ? $U->getUDValueCached("ToggleTab{$value}") : "big";
         if ($t == null and $collapsedTabs) {
             $t = "small";
         }
         $key = Aspect::joinPoint("renameTab", $this, __METHOD__, array($key), $key);
         if (isset($_COOKIE["phynx_layout"]) and ($_COOKIE["phynx_layout"] == "vertical" or $_COOKIE["phynx_layout"] == "desktop")) {
             $t = "big";
         }
         #$emptyFrame = "contentLeft";
         #if(isset($ts[$value]) AND $ts[$value] == "contentLeft") $emptyFrame = "contentRight";
         #$onclick = "contentManager.emptyFrame('contentLeft'); contentManager.emptyFrame('contentRight'); contentManager.emptyFrame('contentScreen'); contentManager.loadFrame('".(isset($ts[$value]) ? $ts[$value] : "contentRight")."', '$value', -1, 0, '{$value}GUI;-');$('windows').update('');";
         $onclick = "contentManager.loadPlugin('" . (isset($ts[$value]) ? $ts[$value] : "contentRight") . "', '{$value}', '{$value}GUI;-');";
         $B = new Button($key, $icons[$value]);
         $B->type("icon");
         $B->style("float:left;margin-right:10px;");
         $BM = new Button("Reihenfolge ändern", "./images/i2/topdown.png");
         $BM->type("icon");
         $BM->style("float:right;margin-right:5px;");
         $BM->className("appMenuHandle");
         $appMenu = "\n\t\t\t<li\n\t\t\t\tid=\"appMenu_{$value}\"\n\t\t\t\tonmouseover = \"this.className = 'navBackgroundColor';\"\n\t\t\t\tonmouseout = \"this.className = '';\"\n\t\t\t>\n\t\t\t\t{$BM}\n\t\t\t\t<div\n\t\t\t\t\tonclick=\"appMenu.hide(); {$onclick}\"\n\t\t\t\t>\n\t\t\t\t{$B}<p>{$key}</p>\n\t\t\t\t</div>\n\t\t\t</li>";
         if (strpos($appMenuHidden, $value) !== false) {
             $appMenuH .= $appMenu;
         } else {
             $appMenuD .= $appMenu;
         }
         $style = (strpos($appMenuHidden, $value) !== false and $appMenuActive) ? "style=\"display:none;\"" : "";
         echo "\n\t\t\t\t\n\t\t\t\t<div\n\t\t\t\t\tid=\"" . $value . "MenuEntry\"\n\t\t\t\t\tclass=\"navBackgroundColor navBorderColor " . (($t == null or $t == "big") ? "" : " smallTab") . " navTab\"\n\t\t\t\t\t{$style}\n\t\t\t\t\t>\n\t\t\t\t\t<!--<img\n\t\t\t\t\t\tstyle=\"margin-top:-28px;float:left;\"\n\t\t\t\t\t\tid=\"" . $value . "TabMinimizer\"\n\t\t\t\t\t\tclass=\"navTabMinimizer\"\n\t\t\t\t\t\ttitle=\"Tab {$key} vergrößern/verkleinern\"\n\t\t\t\t\t\tonclick=\"toggleTab('{$value}');\"\n\t\t\t\t\t\tsrc=\"./images/i2/tabMinimize.png\" />-->\n\t\t\t\t\t\n\t\t\t\t\t<div onclick=\"{$onclick}\" style=\"padding:3px;padding-right:7px;padding-top:7px;height:18px;\">\n\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tid=\"" . $value . "MenuImage\"\n\t\t\t\t\t\t\ttitle=\"{$key}\"\n\t\t\t\t\t\t\t" . (($t == null or $t == "big") ? "class=\"tabImg\"" : "class=\"smallTabImg\"") . "\n\t\t\t\t\t\t\tsrc=\"{$icons[$value]}\" />\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t" . (($t == null or $t == "big") ? $key : "") . "\n\t\t\t\t\t</div>\n\t\t\t\t</div>";
     }
     echo "\n\t\t\t\t<div style=\"float:none;clear:both;border:0px;height:0px;width:0px;margin:0px;padding:0px;\"></div>\n\t\t\t</div>";
     /*
     			<div id=\"appMenuContainer\" class=\"backgroundColor0 navBorderColor\" style=\"display:none;\">
     				<ul style=\"min-height:50px;\" id=\"appMenuHidden\">$appMenuH</ul>
     				<p class=\"backgroundColor2\" style=\"cursor:pointer;background-image:url(./images/navi/down.png);background-repeat:no-repeat;background-position:95% 50%;\" onclick=\"if($('appMenuDisplayedContainer').style.display == 'none') new Effect.BlindDown('appMenuDisplayedContainer'); else new Effect.BlindUp('appMenuDisplayedContainer');\">Weitere Reiter</p>
     				<div id=\"appMenuDisplayedContainer\" style=\"display:none;\"><ul style=\"min-height:50px;\" id=\"appMenuDisplayed\">$appMenuD</ul><p>Um die Sortierung der Einträge zu übernehmen, muss die Anwendung <a href=\"#\" onclick=\"Installation.reloadApp(); return false;\">neu geladen werden</a>.</p></div>
     			</div>";*/
     #echo OnEvent::script("");
     if (!$_SESSION["S"]->isUserAdmin()) {
         $ud = new mUserdata();
         $al = $ud->getUDValue("noAutoLogout", "false");
         if ($al == "true") {
             echo "<script type=\"text/javascript\">contentManager.startAutoLogoutInhibitor();</script>";
         }
     }
     echo OnEvent::script("contentManager.isAltUser = "******"true" : "false") . ";");
     try {
         $c = get_class(Session::currentUser());
         $U = new $c(Session::currentUser()->getID());
         echo "<script type=\"text/javascript\">\$j.datepicker.setDefaults(\$j.datepicker.regional['" . $U->A("language") . "']); " . (Session::physion() ? "\$j('#navigation').hide();" : "") . "</script>";
     } catch (Exception $e) {
     }
 }