コード例 #1
0
 public function saveContextMenu($identifier, $key)
 {
     switch ($identifier) {
         case "1":
             setcookie("phynx_color", $key, time() + 3600 * 24 * 3650, "/");
             break;
         case "2":
             setcookie("phynx_layout", $key, time() + 3600 * 24 * 3650, "/");
             break;
         case "3":
             $ud = new mUserdata();
             $ud->setUserdata("noAutoLogout", $key);
             break;
     }
 }
コード例 #2
0
ファイル: OpenWeatherMap.class.php プロジェクト: nemiah/fheME
 public function apiKey()
 {
     if (self::$apiKey === null) {
         self::$apiKey = mUserdata::getGlobalSettingValue("OWMApiKey", "");
     }
     return self::$apiKey;
 }
コード例 #3
0
ファイル: Filelink.class.php プロジェクト: nemiah/trinityDB
 public static function publicPath($for)
 {
     $publicPath = mUserdata::getGlobalSettingValue("filelinkPublicPath");
     if (substr($publicPath, -1) != "/") {
         $publicPath .= "/";
     }
     return $publicPath . self::makeDir($for) . "/";
 }
コード例 #4
0
 public function getPopupEinstellungen()
 {
     $F = new HTMLForm("allgemeineWerte", array("OWMApiKey"));
     $F->getTable()->setColWidth(1, 120);
     $F->setValue("OWMApiKey", mUserdata::getGlobalSettingValue("OWMApiKey", ""));
     $F->setSaveRMEPCR("Speichern", "", "mOpenWeatherMap", "-1", "saveEinstellungen", OnEvent::closePopup("mOpenWeatherMap"));
     echo $F;
 }
コード例 #5
0
 public function createNew($targetClassName, $targetClassID, $targetFrame)
 {
     $MU = new mUserdata();
     $class = new $targetClassName($targetClassID);
     list($icon, $name) = $class->getDesktopLink();
     $name = str_replace(";", "", $name);
     $MU->setUserdata("{$targetClassName};{$targetClassID};{$targetFrame}", "000;{$icon};{$name}", $_SESSION["applications"]->getActiveApplication() . "DesktopLink");
 }
コード例 #6
0
ファイル: UDStorage.class.php プロジェクト: nemiah/poolPi
 function saveSingle2($forwhat, $thisID, $A)
 {
     $a = $this->loadSingle2($forwhat, $thisID);
     foreach ($A as $key => $value) {
         $mU = new mUserdata();
         $mU->setUserdata($key, $value, $forwhat);
         if ($value != "") {
             $a->{$key} = "doNotDeleteThisUserdata";
         }
     }
     foreach ($a as $key => $value) {
         if ($value != "doNotDeleteThisUserdata") {
             $mU = new mUserdata();
             $mU->delUserdata($key);
         }
     }
 }
コード例 #7
0
ファイル: Users.class.php プロジェクト: nemiah/projectMankind
 public static function getUsers()
 {
     if (mUserdata::getGlobalSettingValue("AppServer", "") != "") {
         $U = new Users();
         $U->getAppServerUsers();
     } else {
         $U = new Users();
         $U->addAssocV3("isAdmin", "=", "0");
     }
     return $U;
 }
コード例 #8
0
ファイル: Environment.class.php プロジェクト: nemiah/poolPi
 public function customize()
 {
     try {
         $active = mUserdata::getGlobalSettingValue("activeCustomizer");
         if ($active == null) {
             return;
         }
         $this->customizer = new $active();
         $this->customizer->customizeClass($this);
     } catch (Exception $e) {
     }
 }
コード例 #9
0
ファイル: Users.class.php プロジェクト: nemiah/poolPi
 public static function getUsers($type = 0)
 {
     $LD = LoginData::get("ADServerUserPass");
     if (mUserdata::getGlobalSettingValue("AppServer", "") != "") {
         $U = new Users();
         $U->getAppServerUsers();
     } elseif ($LD != null and $LD->A("server") != "") {
         $U = new LoginAD();
         $U->getUsers();
     } else {
         $U = new Users();
         $U->addAssocV3("isAdmin", "=", "0");
         $U->addAssocV3("UserType", "=", $type);
     }
     return $U;
 }
コード例 #10
0
ファイル: GUITabFactory.class.php プロジェクト: nemiah/poolPi
 public function buildTabBar()
 {
     $widths = Aspect::joinPoint("changeWidths", $this, __METHOD__);
     if ($widths == null and $this->size == "CRM") {
         $widths = array(700);
     }
     if ($this->size == "defaultLeft") {
         $widths = array(410);
     }
     $cTab = mUserdata::getUDValueS("TabBarLastTab{$this->className}", "none");
     $cTab = Aspect::joinPoint("lastTab", $this, __METHOD__, array($this->className, $cTab), $cTab);
     if (count($this->tabBar) == 0) {
         return "";
     }
     $bar = "";
     if (count($this->tabBar) > 0) {
         $bar = "\n\t\t\t<div style=\"width:{$widths['0']}px;margin-top:30px;padding-left:10px;padding-bottom:5px;\" class=\"backgroundColor4\">";
     }
     foreach ($this->tabBar as $value) {
         $B = new Button($value[1], $value[2]);
         $B->type("icon");
         $B->style("float:left;margin-right:5px;");
         if (!is_object($value[0])) {
             $id = "null";
             $onClick = $value[0];
         } else {
             $id = get_class($value[0]);
             $onClick = "Interface.TabBarActivate(this, '{$id}', '{$this->className}');";
         }
         $bar .= "\n\t\t\t\t<div\n\t\t\t\t\tid=\"tab_{$id}\"\n\t\t\t\t\tstyle=\"float:left;width:110px;padding:3px;cursor:pointer;-moz-user-select:none;margin-top:5px;overflow:hidden;white-space:nowrap;\"\n\t\t\t\t\tonmouseover=\"if(this.className != 'navBackgroundColor') this.className = 'backgroundColor2';\"\n\t\t\t\t\tonmouseout=\"if(this.className != 'navBackgroundColor') this.className = '';\"\n\t\t\t\t\tonclick=\"{$onClick}\">\n\t\t\t\t\t{$B}\n\t\t\t\t\t<p style=\"margin-top:3px;padding:0px;padding-top:5px;\">{$value['1']}</p>\n\t\t\t\t</div>";
         if ($id == $cTab) {
             $bar .= "<script type=\"text/javascript\">Interface.TabBarActivate(\$('tab_{$id}'), '{$id}');</script>";
         }
     }
     $bar .= "<div style=\"clear:both;\"></div>\n\t\t\t</div>\n\t\t\t<div style=\"clear:both;margin-bottom:-5px;\"></div>";
     foreach ($this->tabBar as $key => $value) {
         if (!is_object($value[0])) {
             continue;
         }
         $bar .= "<div id=\"" . get_class($value[0]) . "\" style=\"display:none;" . ($this->tabContainer[$key] === true ? "padding:10px;" : "") . "\"><p class=\"prettyTitle\">" . $this->tabBar[$key][1] . "</p>" . $value[0]->getHTML(-1, 0) . "</div>";
     }
     return $bar;
 }
コード例 #11
0
 public function setSaveCheckListUD($targetClass, $identifier = "", $checkedByDefault = true, $onSuccessFunction = null)
 {
     $this->saveMode = "custom";
     if ($onSuccessFunction != null and strpos($onSuccessFunction, "function(") !== 0) {
         $onSuccessFunction = "function(transport){ {$onSuccessFunction} }";
     }
     $value = mUserdata::getUDValueS("{$identifier}{$targetClass}", "");
     if ($checkedByDefault and !$value) {
         foreach ($this->fields as $field) {
             $this->setValue($field, "1");
         }
     }
     if ($value != "") {
         $value = explode(",", $value);
         foreach ($value as $field) {
             $this->setValue($field, "1");
         }
     }
     $B = new Button("Speichern", "./images/i2/save.gif", "icon");
     $B->onclick("var submitValues = ''; \$j.each(\$j('#{$this->id}').serializeArray(), function(k, v) { submitValues += (submitValues != '' ? ',' : '')+v.name; }); contentManager.rmePCR('mUserdata', '-1', 'setUserdata', ['{$identifier}{$targetClass}', submitValues]" . ($onSuccessFunction != null ? ", {$onSuccessFunction}" : "") . ");");
     $B->style("float:right;margin-top:-25px;margin-right:3px;");
     $this->saveButtonCustom = $B;
     $this->onSubmit = "return false;";
 }
コード例 #12
0
ファイル: CCPage.class.php プロジェクト: nemiah/fheME
 public function customize()
 {
     if (defined("PHYNX_FORBID_CUSTOMIZERS")) {
         return;
     }
     try {
         $active = mUserdata::getGlobalSettingValue("activeCustomizer");
         if ($active == null) {
             return;
         }
         $this->customizer = new $active();
     } catch (Exception $e) {
     }
 }
