public function getHTML($id) { try { $U = new mUserdata(); $U->addAssocV3("typ", "=", $_SESSION["applications"]->getActiveApplication() . "DesktopLink"); $U->addAssocV3("UserID", "=", $_SESSION["S"]->getCurrentUser()->getID()); $U->addOrderV3("wert"); $U->addOrderV3("UserdataID"); $U->lCV3(); } catch (Exception $e) { return ""; } $html = ""; while ($t = $U->getNextEntry()) { $e = explode(";", $t->A("name")); $v = explode(";", $t->A("wert")); $B = new Button($v[2], $v[1]); $B->type("icon"); $B->onclick("DesktopLink.hide(); contentManager.loadFrame('{$e['2']}', '{$e['0']}', '{$e['1']}')"); $BS = new Button("Einstellungen", "./images/i2/settings.png"); $BS->type("icon"); $BS->className("DesktopLinkSettings"); $BS->rmePCR("DesktopLink", "", "editInWindow", $t->getID(), "Popup.displayNamed('DesktopLinkPopup','Desktop-Link bearbeiten', transport);"); $BM = new Button("Verschieben", "./images/i2/moveLeftRight.png"); $BM->type("icon"); $BM->className("DesktopLinkHandler"); $html .= "<li id=\"DesktopLink_" . $t->getID() . "\" class=\"DesktopLinkIcon\">{$BS}{$BM}{$B}" . "<p>" . $v[2] . "</p></li>"; } if ($html != "") { echo "<ul id=\"DesktopLinkElements\">{$html}</ul><div style=\"clear:both;\"></div>"; } }
public function copyUserRestrictions($fromUserId) { $mUD = new mUserdata(); $mUD->addAssocV3("UserID", "=", $fromUserId); $mUD->lCV3(); $cUD = new mUserdata(); $cUD->addAssocV3("UserID", "=", $this->ID); $cUD->addAssocV3("typ", "=", "uRest", "AND", "1"); $cUD->addAssocV3("typ", "=", "relab", "OR", "1"); $cUD->addAssocV3("typ", "=", "hideF", "OR", "1"); $cUD->addAssocV3("typ", "=", "pSpec", "OR", "1"); $cUD->addAssocV3("typ", "=", "pHide", "OR", "1"); $cUD->lCV3(); if ($cUD->getNextEntry() != null) { die("Target userdata not empty!"); } while ($t = $mUD->getNextEntry()) { $A = $t->getA(); $A->UserID = $this->ID; $nU = new Userdata(-1); $nU->setA($A); $nU->newMe(); } }
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; }
public function toggleTab($plugin, $mode = null) { $U = new mUserdata(); $U->addAssocV3("typ", "=", "TTP"); $t = $U->getUDValueCached("ToggleTab{$plugin}"); $collapsedTabs = Environment::getS("collapsedTabs", "0") == "1"; if ($t == null and $collapsedTabs) { $t = "small"; } if ($mode != null) { $t = $mode; } if ($t == null or $t == "big") { $U->setUserdata("ToggleTab{$plugin}", "small", "TTP"); } else { $U->setUserdata("ToggleTab{$plugin}", "big", "TTP"); } }
public static function isDisallowedTo($restriction) { $UD = new mUserdata(); $UD->addAssocV3("wert", "=", $restriction); $UD->addAssocV3("UserID", "=", $_SESSION["S"]->getCurrentUser()->getID()); try { $sUD = $UD->getNextEntry(); } catch (StorageException $e) { return true; } if ($sUD != null) { return false; } else { return true; } }
/** * Get login data for current user * * @param string $name * @return LoginData */ public static function getU($name, $userID = null) { if ($userID == null) { $userID = Session::currentUser()->getID(); } $UD = new mUserdata(); $UD->addAssocV3("UserID", "=", $userID); $UD->addAssocV3("name", "=", $name); $e = $UD->getNextEntry(); if ($e == null) { return null; } $LD = new LoginData($e->getID()); $LD->loadMe(); return $LD; }