Example #1
0
 public function getHTML($id, $page)
 {
     $entries = $_SESSION["CurrentAppPlugins"]->getMenuEntries();
     $icons = $_SESSION["CurrentAppPlugins"]->getIcons();
     $targets = $_SESSION["CurrentAppPlugins"]->getMenuTargets();
     $appMenuDisplayed = MenuGUI::getAppMenuOrder("appMenuDisplayed");
     if ($appMenuDisplayed != "") {
         $appMenuDisplayed = explode(";", $appMenuDisplayed);
     } else {
         $appMenuDisplayed = $entries;
     }
     ksort($entries);
     $request = array_values($entries);
     $xml = self::getSpell($request);
     #$AP3 = new AppPlugins("customer");
     #$plugins = array_merge($plugins, $AP3->getAllPlugins());
     #$menu = array_merge($menu, array_flip($AP3->getAllMenuEntries()));
     #$icons = array_merge($icons, $AP3->getIcons());
     #$plugins3 = array_flip($AP3->getAllPlugins());
     #print_r($plugins3);
     $AP = new AppPlugins(Applications::activeApplication());
     $plugins = array_flip($AP->getAllPlugins());
     $html = "";
     $html .= "<div style=\"float:right;width:160px;padding-top:20px;\" id=\"containerSortTabs\">" . $this->getSortable(false) . "</div>\n\t\t\t<div style=\"margin-right:160px;\">";
     $U = new mUserdata();
     $U->addAssocV3("typ", "=", "TTP");
     $collapsedTabs = Environment::getS("collapsedTabs", "0") == "1";
     foreach ($entries as $key => $value) {
         $text = "";
         if ($xml !== false) {
             foreach ($xml->plugin as $xmlp) {
                 if ($xmlp->name == $value) {
                     $text = $xmlp->description;
                 }
             }
         }
         if (isset($plugins[$value])) {
             unset($plugins[$value]);
         }
         $BG = new Button("Plugin {$key} öffnen", "navigation", "icon");
         $BG->onclick("contentManager.loadPlugin('" . (isset($targets[$value]) ? $targets[$value] : "contentRight") . "', '{$value}', '{$value}GUI;-');");
         $BG->style("float:right;margin-top:-7px;");
         $B = new Button($key, $icons[$value], "icon");
         $B->style("float:left;margin-right:10px;margin-top:-7px;margin-left:-5px;");
         $I = new HTMLInput("usePlugin{$value}", "checkbox", in_array($value, $appMenuDisplayed) ? "1" : "0");
         $I->id("usePlugin{$value}");
         $I->onchange("if(this.checked) { Menu.showTab('{$value}'); \$j('#minPlugin{$value}').prop('disabled', ''); } else { Menu.hideTab('{$value}'); \$j('#minPlugin{$value}').prop('disabled', 'disabled'); }");
         $t = !$_SESSION["S"]->isUserAdmin() ? $U->getUDValueCached("ToggleTab{$value}") : "big";
         if ($t == null and $collapsedTabs) {
             $t = "small";
         }
         if ($t == null) {
             $t = "big";
         }
         $IM = new HTMLInput("minPlugin{$value}", "checkbox", $t == "big" ? "0" : "1");
         $IM->id("minPlugin{$value}");
         $IM->onchange("toggleTab('{$value}');");
         if (isset($_COOKIE["phynx_layout"]) and ($_COOKIE["phynx_layout"] == "vertical" or $_COOKIE["phynx_layout"] == "desktop")) {
             $IM->isDisabled(true);
         }
         if (!in_array($value, $appMenuDisplayed)) {
             $IM->isDisabled(true);
         }
         #border-width:1px;border-style:solid;
         $html .= "\n\t\t\t<div style=\"width:33%;float:left;\">\n\t\t\t\t<div style=\"margin:10px;\" class=\"borderColor1 spell\">\n\t\t\t\t\t<div class=\"backgroundColor2\" style=\"padding:10px;padding-bottom:5px;\">\n\t\t\t\t\t\t{$BG}{$B}<h2 style=\"margin-bottom:0px;margin-top:0px;\">{$key}</h2>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"padding:7px;\">\n\t\t\t\t\t\t{$I}<label style=\"float:none;width:200px;text-align:left;display:inline;margin-left:10px;font-wight:normal;\" for=\"usePlugin{$value}\">Plugin verwenden</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"padding:7px;padding-top:0px;\">\n\t\t\t\t\t\t{$IM}<label style=\"float:none;width:200px;text-align:left;display:inline;margin-left:10px;font-wight:normal;\" for=\"minPlugin{$value}\">Reiter minimiert</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t" . ($xml !== false ? "<div style=\"padding:7px;height:115px;overflow:auto;\">{$text}</div>" : "") . "\n\t\t\t\t</div>\n\t\t\t</div>";
     }
     $html .= "</div><h2 style=\"clear:both;padding-top:50px;\">Admin-Plugins und Plugins ohne eigenen Reiter</h2><div style=\"margin-right:160px;\">";
     $icons = $AP->getIcons();
     $plugins = array_flip($plugins);
     $menu = array_flip($AP->getAllMenuEntries());
     $AP2 = new AppPlugins("plugins");
     $plugins = array_merge($plugins, $AP2->getAllPlugins());
     $menu = array_merge($menu, array_flip($AP2->getAllMenuEntries()));
     $icons = array_merge($icons, $AP2->getIcons());
     $plugins2 = array_flip($AP2->getAllPlugins());
     $request = array_values($plugins);
     $xml = self::getSpell($request);
     ksort($plugins);
     foreach ($plugins as $key => $value) {
         if (isset($menu[$value])) {
             $key = $menu[$value];
         }
         $text = "";
         if ($xml !== false) {
             foreach ($xml->plugin as $xmlp) {
                 if ($xmlp->name == $value) {
                     $text = $xmlp->description;
                 }
             }
         }
         if ($text == "" or $text == "-") {
             continue;
         }
         if (!isset($plugins2[$value]) and substr($AP->getFolderOfPlugin($value), 0, 3) == "../") {
             continue;
         }
         if (isset($plugins2[$value]) and substr($AP2->getFolderOfPlugin($value), 0, 3) == "../") {
             continue;
         }
         if (!isset($plugins2[$value])) {
             $isAdmin = $AP->getIsAdminOnly($value);
         }
         if (isset($plugins2[$value])) {
             $isAdmin = $AP2->getIsAdminOnly($value);
         }
         $B = new Button($key, $icons[$value], "icon");
         $B->style("float:left;margin-right:10px;margin-top:-7px;margin-left:-5px;");
         #border-width:1px;border-style:solid;
         $html .= "\n\t\t\t<div style=\"width:33%;float:left;\">\n\t\t\t\t<div style=\"margin:10px;border-radius:5px;\" class=\"borderColor1 spell\">\n\t\t\t\t\t<div class=\"backgroundColor2\" style=\"padding:10px;padding-bottom:5px;\">\n\t\t\t\t\t\t{$B}<span style=\"float:right;margin-top:7px;\">" . ($isAdmin ? "Admin!" : "") . "</span><h2  style=\"margin-bottom:0px;margin-top:0px;\">{$key}</h2>\n\t\t\t\t\t</div>\n\t\t\t\t\t" . ($xml !== false ? "<div style=\"padding:7px;height:115px;overflow:auto;\">{$text}</div>" : "") . "\n\t\t\t\t</div>\n\t\t\t</div>";
     }
     $html .= "</div>";
     #echo "<pre>";
     #print_r($menu);
     #echo "</pre>";
     return $html;
 }