コード例 #13
0
ファイル: Util.class.php プロジェクト: nemiah/fheME
 public static function eK()
 {
     return mUserdata::getGlobalSettingValue(implode("", array_map("chr", array(0 => 101, 1 => 110, 2 => 99, 3 => 114, 4 => 121, 5 => 112, 6 => 116, 7 => 105, 8 => 111, 9 => 110, 10 => 75, 11 => 101, 12 => 121))));
 }
コード例 #14
0
 public function updateAllTables()
 {
     $apps = Applications::getList();
     $apps["plugins"] = "plugins";
     #$apps["plugins"] = "ubiquitous";
     $currentPlugins = $_SESSION["CurrentAppPlugins"];
     $return = array();
     foreach ($apps as $app) {
         $AP = $_SESSION["CurrentAppPlugins"] = new AppPlugins($app);
         $AP->scanPlugins("plugins");
         $p = array_flip($AP->getAllPlugins());
         #Applications::i()->setActiveApplication($app); //or the autoloader won't work; yes, it does because of addClassPath later on
         foreach ($p as $key => $value) {
             if ($key == "CIs") {
                 continue;
             }
             if ($key == "mInstallation") {
                 continue;
             }
             $return[$value] = "Keine Collection-Klasse!";
             addClassPath(Util::getRootPath() . $app . "/" . $AP->getFolderOfPlugin($key) . "/");
             try {
                 $c = new $key();
             } catch (ClassNotFoundException $e) {
                 $key2 = $key . "GUI";
                 try {
                     $c = new $key2();
                 } catch (ClassNotFoundException $e2) {
                     continue;
                 }
             }
             if (!$c->checkIfMyDBFileExists()) {
                 $return[$value] = "Keine DB-Datei!";
             } else {
                 if ($c->checkIfMyTableExists()) {
                     $return[$value] = $c->checkMyTables(true);
                 } else {
                     #if(!$c->checkIfMyTableExists())
                     $return[$value] = $c->createMyTable(true);
                 }
             }
         }
     }
     mUserdata::setUserdataS("DBVersion", Phynx::build(), "", -1);
     $_SESSION["CurrentAppPlugins"] = $currentPlugins;
     return $return;
 }
コード例 #15
0
ファイル: HTMLGUIX.class.php プロジェクト: nemiah/fheME
 function getBrowserHTML($lineWithId = -1, $useBPS = true)
 {
     T::load(Util::getRootPath() . "libraries");
     $canDelete = mUserdata::isDisallowedTo("cantDelete" . $this->className);
     #$canEdit = mUserdata::isDisallowedTo("cantEdit".$this->className);
     if (!$canDelete) {
         $this->showTrash = false;
     }
     #if(!$canEdit) //KILLS SEARCH-FIELD!!
     #	$this->showEdit = false;
     $bps = BPS::getAllProperties("m" . $this->className . "GUI");
     if (!$useBPS) {
         $bps = false;
     }
     $GUIF = $this->GUIFactory;
     $GUIF->setMultiPageDetails($this->multiPageDetails);
     $GUIF->setTableMode($this->displayMode);
     $GUIF->options($this->showTrash, $this->showEdit, $this->showNew);
     if ($this->blacklists != null) {
         $GUIF->blacklists($this->blacklists);
     }
     if (isset($bps["selectionMode"])) {
         $GUIF->selection($bps["selectionMode"]);
     }
     #$GUIF->features($this->features);
     #$this->multiPageDetails["target"] = $this->frame;#"contentRight";
     #$GUIF->setMultiPageDetails($this->multiPageDetails);
     if ($this->targetFrame != null) {
         $GUIF->targetFrame($this->targetFrame);
     }
     $E = $this->object->getNextEntry();
     if ($this->attributes == null and $E != null) {
         $this->attributes = PMReflector::getAttributesArrayAnyObject($E->getA());
     }
     #if($E == null) //To fix display error when no entry
     #	$this->attributes = array("");
     if ($this->caption == null and $this->caption !== false) {
         $this->caption($this->displayMode == "BrowserLeft" ? $this->name == null ? $this->className : $this->name : "");
     }
     #"Bitte ".($this->name == null ? $this->className : $this->name)." auswählen:");
     $Tab = $GUIF->getTable($E == null ? array("") : $this->attributes, $this->colStyle, $this->caption);
     if ($this->tableWeight) {
         $Tab->weight($this->tableWeight);
     }
     $Tab->setTableID("Browserm{$this->className}");
     $Tab->addTableClass("contentBrowser");
     if ($this->useScreenHeight) {
         $Tab->useScreenHeight();
     }
     if ($this->header != null and $this->object->numLoaded() > 0) {
         $Tab->addHeaderRow($this->header);
     }
     if ($lineWithId == -1) {
         if ($this->showQuicksearch) {
             $GUIF->buildQuickSearchLine();
         }
         #if($this->multiPageDetails["total"] > $this->multiPageDetails["perPage"])
         if ($this->showPageFlip) {
             $GUIF->buildFlipPageLine("top");
         }
         if ($this->object->isFiltered()) {
             $GUIF->buildFilteredWarningLine($this->object->isFilteredLabel());
         }
         $GUIF->buildNewEntryLine(($this->name == null ? $this->className : $this->name) . " neu anlegen");
     }
     $this->object->resetPointer();
     $DisplayGroup = null;
     while ($E = $this->object->getNextEntry()) {
         /**
          * DisplayGroup
          */
         if ($lineWithId == -1 and $this->displayGroup != null and $DisplayGroup != $E->A($this->displayGroup[0])) {
             if ($this->displayGroup[1] != null) {
                 $DGP = explode("::", $this->displayGroup[1]);
                 $GUIF->buildGroupLine(Util::invokeStaticMethod($DGP[0], $DGP[1], array($E->A($this->displayGroup[0]), $E)));
             } else {
                 $GUIF->buildGroupLine($E->A($this->displayGroup[0]));
             }
         }
         $Line = array();
         foreach ($this->attributes as $attributeName) {
             $LineContent = $E->A($attributeName);
             if (isset($this->parsers[$attributeName])) {
                 $LineContent = $this->invokeParser($this->parsers[$attributeName], $LineContent, $E);
             } else {
                 $LineContent = htmlspecialchars($LineContent);
             }
             $Line[] = $LineContent;
         }
         $GUIF->buildLine($E->getID(), $Line);
         if ($this->displayGroup != null) {
             $DisplayGroup = $E->A($this->displayGroup[0]);
         }
     }
     if ($lineWithId == -1) {
         if ($this->object->isFiltered()) {
             $GUIF->buildFilteredWarningLine($this->object->isFilteredLabel());
         }
         if ($this->multiPageDetails["total"] > $this->multiPageDetails["perPage"] and $this->showPageFlip) {
             $GUIF->buildFlipPageLine("bottom");
         }
         if ($this->object->numLoaded() == 0) {
             $GUIF->buildNoEntriesLine();
         }
     } else {
         return $Tab->getHTMLForUpdate();
     }
     $prepend = "";
     foreach ($this->prepended as $PE) {
         $prepend .= $PE;
     }
     $appended = "";
     foreach ($this->appended as $PE) {
         $appended .= $PE;
     }
     return "<div class=\"browserContainer contentBrowser\">" . $prepend . $this->sideButtons($bps) . $GUIF->getContainer($Tab, $this->caption, $appended, $this->topButtons($bps)) . "</div>" . str_replace("%CLASSNAME", $this->className, $this->sortable) . $this->tip;
 }
コード例 #16
0
ファイル: User.class.php プロジェクト: nemiah/projectMankind
 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();
     }
 }
コード例 #17
0
 /**
  * Filters table data by specified categories.
  * 
  * @return Boolean True if filters are applied
  */
 protected function filterCategories()
 {
     $fC = false;
     if (PMReflector::implementsInterface(get_class($this), "iCategoryFilter")) {
         $mU = new mUserdata();
         $K = $mU->getUDValue("filteredCategoriesInHTMLGUI" . $this->getClearClass());
         $F = $this->getCategoryFieldName();
         if ($K != null and $K != "") {
             $Ks = explode(";", $K);
             foreach ($Ks as $k => $v) {
                 $this->addAssocV3("{$F}", "=", $v, $k == "0" ? "AND" : "OR", "fCs");
             }
             $fC = true;
         }
     }
     $this->isFiltered = $fC;
     if (!PMReflector::implementsInterface(get_class($this), "iSearchFilter")) {
         return $fC;
     }
     $mU = new mUserdata();
     $K = $mU->getUDValue("searchFilterInHTMLGUI" . $this->getClearClass());
     $F = $this->getSearchedFields();
     if ($K == null or $K == "") {
         return $fC;
     } else {
         foreach ($F as $k => $v) {
             $this->addAssocV3("{$v}", "LIKE", '%' . $K . '%', $k == 0 ? "AND" : "OR", "sfs");
         }
     }
     $this->isFiltered = true;
     return true;
 }
コード例 #18
0
ファイル: SpellbookGUI.class.php プロジェクト: nemiah/fheME
 public function getSortable($echo)
 {
     $entries = $_SESSION["CurrentAppPlugins"]->getMenuEntries();
     #$appMenuHidden = MenuGUI::getAppMenuOrder("appMenuHidden");
     $appMenuDisplayed = MenuGUI::getAppMenuOrder("appMenuDisplayed");
     if ($appMenuDisplayed == "") {
         $appMenuDisplayed = implode(";", $_SESSION["CurrentAppPlugins"]->getMenuEntries());
     }
     $es = MenuGUI::sort($entries, $appMenuDisplayed);
     #, $appMenuHidden);
     $appMenuDisplayed = explode(";", $appMenuDisplayed);
     $L = new HTMLList();
     $L->addListStyle("list-style-type:none;margin-left:0px;margin-top:10px;");
     $es = array_reverse($es, true);
     foreach ($es as $key => $value) {
         if (!in_array($value, $appMenuDisplayed)) {
             continue;
         }
         $L->addItem($key);
         $L->addItemClass("containerSortTabsHandle");
         $L->addItemStyle("padding:5px;cursor:move;margin:0px;");
         $L->setItemID("appMenu_{$value}");
     }
     #$I = new HTMLInput("showAgain", "checkbox");
     #$I->style("float:left;margin-right:5px;");
     #$I->onclick(addslashes(OnEvent::rme(new mUserdata(-1), "setUserdata", array("'hideTooltipDashboard'", "'1'"))));
     $L .= OnEvent::script(OnEvent::sortable("#containerSortTabs ul", ".containerSortTabsHandle", "Spellbook::updateOrder", "y", null, null, "Menu.refresh();") . "\$j('#containerSortTabs ul li').hover(function() {\n      \$j(this).addClass('backgroundColor2');\n    }, function() {\n      \$j(this).removeClass('backgroundColor2');\n    });\n\t" . ((mUserdata::getUDValueS("hideTooltipDashboard", "0") == "0" and mUserdata::getUDValueS("hideTooltips", "0") == "0") ? "\n\t\$j('#SpellbookMenuEntry img').qtip(\$j.extend({}, qTipSharedRed, {\n\t\tcontent: {\n\t\t\ttext: 'Klicken Sie auf die Weltkugel, um die angezeigten Plugins und ihre Reihenfolge zu ändern.<br /><div style=\"margin-top:10px;\"><a href=\"#\" style=\"color:grey;\" onclick=\"" . addslashes(OnEvent::rme(new mUserdata(-1), "setUserdata", array("'hideTooltipDashboard'", "'1'", "''", "0", "1"))) . " return false;\">Diesen Tipp nicht mehr anzeigen</a></div><div style=\"clear:both;margin-top:5px;\"><a href=\"#\" style=\"color:grey;\" onclick=\"" . addslashes(OnEvent::rme(new mUserdata(-1), "setUserdata", array("'hideTooltips'", "'1'", "''", "0", "1"))) . " return false;\">Keine Tipps mehr anzeigen</a></div>', \n\t\t\ttitle: {\n\t\t\t\ttext: 'Dashboard',\n\t\t\t\tbutton: true\n\t\t\t}\n\t\t}\n\t}));" : ""));
     $L = "<h2 style=\"padding-left:0px;\">Reihenfolge</h2>{$L}";
     if ($echo) {
         echo $L;
     }
     return $L;
 }
コード例 #19
0
ファイル: HTMLForm.class.php プロジェクト: nemiah/fheME
 public function addSaveDefaultButton($fieldName)
 {
     $B = new Button("als Standard-Wert speichern", "./images/i2/save.gif");
     $B->rme("mUserdata", "", "setUserdata", array("'DefaultValue{$this->id}{$fieldName}'", "\$('{$this->id}').{$fieldName}.value"), "checkResponse(transport);");
     $B->type("icon");
     $B->style("float:right;");
     if (!isset($this->values[$fieldName])) {
         $U = new mUserdata();
         $this->values[$fieldName] = $U->getUDValue("DefaultValue{$this->id}{$fieldName}", "");
     }
     $this->buttons[$fieldName] = $B;
 }
コード例 #20
0
 protected function getQuicksearchField()
 {
     if ($this->quickSearchPlugin != "") {
         $B = new Button("Suche als Filter anwenden", "./images/i2/searchFilter.png");
         $B->type("icon");
         $B->style("float:right;");
         $B->rme("HTML", "", "saveContextMenu", array("'searchFilter'", "'{$this->quickSearchPlugin};:;'+\$('quickSearch{$this->quickSearchPlugin}').value"), "if(checkResponse(transport)) contentManager.reloadFrameRight();");
         $showSF = PMReflector::implementsInterface($this->quickSearchPlugin . "GUI", "iSearchFilter");
         if ($showSF) {
             $mU = new mUserdata();
             $K = $mU->getUDValue("searchFilterInHTMLGUI" . $this->quickSearchPlugin);
         } else {
             $K = null;
         }
         $BSearchInfo = new Button("", "./images/i2/search.png");
         $BSearchInfo->onclick("phynxContextMenu.start(this, '{$this->quickSearchPlugin}','searchHelp','" . $this->texts["Suche"] . ":','left');");
         $BSearchInfo->style("cursor:help;");
         $BSearchInfo->type("icon");
         $quickSearchRow = "\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\t\t\tonfocus=\"focusMe(this); ACInputHasFocus=true; AC.start(this); if(this.value != '') AC.update('10', this, '{$this->quickSearchPlugin}', 'quickSearchLoadFrame');\"\n\t\t\t\t\t\t\t\tonblur=\"blurMe(this); ACInputHasFocus=false; AC.end(this);\"\n\t\t\t\t\t\t\t\tid=\"quickSearch{$this->quickSearchPlugin}\"\n\t\t\t\t\t\t\t\tonkeyup=\"AC.update(event.keyCode, this, '{$this->quickSearchPlugin}','quickSearchLoadFrame');\"\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\tvalue=\"" . ($K != null ? $K : "") . "\"\n\t\t\t\t\t\t\t\t" . ($showSF ? "style=\"width:90%;\"" : "") . "\n\t\t\t\t\t\t\t/>";
         return array($quickSearchRow, $BSearchInfo);
     }
     return array("", "");
 }
コード例 #21
0
 function saveMe($checkUserData = true, $output = false)
 {
     Aspect::joinPoint("before", $this, get_class($this) . "::saveMe", $this->A);
     if ($checkUserData) {
         mUserdata::checkRestrictionOrDie("cantEdit" . str_replace("GUI", "", get_class($this)));
     }
     $this->loadAdapter();
     $this->Adapter->saveSingle2($this->getClearClass(get_class($this)), clone $this->A);
     if ($output) {
         Red::messageSaved();
     }
 }
コード例 #22
0
ファイル: GUIFactory.class.php プロジェクト: nemiah/trinityDB
 public function getQuicksearchInput()
 {
     $I = new HTMLInput("quickSearch", "text", "");
     #$I->hasFocusEvent(true);
     $I->id("quickSearch{$this->collectionName}");
     $I->onkeyup("AC.update(event.keyCode, this, '{$this->collectionName}','quickSearchLoadFrame');");
     $I->autocompleteBrowser(false);
     $I->onfocus("focusMe(this); ACInputHasFocus=true; AC.start(this); if(this.value != '') AC.update('10', this, '{$this->collectionName}', 'quickSearchLoadFrame');");
     $I->onblur("blurMe(this); ACInputHasFocus=false; AC.end(this);");
     $I->placeholder("Suche");
     $B = "";
     $showSF = PMReflector::implementsInterface($this->collectionName . "GUI", "iSearchFilter");
     if ($showSF) {
         $B = new Button("Suche als Filter anwenden", "./images/i2/searchFilter.png", "icon");
         $B->style("float:right;");
         $B->rme("HTML", "", "saveContextMenu", array("'searchFilter'", "'{$this->collectionName};:;'+\$('quickSearch{$this->collectionName}').value"), "if(checkResponse(transport)) contentManager.reloadFrameRight();");
         $mU = new mUserdata();
         $K = $mU->getUDValue("searchFilterInHTMLGUI" . $this->collectionName);
         $I->setValue($K);
         $I->style("width:90%;");
     }
     return $B . $I;
 }
コード例 #23
0
ファイル: CRMHTMLGUI.class.php プロジェクト: nemiah/fheME
 public function getEditHTML()
 {
     if (BPS::getProperty($this->className . "GUI", "edit") == "ok") {
         return $this->getEditTableHTML();
     }
     ################################################################################
     if ($this->name == null) {
         $this->name = $this->className;
     }
     if ($this->attributes == null) {
         $this->attributes = PMReflector::getAttributesArrayAnyObject($this->object->getA());
     }
     $widths = Aspect::joinPoint("changeWidths", $this, __METHOD__);
     if ($widths == null) {
         $widths = array(700, 132, 218);
     }
     $tab = new HTMLTable(2);
     $tab->setTableStyle("width:{$widths['0']}px;margin-left:10px;");
     $tab->setColWidth(1, "50%");
     $tab->setColWidth(2, "50%");
     $A = $this->object->getA();
     $TSub = new HTMLTable(2);
     $TSub->setColWidth(1, 120);
     $TSub->setColClass(1, "");
     $TSub->setColClass(2, "");
     $TC = clone $TSub;
     $row = array();
     foreach ($this->attributes as $k => $v) {
         if (isset($this->types[$v]) and $this->types[$v] == "hidden") {
             continue;
         }
         if (isset($this->parsers[$v])) {
             $A->{$v} = $this->invokeParser($this->parsers[$v], $A->{$v}, $this->object);
         }
         if (isset($this->types[$v]) and $this->types[$v] == "select") {
             if (isset($this->options[$v]) and isset($this->options[$v][$A->{$v}])) {
                 $A->{$v} = $this->options[$v][$A->{$v}];
             }
         }
         if (isset($this->spaces[$v]) and $this->spaces[$v] != "") {
             if ($k > 0) {
                 $row[] = $TC;
             }
             if ($this->forceNewRow[$v]) {
                 $row[] = "";
                 $tab->addRow($row);
                 $tab->addRowClass("backgroundColor0");
                 $tab->addRowStyle("vertical-align:top;");
                 $row = array();
             }
             if (count($row) == 2) {
                 $tab->addRow($row);
                 $tab->addRowClass("backgroundColor0");
                 $tab->addRowStyle("vertical-align:top;");
                 $row = array();
             }
             $TC = clone $TSub;
             if (trim($this->spaces[$v]) != "") {
                 $TC->addRow(array($this->spaces[$v]));
                 $TC->addRowClass("backgroundColor2");
                 $TC->addRowColspan(1, 2);
             }
             if ($this->replaceWith[$v] !== null) {
                 $TC = $this->replaceWith[$v];
             }
         }
         if ($A->{$v} != "") {
             $B = "";
             if (isset($this->fieldButtons[$v])) {
                 $B = $this->fieldButtons[$v];
                 $B->style("float:right;");
             }
             if ($TC instanceof HTMLTable) {
                 $TC->addLV($this->labels($v) . ":", $B . nl2br($A->{$v}));
                 $TC->addRowStyle("vertical-align:top;");
             }
         }
         /*
         			$label = isset($this->labels[$v]) ? $this->labels[$v] : $v;
         
         			$row[] = "<label>".($label != "" ? ucfirst($label).":" : "")."</label>";
         
         
         
         			$row[] = nl2br($A->$v);*/
         /*if(count($row) == 4){
         			$tab->addRow($row);
         			$row = array();
         		}*/
     }
     $row[] = $TC;
     if (count($row) == 1) {
         $row[] = "";
     }
     if (count($row) == 2) {
         $tab->addRow($row);
         $tab->addRowClass("backgroundColor0");
         $tab->addRowStyle("vertical-align:top;");
     }
     $BE = new Button("Eintrag\nbearbeiten", "edit");
     $BE->onclick(str_replace(array("%CLASSNAME", "%CLASSID"), array($this->className, $this->object->getID()), $this->functionEdit));
     $BE->style("float:left;margin-left:10px;");
     $BD = new Button("Eintrag\nlöschen", "trash");
     $BD->onclick(str_replace(array("%CLASSNAME", "%CLASSID"), array($this->className, $this->object->getID()), $this->functionDelete));
     $BD->style("float:left;margin-left:10px;");
     if (!mUserdata::isDisallowedTo("cantDelete" . $this->className)) {
         $BD = "";
     }
     if (!mUserdata::isDisallowedTo("cantEdit" . $this->className)) {
         $BE = "";
     }
     $options = "<div style=\"width:{$widths['0']}px;\">" . $BE . $BD . implode("", $this->topButtons) . "</div><div style=\"clear:left;height:10px;width:{$widths['0']}px;\"></div>";
     $appended = "";
     if (count($this->appended) > 0) {
         foreach ($this->appended as $k => $v) {
             $appended .= $v->getHTML();
         }
     }
     $prepended = "";
     if (count($this->prepended) > 0) {
         foreach ($this->prepended as $k => $v) {
             $prepended .= $v->getHTML();
         }
     }
     /*
     		if(count($this->CRMGUIappendedElements) > 0)
     			foreach($this->CRMGUIappendedElements as $k => $v)
     				$appended .= $v->getHTML();*/
     return $options . $prepended . $tab . $appended;
 }
コード例 #24
0
 function showRegistration()
 {
     $html = "<script type=\"text/javascript\">\n\t\t\$(function() {\n\t\t\t\$('#registrierungAdresse').validate({\n\t\t\t\trules: {\n\t\t\t\t\tfirma: 'required',\n\t\t\t\t\tstrasse: 'required',\n\t\t\t\t\tnr: 'required',\n\t\t\t\t\tplz: 'required',\n\t\t\t\t\tort: 'required',\n\t\t\t\t\t/*email: {\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\temail: true\n\t\t\t\t\t},*/\n\t\t\t\t\tblz: 'required',\n\t\t\t\t\tkontonummer: 'required',\n\t\t\t\t\tuserVorNachname: 'required',\n\t\t\t\t\tuserEmail: {\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\temail: true\n\t\t\t\t\t},\n\t\t\t\t\tuserUsername: '******',\n\t\t\t\t\tuserPassword: {\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tminlength: 5\n\t\t\t\t\t},\n\t\t\t\t\tconfirmUserPassword: {\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tminlength: 5,\n\t\t\t\t\t\tequalTo: '#registrierungAdresse input[name=userPassword]'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tmessages: {\n\t\t\t\t\tfirma: 'Bitte geben Sie den Namen Ihrer Firma ein',\n\t\t\t\t\tstrasse: 'Bitte geben Sie die Straße Ihrer Firma ein',\n\t\t\t\t\tnr: 'Bitte geben Sie die Hausnummer Ihrer Firma ein',\n\t\t\t\t\tplz: 'Bitte geben Sie Ihre Postleitzahl Ihrer Firma  ein',\n\t\t\t\t\tort: 'Bitte geben Sie Ihren Ort Ihrer Firma ein',\n\t\t\t\t\t//email: {required: 'Bitte geben Sie Ihre gültige E-Mail-Adresse ein', email: 'Bitte geben Sie Ihre gültige E-Mail-Adresse ein'},\n\t\t\t\t\tblz: 'Bitte geben Sie die Bankleitzahl Ihrer Firma ein',\n\t\t\t\t\tkontonummer: 'Bitte geben Sie die Kontonummer Ihrer Firma ein',\n\t\t\t\t\tuserVorNachname: 'Bitte geben Sie Ihren Vor- und Nachnamen ein',\n\t\t\t\t\tuserUsername: '******',\n\t\t\t\t\tuserEmail: {required: 'Bitte geben Sie Ihre gültige E-Mail-Adresse ein', email: 'Bitte geben Sie Ihre gültige E-Mail-Adresse ein'},\n\t\t\t\t\tconfirmUserPassword: {required: 'Bitte geben Sie Ihr Passwort ein', minlength: 'Bitte geben Sie mindestens fünf Zeichen ein', equalTo: 'Die Passwörter stimmen nicht überein'},\n\t\t\t\t\tuserPassword: {required: 'Bitte geben Sie Ihr Passwort ein', minlength: 'Bitte geben Sie mindestens fünf Zeichen ein'}\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t\t\n\t\t\t\$('#registrierungAdresse input[name=userUsername]').focus(function() {\n\t\t\t\tvar vorNachname = \$('#registrierungAdresse input[name=userVorNachname]').val();\n\t\t\t\tif(vorNachname && !this.value) {\n\t\t\t\t\tthis.value = vorNachname.replace(' ', '.').toLowerCase();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\t\n\t\t</script>";
     $html .= "<h1>Registrierung für PDFix</h1>";
     $F = new HTMLForm("registrierungAdresse", array("firma", "strasse", "nr", "plz", "ort", "tel", "blz", "kontonummer", "zahlungsweise", "userVorNachname", "userUsername", "userPassword", "confirmUserPassword", "userEmail", "action"));
     #$F->setType("anrede", "select", "3", Adresse::getAnreden());
     $F->insertSpaceAbove("vorname");
     $F->insertSpaceAbove("strasse", "Adresse");
     $F->insertSpaceAbove("email", "Kontakt");
     $F->insertSpaceAbove("blz", "Bank");
     $F->insertSpaceAbove("firma", "<h2>Abrechnungsdaten</h2>");
     $F->insertSpaceAbove("userVorNachname", "<h2 style=\"margin-top:20px;\">Benutzerdaten</h2>");
     $F->insertSpaceAbove("zahlungsweise", "<h2 style=\"margin-top:20px;\">Zahlungsweise</h2>");
     $F->setSaveCustomerPage("Jetzt registrieren", null, true, "function(){ document.location.href='./index.php?CC=RegistrationPDFix&thankR=1'; }");
     $F->setLabel("email", "E-Mail");
     $F->setLabel("tel", "Telefon");
     $F->setLabel("strasse", "Straße");
     $F->setLabel("userVorNachname", "Name");
     $F->setLabel("userUsername", "Benutzername");
     $F->setLabel("userPassword", "Passwort");
     $F->setLabel("confirmUserPassword", "Passwort wiederholen");
     $F->setLabel("userEmail", "E-Mail");
     $kosten1Monat = Util::CLFormatCurrency(mUserdata::getUDValueS("PDFixKostenProMonat", "0") * 1, true);
     $kosten3Monat = Util::CLFormatCurrency(mUserdata::getUDValueS("PDFixKostenPro3Monat", "0") * 1, true);
     $kosten6Monat = Util::CLFormatCurrency(mUserdata::getUDValueS("PDFixKostenPro6Monat", "0") * 1, true);
     $F->setType("confirmUserPassword", "password");
     $F->setType("userPassword", "password");
     $F->setType("action", "hidden");
     $F->setType("zahlungsweise", "select", "1", array("1" => "Monatlich ({$kosten1Monat} + MwSt)", "3" => "Vierteljährlich ({$kosten3Monat} + MwSt)", "6" => "Halbjährlich ({$kosten6Monat} + MwSt)"));
     $F->setValue("action", "register");
     $html .= $F;
     return $html;
 }
コード例 #25
0
ファイル: provisioning.php プロジェクト: nemiah/fheME
<?php

define("PHYNX_NO_SESSION_RELOCATION", true);
require "../../system/connect.php";
addClassPath(Util::getRootPath() . "ubiquitous/phim");
$T = mUserdata::getGlobalSettingValue("phimServerToken");
if (!$T) {
    die("<phynx><phim><token>unknown</token></phim></phynx>");
}
if ($T !== filter_input(INPUT_GET, "token")) {
    die("<phynx><phim><token>unknown</token></phim></phynx>");
}
$U = anyC::getFirst("phimUser", "phimUserSystemName", str_replace("\\", "/", filter_input(INPUT_GET, "user")));
if ($U == null) {
    $F = new Factory("phimUser");
    $F->sA("phimUserSystemName", str_replace("\\", "/", filter_input(INPUT_GET, "user")));
    $F->store();
    die("<phynx><phim><token>unknown</token></phim></phynx>");
}
echo "<phynx><phim><token>" . $U->A("phimUserToken") . "</token></phim></phynx>";
コード例 #26
0
ファイル: HTMLGUIX.class.php プロジェクト: nemiah/trinityDB
 public function operationsButton()
 {
     $pluginName = str_replace("GUI", "", get_class($this->object));
     $id = $this->object->getID();
     $userCanDelete = mUserdata::isDisallowedTo("cantDelete" . $pluginName);
     $userCanCreate = mUserdata::isDisallowedTo("cantCreate" . $pluginName);
     /*if($this->texts == null) {
     			$c = $this->loadLanguageClass("HTML");
     			$this->texts = $c->getEditTexts();
     		}*/
     $html = "";
     if (PMReflector::implementsInterface($pluginName, "iNewWithValues") and $userCanCreate) {
         $os = "1";
     } else {
         $os = "0";
     }
     if (PMReflector::implementsInterface($pluginName, "iCloneable") and $userCanCreate) {
         $os .= "1";
     } else {
         $os .= "0";
     }
     if ((PMReflector::implementsInterface($pluginName, "iDeletable") or PMReflector::implementsInterface($pluginName, "iDeletable2")) and $userCanDelete) {
         $os .= "1";
     } else {
         $os .= "0";
     }
     if (PMReflector::implementsInterface($pluginName, "iRepeatable") and Session::isPluginLoaded("mRepeatable")) {
         $os .= "1";
     } else {
         $os .= "0";
     }
     if (PMReflector::implementsInterface($pluginName, "iXMLExport")) {
         $os .= "1";
     } else {
         $os .= "0";
     }
     if ($id != -1 and $os != "00000") {
         $B = new Button("Operationen", "wrench", "iconic");
         $B->style("float:right;margin-top:-3px;");
         $B->contextMenu("HTML", "operations:{$pluginName}:{$id}:{$os}", "Operationen");
         $html = $B;
     }
     #$html .= "<img title=\"Operationen\" id=\"".$pluginName."Operations\" src=\"./images/i2/settings.png\" onclick=\"phynxContextMenu.start(this, 'HTML','operations:$pluginName:$id:$os','".$this->texts["Operationen"].":');\" style=\"float:right;\" />";
     return $html;
 }
コード例 #27
0
 public function getActions()
 {
     $DBFilePath = Util::getRootPath() . "system/DBData/Installation.pfdb.php";
     $File = new File($DBFilePath);
     $File->loadMe();
     $ASetup = "contentManager.loadPlugin('contentRight', 'mInstallation');";
     $B = new Button("Erneut prüfen", "./plugins/Installation/recheck.png", "icon");
     $B->onclick($ASetup);
     $B->id("recheckButton");
     $hasDBConnection = false;
     try {
         $Version = mUserdata::getGlobalSettingValue("DBVersion", false);
         $hasDBConnection = true;
     } catch (Exception $e) {
     }
     if (!$File->A("FileIsWritable") and !$hasDBConnection) {
         $message = "<p style=\"padding:20px;font-size:20px;color:#555;text-align:center;\">" . $_SESSION["applications"]->getActiveApplication() . " ist auf diesem Server noch nicht installiert.</p>";
         $html = "<div style=\"width:600px;margin:auto;line-height:1.5;\">\n\t\t\t\t<p>\n\t\t\t\t<img src=\"./images/navi/restrictions.png\" style=\"float:left;margin-right:10px;\"/>\n\t\t\t\tDie Datei <code>/system/DBData/Installation.pfdb.php</code> ist <b>nicht beschreibbar</b>.</p>\n\t\t\t\t\n\t\t\t\t<p style=\"margin-top:20px;\">Machen Sie die Datei mit einem FTP-Programm beschreibbar.<br />\n\t\t\t\tKlicken Sie dazu mit der rechten Maustaste auf die Datei auf dem Server, wählen Sie <b>\"Eigenschaften\"</b>, und geben Sie den Modus <b>666</b> an, damit sie durch den Besitzer, die Gruppe und alle Anderen les- und beschreibbar ist.</p>\n\t\t\t\t<div style=\"width:350px;margin:auto;padding-top:20px;padding-bottom:20px;\">\n\t\t\t\t" . $this->box($B, $ASetup, "Erneut<br />prüfen") . "\n\t\t\t\t</div>\n\t\t\t</div>";
         die($message . $html);
     }
     $containers = 0;
     $message = "";
     $html = "";
     $hidden = "<a class=\"hiddenLink\" href=\"#\" onclick=\"" . OnEvent::popup("Fehlerausgabe", "mInstallation", "-1", "updateAllTables", array("'1'")) . "return false;\">&nbsp;</a>";
     try {
         $Version = mUserdata::getGlobalSettingValue("DBVersion", false);
         if ($Version !== false and $Version == Phynx::build()) {
             $message = "<p style=\"padding:20px;font-size:20px;color:#555;text-align:center;\">Ihre Datenbank ist auf dem aktuellen Stand.{$hidden}</p>";
         }
         if ($Version === false or $Version != Phynx::build()) {
             $message = "<p style=\"padding:10px;font-size:20px;color:#555;margin-bottom:40px;text-align:center;\">Ihre Datenbank muss aktualisiert werden.</p>";
             $ASetup = "\$j('#updateButton').attr('src', './plugins/Installation/bigLoader.png'); " . OnEvent::rme($this, "updateAllTables", "", "function(transport){ contentManager.contentBelow(transport.responseText); }");
             $B = new Button("Datenbank aktualisieren", "./plugins/Installation/aktualisieren.png", "icon");
             $B->onclick($ASetup);
             $B->id("updateButton");
             $html = $this->box($B, $ASetup, "Die Datenbank<br />aktualisieren", "", $hidden);
             $html = "<div style=\"width:350px;margin:auto;padding-bottom:40px;\">" . $html . "</div>";
         }
     } catch (NoDBUserDataException $e) {
         $message = "<p style=\"padding:10px;font-size:20px;color:#555;text-align:center;color:red;\">Mit den angegebenen Datenbank-Zugangsdaten kann keine Verbindung aufgebaut werden.</p>";
         echo OnEvent::script("contentManager.loadFrame('contentLeft','Installation','1');");
         if (PHYNX_MAIN_STORAGE == "MySQL") {
             try {
                 $DB1 = new DBStorageU();
                 $BN = new Button("Hinweis", "notice", "icon");
                 $BN->style("float:left;margin-right:10px;");
                 $File = new File(Util::getRootPath() . "system/connect.php");
                 $B = new Button("Verbindungsart umstellen", "./plugins/Installation/changedb.png", "icon");
                 $B->onclick($A);
                 $B->id("changedbButton");
                 $A = OnEvent::rme($this, "switchDBToMySQLo", "", "function(){ Installation.reloadApp(); }");
                 $BR = "<p style=\"margin-top:20px;\">Verwenden Sie den Knopf unten, um die Verbindungsart auf die ältere Version umzustellen.<br />\n\t\t\t\t\t\tSie müssen sich anschließend erneut anmelden.</p>\n\t\t\t\t\t\t<div style=\"width:350px;margin:auto;padding-top:20px;padding-bottom:20px;\">" . $this->box($B, $A, "Verbindungsart<br />umstellen") . "</div>";
                 $A = "contentManager.loadPlugin('contentRight', 'mInstallation');";
                 $B = new Button("Erneut prüfen", "./plugins/Installation/recheck.png", "icon");
                 $B->onclick($A);
                 $B->id("recheckButton");
                 if (!$File->A("FileIsWritable")) {
                     $BR = "<p style=\"margin-top:20px;\">Bitte machen Sie die Datei /system/connect.php für den Webserver beschreibbar, damit phynx auf die ältere Verbindungsart umstellen kann.<br /><br />Verwenden Sie dazu Ihr FTP-Programm. Klicken Sie mit der rechten Maustaste auf die Datei auf dem Server, wählen Sie \"Eigenschaften\", und geben Sie den Modus 666 an, damit sie durch den Besitzer, die Gruppe und alle Anderen les- und schreibbar ist.\n\t\t\t\t\t\t\t</p><div style=\"width:350px;margin:auto;padding-top:20px;padding-bottom:20px;\">" . $this->box($B, $A, "Erneut<br />prüfen") . "</div>";
                 }
                 $html = "<p style=\"margin-top:30px;\">{$BN} Möglicherweise ist die MySQLi-Erweiterung auf Ihrem Server nicht korrekt konfiguriert.</p>{$BR}";
                 $html = "<div style=\"width:700px;margin:auto;padding-bottom:40px;\">" . $html . "</div>";
             } catch (Exception $e) {
                 #echo "MySQL geht auch nicht!";
             }
         }
     } catch (DatabaseNotFoundException $e) {
         $message = "<p style=\"padding:10px;font-size:20px;color:#555;text-align:center;color:red;\">Die angegebene Datenbank konnte nicht gefunden werden.</p>";
         echo OnEvent::script("contentManager.loadFrame('contentLeft','Installation','1');");
     } catch (TableDoesNotExistException $e) {
         $message = "<p style=\"padding:10px;font-size:20px;color:#555;margin-bottom:40px;text-align:center;\">Ihre Datenbank hat derzeit noch keinen Inhalt.</p>";
         $ASetup = "\$j('#setupButton').attr('src', './plugins/Installation/bigLoader.png'); " . OnEvent::rme($this, "setupAllTables", "", "function(transport){ contentManager.contentBelow(transport.responseText); }");
         $BSetup = new Button("Datenbank einrichten", "./plugins/Installation/setup.png", "icon");
         $BSetup->onclick($ASetup);
         $BSetup->id("setupButton");
         $hidden = "<a class=\"hiddenLink\" href=\"#\" onclick=\"" . OnEvent::popup("Fehlerausgabe", "mInstallation", "-1", "setupAllTables", array("'1'")) . "return false;\">&nbsp;</a>";
         $html = $this->box($BSetup, $ASetup, "Die Datenbank<br />einrichten", "", $hidden);
         $containers = 1;
         $BM = new BackupManagerGUI();
         $list = $BM->getBackupsList();
         $ARestore = OnEvent::popup("Backup-Manager", "BackupManager", "-1", "inPopup");
         $BRestore = new Button("Datenbank wiederherstellen", "./plugins/Installation/restore.png", "icon");
         $BRestore->onclick($ARestore);
         $BRestore->id("setupButton");
         $html .= $this->box($BRestore, $ARestore, "Eine Sicherung<br />wiederherstellen", count($list) == 0 ? "color:grey;" : "");
         $containers++;
         $html = "<div style=\"width:" . $containers * 360 . "px;margin:auto;padding-bottom:40px;\">" . $html . "</div>";
     }
     echo "{$message}{$html}";
 }
コード例 #28
0
ファイル: HTMLGUI2.class.php プロジェクト: nemiah/trinityDB
 function getBrowserHTML($lineWithId = -1)
 {
     $this->texts = $this->languageClass->getBrowserTexts();
     $singularLanguageClass = $this->loadLanguageClass($this->singularClass);
     $userCanDelete = mUserdata::isDisallowedTo("cantDelete" . $this->singularClass);
     $userCanCreate = mUserdata::isDisallowedTo("cantCreate" . $this->singularClass);
     $userHiddenFields = mUserdata::getHides($this->singularClass);
     $defaultTarget = "contentRight";
     if ($this->displaySide != "default") {
         $defaultTarget = "content" . ucfirst($this->displaySide);
     }
     if ($this->singularClass == "none") {
         echo "collectionOf is not set. See message log for further details.";
         throw new CollectionOfNotSetException();
     }
     if ($this->name == "Noname") {
         $_SESSION["messages"]->addMessage("There is no name set. You might use setName of HTMLGUI to do that.");
     }
     /**
      * ERROR-TABLE
      */
     $errorTab = new HTMLTable(1);
     if (isset($_SESSION["phynx_errors"]) and $lineWithId == -1 and ($_SERVER["HTTP_HOST"] == "dev.furtmeier.lan" or strpos(__FILE__, "nemiah") !== false)) {
         $errorTab->addRow("\n\t\t\t\t\t<img style=\"float:left;margin-right:10px;\" src=\"./images/navi/warning.png\" />\n\t\t\t\t\t<b>Es " . (count($_SESSION["phynx_errors"]) != 1 ? "liegen" : "liegt") . " " . count($_SESSION["phynx_errors"]) . " PHP-Fehler vor:</b><br />\n\t\t\t\t\t<a href=\"javascript:windowWithRme('Util','','showPHPErrors','');\">Fehler anzeigen</a>,<br />\n\t\t\t\t\t<a href=\"javascript:rme('Util','','deletePHPErrors','','contentManager.reloadFrameRight();');\">Fehler löschen</a>");
     }
     /**
      * RETURN-BUTTON
      */
     $returnTab = new HTMLTable(1);
     if ($this->isSelection) {
         $BReturn = new Button("Auswahl\nbeenden", "back");
         $BReturn->onclick("contentManager.restoreFrame('content" . ucfirst($this->displaySide) . "','selectionOverlay');");
         #return "<input type=\"button\" value=\"zurück zu\n".$p2[$s[0]]."\" style=\"background-image:url(./images/navi/back.png);\" class=\"bigButton backgroundColor3\" onclick=\"loadFrameV2('contentRight','$s[0]');\" />";
         $returnTab->addRow($BReturn);
     }
     /**
      * DELETE-BUTTON
      */
     if ((!$this->onlyDisplayMode or $this->deleteInDisplayMode) and $userCanDelete and !$this->isSelection and $this->showDeleteButton) {
         $this->newColsRight["delete"] = "\n\t\t\t<span class=\"iconic trash_stroke\" onclick=\"deleteClass('" . $this->singularClass . "','%%VALUE%%', " . ($this->JSOnDelete == null ? "function() { " . ($this->displaySide == "left" ? "contentManager.reloadFrameLeft();" : "contentManager.reloadFrameRight(); if(typeof lastLoadedLeft != 'undefined' && lastLoadedLeft == '%%VALUE%%') \$('contentLeft').update('');") . " }" : $this->JSOnDelete) . ",'" . str_replace("%1", $this->singularName, $this->texts["%1 wirklich löschen?"]) . "');\"></span>";
     } elseif (!$userCanDelete) {
         $this->newColsRight["delete"] = "<img src=\"./images/i2/empty.png\" />";
     }
     /**
      * EDIT-BUTTON
      */
     if (!isset($this->newColsLeft["select"]) and (!$this->onlyDisplayMode or $this->editInDisplayMode) and $this->showEditButton) {
         $EB = new Button("", "./images/i2/edit.png");
         $EB->type("icon");
         $EB->className("editButton");
         if ($this->JSOnEdit == null) {
             $EB->onclick("contentManager.selectRow(this); contentManager.loadFrame('contentLeft','" . $this->singularClass . "','%%VALUE%%','0');");
         } else {
             $EB->onclick($this->JSOnEdit);
         }
         $this->newColsLeft["select"] = $EB;
     }
     $cols = count($this->showAttributes) + count($this->newColsLeft) + count($this->newColsRight);
     $valuesTab = new HTMLTable($cols, $lineWithId == -1 ? $this->displaySide == "left" ? $this->name : "" : null);
     $valuesTab->addTableClass("contentBrowser");
     /*if(isset($this->newColsRight["delete"]) AND ($this->displaySide == "default" OR $this->displaySide == "right"))
     			$valuesTab->setColClass($cols, "backgroundColor0");
     		if(isset($this->newColsRight["delete"]) AND $this->displaySide == "left")
     			$valuesTab->setColClass(1, "backgroundColor0");*/
     /**
      * QUICKSEARCH
      */
     #$quickSearchRow = "";
     if ($this->quickSearchPlugin != "" and $lineWithId == -1) {
         list($quickSearchRow, $BSearchInfo) = $this->getQuicksearchField();
         if ($this->displaySide == "left") {
             $insertRow = array($quickSearchRow);
             for ($i = 1; $i < $cols - 1; $i++) {
                 $insertRow[] = "";
             }
             $insertRow[] = $BSearchInfo;
             $valuesTab->addRow($insertRow);
             $valuesTab->addRowColspan(1, $cols - 1);
         } else {
             $valuesTab->addRow(array($BSearchInfo, $quickSearchRow));
             $valuesTab->addRowColspan(2, $cols - 1);
         }
         $valuesTab->addRowClass("backgroundColorHeader");
     }
     if ($this->headerRow != null) {
         $valuesTab->addHeaderRow($this->headerRow);
     }
     /**
      * PAGE-BROWSER
      */
     #$multiPageRow = "";
     $separator = "";
     $userDefinedEntriesPerPage = false;
     $isMultiPageMode = false;
     if (count($this->multiPageMode) > 0) {
         $isMultiPageMode = true;
         $this->multiPageMode[3] = $defaultTarget;
         if ($this->multiPageMode[2] == 0) {
             $userDefinedEntriesPerPage = true;
             #$mU = new mUserdata();
             #$this->multiPageMode[2] = $mU->getUDValue("entriesPerPage{$this->multiPageMode[4]}");
             #if($this->multiPageMode[2] == null) $this->multiPageMode[2] = 20;
         }
         /*
         
         if($this->multiPageMode[1] == "undefined") $this->multiPageMode[1] = 0;
         
         $pages = ceil($this->multiPageMode[0] / $this->multiPageMode[2]);
         
         if($this->multiPageMode[1] != 0) $pageLinks = "<a href=\"javascript:contentManager.loadPage('$defaultTarget', '0');\">&nbsp;&lt;&lt;&nbsp;</a> ";
         else $pageLinks = "&nbsp;&lt;&lt;&nbsp; ";
         
         if($this->multiPageMode[1] != 0) $pageLinks .= "<a href=\"javascript:contentManager.backwardOnePage('$defaultTarget');\">&nbsp;&lt;&nbsp;</a> ";
         else $pageLinks .= "&nbsp;&lt;&nbsp; ";
         
         if($this->multiPageMode[1] != $pages - 1) $pageLinks .= "<a href=\"javascript:contentManager.forwardOnePage('$defaultTarget');\">&nbsp;&gt;&nbsp;</a> ";
         else $pageLinks .= "&nbsp;&gt;&nbsp; ";
         
         if($this->multiPageMode[1] != $pages - 1) $pageLinks .= "<a href=\"javascript:contentManager.loadPage('$defaultTarget',".($pages-1).");\">&nbsp;&gt;&gt;&nbsp;</a> | ";
         else $pageLinks .= "&nbsp;&gt;&gt;&nbsp; | ";
         
         $start = $this->multiPageMode[1] - 3;
         if($start < 0) $start = 0;
         
         $end = $this->multiPageMode[1] + 3;
         if($end > $pages - 1) $end = $pages - 1;
         
         for($i=$start; $i<=$end; $i++)
         	if($this->multiPageMode[1] != "$i") $pageLinks .= "<a href=\"javascript:contentManager.loadPage('$defaultTarget','".$i."');\">".($i+1)."</a> ";
         	else $pageLinks .= ($i+1)." ";
         
         	$pageLinks = "".($pages == 0 ? 1 : $pages)." ".(($pages == 0 ? 1 : $pages) != 1 ? $this->texts["Seiten"] : $this->texts["Seite"]).": ".$pageLinks;
         */
         if ($this->displaySide == "left") {
             $pageLinks = "<span style=\"float:right;\">" . $this->getMultiPageButtons() . "</span>";
         } else {
             $pageLinks = $this->getMultiPageButtons();
         }
         /*if($lineWithId == -1) $multiPageRow = "
         					<tr>
         						".($userDefinedEntriesPerPage ? "<td><img class=\"mouseoverFade\" src=\"./images/i2/settings.png\" onclick=\"phynxContextMenu.start(this, 'HTML','multiPageSettings:{$this->multiPageMode[4]}','".$this->texts["Einstellungen"].":');\" /></td>" : "")."
         						<td colspan=\"".($colspan+1+($userDefinedEntriesPerPage ? 0 : 1))."\"><input type=\"text\"onkeydown=\"if(event.keyCode == 13) loadFrameV2('".$this->multiPageMode[3]."','".$this->multiPageMode[4]."','',this.value - 1);\" style=\"width:30px;float:right;text-align:right;\" value=\"".($this->multiPageMode[1]+1)."\" onfocus=\"focusMe(this);\" onblur=\"blurMe(this);\" />".$this->multiPageMode[0]." ".($this->multiPageMode[0] == 1 ? $this->texts["Eintrag"] : $this->texts["Einträge"])."<!--, ".$pages." ".($pages != 1 ? $this->texts["Seiten"] : $this->texts["Seite"])."--></td>
         					</tr>
         					<tr>
         						<td colspan=\"$determinedNumberofCols\">".($pages == 0 ? 1 : $pages)." ".(($pages == 0 ? 1 : $pages) != 1 ? $this->texts["Seiten"] : $this->texts["Seite"]).": $pageLinks</td>
         					</tr>";
         
         
         */
         if ($lineWithId == -1) {
             $BSettings = $this->getPageOptionsButton();
             #$IPage = $this->getPageSelectionField();
             #$IPage->style("width:30px;float:right;text-align:right;");
             $pageOptions = $this->multiPageMode[0] . " " . ($this->multiPageMode[0] == 1 ? $this->texts["Eintrag"] : $this->texts["Einträge"]) . ", {$pageLinks}";
             if (!$userDefinedEntriesPerPage) {
                 $valuesTab->addRow(array($pageOptions));
                 $valuesTab->addRowColspan(1, $cols);
             } else {
                 if ($this->displaySide == "left") {
                     $insertRow = array($pageOptions);
                     for ($i = 1; $i < $cols - 1; $i++) {
                         $insertRow[] = "";
                     }
                     $insertRow[] = $BSettings;
                     $valuesTab->addRow($insertRow);
                     #$valuesTab->addRow(array($pageOptions,$BSettings));
                     $valuesTab->addRowColspan(1, $cols - 1);
                 } else {
                     /*$insertRow = array($BSettings);
                     		for($i=1; $i<$cols-1; $i++)
                     			$insertRow[] = "";
                     		$insertRow[] = $pageOptions;
                     		$valuesTab->addRow($insertRow);*/
                     $valuesTab->addRow(array($BSettings, $pageOptions));
                     $valuesTab->addRowColspan(2, $cols - 1);
                 }
             }
             $valuesTab->addRowClass("backgroundColorHeader");
             #$valuesTab->addRow(array($pageLinks));
             #$valuesTab->addRowColspan(1, $cols);
             #$valuesTab->addRowClass("backgroundColorHeader");
             $valuesTab->addRow("");
             $valuesTab->addRowColspan(1, $cols);
             $valuesTab->addRowClass("backgroundColor0 browserSeparatorTop");
         }
     }
     $filteredCol = null;
     if ($lineWithId == -1 and $this->showFilteredCategoriesWarning != null and $this->showFilteredCategoriesWarning[0]) {
         $dB = new Button($this->texts["Filter löschen"], "./images/i2/delete.gif");
         $dB->style("float:right;");
         $dB->type("icon");
         $dB->rme("HTML", "", "saveContextMenu", array("'deleteFilters'", "'{$this->showFilteredCategoriesWarning[1]}'"), "if(checkResponse(transport)) contentManager.reloadFrameRight();");
         /*$separator = "
         		<tr>
         			<td class=\"backgroundColor0\"".((isset($this->showFilteredCategoriesWarning[0]) AND $this->showFilteredCategoriesWarning[0] == true) ? "<img src=\"./images/i2/note.png\" /></td><td class=\"backgroundColor0\" colspan=\"".($determinedNumberofCols - 2)."\" style=\"color:grey;\" >".$this->texts["Anzeige wurde gefiltert"]."</td><td class=\"backgroundColor0\">$dB</td>" : " >")."</td>
         		</tr>";*/
         $filteredCol = array("<img src=\"./images/i2/note.png\" />", $dB . $this->texts["Anzeige wurde gefiltert"]);
         $valuesTab->addRow($filteredCol);
         $valuesTab->addRowColspan(2, $cols - 1);
         $valuesTab->addRowClass("backgroundColor0");
         $valuesTab->addRowStyle("color:grey;");
     }
     /**
      * NEW-BUTTON
      */
     if (!$this->onlyDisplayMode and $userCanCreate and $this->showNewButton and $lineWithId == -1) {
         $BNew = new Button("", "./images/i2/new.gif");
         $BNew->type("icon");
         $BNew->id("buttonNewEntry{$this->singularClass}");
         #$BNew->onclick($this->JSOnNew == null ? "contentManager.newClassButton('$this->singularClass','');" : $this->JSOnNew);
         if ($this->displaySide == "left") {
             #$valuesTab->addRow(array("<b>$this->singularName neu anlegen</b>",$BNew));
             #$valuesTab->addRowColspan(1, $cols-1);
         } else {
             $valuesTab->addRow(array($BNew, "<b>{$this->singularName} neu anlegen</b>"));
             $valuesTab->addRowColspan(2, $cols - 1);
             $valuesTab->addRowEvent("click", $this->JSOnNew == null ? "contentManager.newClassButton('{$this->singularClass}','');" : $this->JSOnNew);
             $valuesTab->addRowStyle("cursor:pointer;");
         }
         #$valuesTab->addRowColspan(2, $cols-1);
     }
     /**
      * TABLE-CONTENT
      */
     $displayGroup = null;
     for ($i = 0; $i < count($this->attributes); $i++) {
         $aid = $this->attributes[$i]->getID();
         // get the id of an object separately
         $sc = $this->attributes[$i]->getA();
         // get the attributes-object from the object
         if ($this->displayGroupBy != null) {
             $displayGroupField = $this->displayGroupBy;
             if ($sc->{$displayGroupField} != $displayGroup and $i > 0) {
                 $valuesTab->addRow("");
                 $valuesTab->addRowClass("backgroundColor0");
             }
         }
         $row = array();
         $styles = array();
         if ($this->displaySide == "left") {
             $colsLeft = $this->newColsRight;
             $colsRight = $this->newColsLeft;
         } else {
             $colsLeft = $this->newColsLeft;
             $colsRight = $this->newColsRight;
         }
         if (count($colsLeft) > 0) {
             foreach ($colsLeft as $key => $value) {
                 $row[] = str_replace("%%VALUE%%", $aid, $value);
                 $valuesTab->setColWidth(count($row), "20px");
             }
         }
         foreach ($this->showAttributes as $key => $value) {
             if (isset($userHiddenFields[$value])) {
                 continue;
             }
             if (isset($this->parsers[$value])) {
                 $t = $this->invokeParser($this->parsers[$value], $sc->{$value}, $this->makeParameterStringFromArray($this->parserParameters[$value], $sc, $aid));
             } else {
                 $t = htmlspecialchars($sc->{$value});
             }
             if ($this->multiEditMode != null and in_array($value, $this->multiEditMode)) {
                 $posInArray = array_search($value, $this->multiEditMode);
                 if ($this->multiEditModeInputs[$posInArray] == null) {
                     $MI = new HTMLInput($value . "ID{$aid}", "multiInput", $sc->{$value}, array($this->singularClass, $aid, $value));
                     if ($this->multiEditModeStyle != null) {
                         $MI->style($this->multiEditModeStyle[$posInArray]);
                     }
                 } else {
                     $MI = clone $this->multiEditModeInputs[$posInArray];
                     $MI->setValue($sc->{$value});
                     $MI->activateMultiEdit($this->singularClass, $aid);
                 }
                 $t = $MI;
             }
             #<td id=\"Browser".$value."$aid\" ".(isset($this->colStyles[$value]) ? "style=\"".$this->colStyles[$value]."\"" : "").">".$t."</td>";
             $row[] = $t;
             if (isset($this->colStyles[$value])) {
                 $styles[count($row)] = $this->colStyles[$value];
             }
         }
         if (count($colsRight) > 0) {
             foreach ($colsRight as $key => $value) {
                 $row[] = str_replace("%%VALUE%%", $aid, $value);
                 $valuesTab->setColWidth(count($row), "20px");
             }
         }
         $valuesTab->addRow($row);
         if (count($styles) > 0) {
             foreach ($styles as $col => $s) {
                 $valuesTab->addColStyle($col, $s);
             }
         }
         $valuesTab->setRowID("BrowserMain{$aid}");
         #foreach($this->showAttributes as $key => $value) {
         #	$valuesTab->addCellID($cellNo, "Browser".$value."$aid");
         #}
         if ($this->displayGroupBy != null) {
             $displayGroup = $sc->{$displayGroupField};
         }
     }
     if ($filteredCol !== null) {
         $valuesTab->addRow($filteredCol);
         $valuesTab->addRowColspan(2, $cols - 1);
         $valuesTab->addRowClass("backgroundColor0");
         $valuesTab->addRowStyle("color:grey;");
     }
     if ($lineWithId == -1 and $isMultiPageMode) {
         $valuesTab->addRow("");
         $valuesTab->addRowColspan(1, $cols);
         $valuesTab->addRowClass("backgroundColor0 browserSeparatorBottom");
         if (!$userDefinedEntriesPerPage) {
             $valuesTab->addRow(array($pageOptions));
             $valuesTab->addRowColspan(1, $cols);
         } else {
             if ($this->displaySide == "left") {
                 $valuesTab->addRow(array($pageOptions, $BSettings));
                 $valuesTab->addRowColspan(1, $cols - 1);
             } else {
                 $valuesTab->addRow(array($BSettings, $pageOptions));
                 $valuesTab->addRowColspan(2, $cols - 1);
             }
         }
         $valuesTab->addRowClass("backgroundColorHeader");
         #$valuesTab->addRow(array($pageLinks));
         #$valuesTab->addRowColspan(1, $cols);
         #$valuesTab->addRowClass("backgroundColorHeader");
     }
     if (count($this->attributes) == 0) {
         $valuesTab->addRow(array("keine Einträge"));
         $valuesTab->addRowColspan(1, $cols);
     }
     if ($lineWithId != -1) {
         $valuesTab = $valuesTab->getHTMLForUpdate();
     }
     return $errorTab . $returnTab . $valuesTab . ($lineWithId == -1 ? $this->tip : "");
 }
コード例 #29
0
 public function saveShowCalendarOf($UserID, $value)
 {
     mUserdata::setUserdataS("showCalendarOf" . $UserID, $value);
 }
コード例 #30
0
ファイル: mUserdataGUI.class.php プロジェクト: nemiah/fheME
 public function rolesActivate($UserID, $role)
 {
     foreach ($this->roles($role) as $c => $s) {
         if ($c == "cantEdit" or $c == "cantDelete" or $c == "cantCreate") {
             foreach ($s as $k => $p) {
                 $p2 = "m{$p}";
                 if ($p == "Adresse") {
                     $p2 = "Adressen";
                 }
                 mUserdata::setUserdataS($c . $p2, $c . $p, "uRest", $UserID);
             }
             continue;
         }
         if ($c == "hidePlugin") {
             foreach ($s as $k => $p) {
                 mUserdata::setUserdataS($c . $p, $p, "pHide", $UserID);
             }
             continue;
         }
         foreach ($s as $k => $p) {
             mUserdata::setUserdataS($p, $c, "pSpec", $UserID);
         }
     }
 }