public static function _($text) { if (!function_exists("bindtextdomain")) { return $text; } if (trim($text) == "" or trim($text) == " ") { return $text; } #echo self::$currentDomain.":".$text."<br />"; if (self::$generate and self::$domainPaths[self::$currentDomain] != null and Session::getLanguage() != "de_DE") { if (!isset(self::$poFileContent[self::$currentDomain])) { self::$poFileContent[self::$currentDomain] = file_get_contents(self::$domainPaths[self::$currentDomain] . "/" . Session::getLanguage() . "/LC_MESSAGES/messages" . self::$currentDomain . ".po"); } #var_dump(self::$poFileContent); $putText = str_replace("\"", "\\\"", $text); if (strpos($putText, "\n") !== false) { $putText = str_replace("\n", "\\n\"\n\"", $putText); $putText = "\"\n\"{$putText}"; } if (strpos(self::$poFileContent[self::$currentDomain], "msgid \"{$putText}\"") === false) { file_put_contents(self::$domainPaths[self::$currentDomain] . "/" . Session::getLanguage() . "/LC_MESSAGES/messages" . self::$currentDomain . ".po", "msgid \"{$putText}\"\nmsgstr \"\"\n\n", FILE_APPEND); self::$poFileContent[self::$currentDomain] = file_get_contents(self::$domainPaths[self::$currentDomain] . "/" . Session::getLanguage() . "/LC_MESSAGES/messages" . self::$currentDomain . ".po"); } } $text = dgettext("messages" . self::$currentDomain, $text); $args = func_get_args(); if (count($args) > 1) { for ($i = count($args); $i > 1; $i--) { $text = str_replace("%" . ($i - 1), $args[$i - 1], $text); } } $text = Aspect::joinPoint("translate", null, __METHOD__, $text, $text); return $text; }
public function uniqueOnUserId($attribute, $params = array()) { $aspect = Aspect::model()->findByAttributes(array('user_id' => $this->user_id, 'name' => $this->name)); if ($aspect !== null && $aspect->id !== $this->id) { $this->addError('name', Yii::t('application', 'You already have an aspect named "{name}".', array('{name}' => $this->name))); } }
public function loadAspect($aspectId) { $aspect = Aspect::model()->findByPk($aspectId); if ($aspect === null || $aspect->user_id !== Yii::app()->getUser()->getModel()->id) { throw new CHttpException(404, Yii::t('application', 'The requested page does not exist.')); } else { return $aspect; } }
public function getACData($attributeName, $query) { $this->setSearchStringV3($query); $this->setSearchFieldsV3(array("OpenWeatherMapName")); $this->setFieldsV3(array("OpenWeatherMapName AS label", "OpenWeatherMapID AS value")); $this->setLimitV3("10"); Aspect::joinPoint("query", $this, __METHOD__, $this); echo $this->asJSON(); }
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; }
public function getHTML($id) { // <editor-fold defaultstate="collapsed" desc="Aspect:jP"> try { $MArgs = func_get_args(); return Aspect::joinPoint("around", $this, __METHOD__, $MArgs); } catch (AOPNoAdviceException $e) { } Aspect::joinPoint("before", $this, __METHOD__, $MArgs); // </editor-fold> if ($_SESSION["S"]->isUserAdmin()) { return parent::getHTML($id); } switch ($id) { case "1": //return OnEvent::script('contentManager.loadPlugin("contentScreen", "mfheOverview");'); /*return " <script type=\"text/javascript\"> if($('mfheOverviewMenuEntry')){ $('contentLeft').update(''); contentManager.loadFrame('contentScreen', 'mfheOverview', -1, 0, 'mfheOverviewGUI;-'); setHighLight($('mfheOverviewMenuEntry')); } </script>"; break;*/ //return OnEvent::script('contentManager.loadPlugin("contentScreen", "mfheOverview");'); /*return " <script type=\"text/javascript\"> if($('mfheOverviewMenuEntry')){ $('contentLeft').update(''); contentManager.loadFrame('contentScreen', 'mfheOverview', -1, 0, 'mfheOverviewGUI;-'); setHighLight($('mfheOverviewMenuEntry')); } </script>"; break;*/ case "2": break; } }
public function getHTML($id) { // <editor-fold defaultstate="collapsed" desc="Aspect:jP"> try { $MArgs = func_get_args(); return Aspect::joinPoint("around", $this, __METHOD__, $MArgs); } catch (AOPNoAdviceException $e) { } Aspect::joinPoint("before", $this, __METHOD__, $MArgs); // </editor-fold> if ($_SESSION["S"]->isUserAdmin()) { return parent::getHTML($id); } switch ($id) { case "1": $AC = anyC::get("JDownload"); $AC->addOrderV3("JDownloadDate", "DESC"); $AC->setLimitV3(19); $T = new HTMLTable(2); $T->weight("light"); $T->addColStyle(1, "padding:5px;padding-left:10px;"); $T->addColStyle(2, "color:grey;text-align:right;padding:5px;"); while ($D = $AC->getNextEntry()) { $T->addRow(array($D->A("JDownloadRenameto"), Util::formatByte($D->A("JDownloadFilesize"), 2))); if ($D->A("JDownloadRenamed") == 0) { $T->addRowClass("error"); } #$r .= OnEvent::script ("\$j('#BrowsermJDownload".$E->getID()."').css('background-color', '');"); $T->addRowStyle("cursor:pointer;"); $T->addRowEvent("click", "contentManager.loadPlugin('contentRight', 'mJDownload', '', " . $D->getID() . ");"); } return "<p class=\"prettyTitle\">Downloads</p>" . $T; break; case "2": break; case "3": return ""; break; } }
protected function roles($role = null) { $roles = array("Verkäuferin" => array("Auftraege" => array("pluginSpecificCanOnlyEditOwn"), "Provisionen" => array("pluginSpecificHideEK"), "mAkquise" => array("pluginSpecificCanSeeOnlyOwn"), "cantEdit" => array("WAdresse", "Adresse"), "cantDelete" => array("WAdresse", "Adresse")), "Vertriebsleiterin" => array("Auftraege" => array("pluginSpecificCanOnlyEditOwn"), "mAkquise" => array("pluginSpecificCanSeeOnlyOwn"), "cantEdit" => array("WAdresse", "Adresse"), "cantDelete" => array("WAdresse", "Adresse")), "Geschäftsführerin" => array("mStatistik" => array("pluginSpecificCanUseControlling"), "Auftraege" => array("pluginSpecificCanSetPayed", "pluginSpecificCanRemovePayed"), "Provisionen" => array("pluginSpecificCanGiveProvisions")), "Buchhalterin" => array("Auftraege" => array("pluginSpecificCanSetPayed", "pluginSpecificCanRemovePayed")), "Lagerverwalterin" => array("mLager" => array("pluginSpecificCanResetLager"))); foreach ($roles as $l => $s) { foreach ($s as $plugin => $rule) { if ($plugin == "cantEdit" or $plugin == "cantDelete") { continue; } try { new $plugin(); continue; } catch (ClassNotFoundException $e) { #unset($roles[$l]); unset($roles[$l][$plugin]); } } } $roles = Aspect::joinPoint("roles", $this, __METHOD__, array($roles), $roles); if ($role != null) { return $roles[$role]; } return $roles; }
public function download() { $this->loadMe(); if (!file_exists($this->getID())) { return; } if (strpos(realpath($this->getID()), Aspect::joinPoint("checkfor", $this, __METHOD__, "", realpath(FileStorage::getFilesDir()))) === false) { return; } #if(strpos(realpath($this->ID), "specifics") === false) return; #if(strpos(strtolower($this->ID), ".pdf") !== false) # header("Content-Type: application/pdf"); #if(strpos(strtolower($this->ID), ".jpg") !== false) # header("Content-Type: image/jpg"); #if(strpos(strtolower($this->ID), ".png") !== false) # header("Content-Type: image/png"); #if(strpos(strtolower($this->ID), ".gif") !== false) # header("Content-Type: image/gif"); $ex = explode(DIRECTORY_SEPARATOR, $this->ID); header("Content-Type: " . $this->A("FileMimetype")); header("Content-Disposition: attachment; filename=\"" . $ex[count($ex) - 1] . "\""); header('Content-Length: ' . filesize($this->ID)); readfile($this->ID); }
function getHTML($id) { $forReload = ""; $displayMode = null; $AuftragID = -1; $bps = $this->getMyBPSData(); if ($bps != -1 and isset($bps["AuftragID"])) { $AuftragID = $bps["AuftragID"]; } if ($bps != -1 and isset($bps["displayMode"])) { $displayMode = $bps["displayMode"]; } $_SESSION["BPS"]->unsetACProperty("AuftragID"); $_SESSION["BPS"]->unsetACProperty("displayMode"); #if($this->A == null AND $id != -1) $this->loadMe(); $this->loadMeOrEmpty(); if ($id * 1 == -1) { $this->A = $this->newAttributes(); $this->A->AuftragID = $AuftragID; if ($displayMode != null) { $this->A->type = $displayMode; } //Has to stay or lieferAdresse will also overwrite a normal Auftrags-Adresse if (Session::isPluginLoaded("mAdressBuch")) { $AB = BPS::getProperty("AdressenGUI", "AdressBuch", null); if ($AB) { $this->A->type = "AB{$AB}"; } } $id = $this->newMe(true, false); $this->forceReload(); try { $K = new Kunden(); if ($displayMode == null and $this->A("type") == "default") { //Or else a lieferAdresse will get a Kundennummer $K->createKundeToAdresse($id, false); } } catch (ClassNotFoundException $e) { } $forReload = "<script type=\"text/javascript\">lastLoadedLeft = {$id}; lastLoadedLeftPlugin = 'Adresse';</script>"; } $OptTab = new HTMLSideTable("right"); if (Session::isPluginLoaded("Kunden") and $this->A->AuftragID == -1) { $B = new Button("Kundendaten", "kunden"); $B->loadFrame("contentLeft", "Kunde", "-1", "0", "KundeGUI;AdresseID:{$this->getID()};action:Kappendix"); $OptTab->addRow($B); } if ($_SESSION["applications"]->getActiveApplication() == "open3A") { if ($displayMode != null) { $OptTab->setTableStyle("width:160px;margin:0px;margin-left:-170px;float:left;"); } if (($id == -1 or $forReload != "") and Session::isPluginLoaded("mImport")) { $OTBV = new Button("Schnell-\nImport", "import"); #$OTBV->rmePCR("importAdresse", "", "getFastImportWindow", "", "Popup.display('Adresse importieren:',transport);"); $OTBV->onclick("Import.openSchnellImportAdresse('Adresse importieren:');"); $OTBV->id("ButtonAdresseSchnellImport"); $OptTab->addRow($OTBV); } if ($id != -1 and Session::isPluginLoaded("Kundenpreise") and $this->A->AuftragID == -1 and $this->A->type == "default") { $ButtonKundenpreise = new Button("Kundenpreise", "package"); $ButtonKundenpreise->onclick("contentManager.loadFrame('contentLeft','Kunde', -1, 0, 'KundeGUI;AdresseID:{$this->ID};action:Kundenpreise');"); $OptTab->addRow($ButtonKundenpreise); } if ($this->A->AuftragID == -1 and (Session::isPluginLoaded("mAnsprechpartner") or Session::isPluginLoaded("mOSM"))) { $OptTab->addRow(""); $OptTab->addCellStyle(1, "height:30px;"); } if ($id != -1 and Session::isPluginLoaded("mAnsprechpartner") and $this->A->AuftragID == -1) { $OptTab->addRow(Ansprechpartner::getButton("Adresse", $this->getID())); } if ($id != -1 and Session::isPluginLoaded("mOSM") and $this->A("AuftragID") == -1) { $OptTab->addRow(OpenLayers::getButton("Adresse", $this->getID())); } } if (Session::isPluginLoaded("mklickTel") and $this->A->AuftragID == -1) { $OptTab->addRow(klickTel::getButton($this->getID())); } $this->loadMeOrEmpty(); $gui = $this->gui; $gui->insertSpaceAbove("tel", "Kontakt"); $gui->insertSpaceAbove("strasse", "Adresse"); $gui->insertSpaceAbove("homepage", "Sonstiges"); $gui->setFormID("AdresseForm"); $fields = array("firma", "position", "anrede", "vorname", "nachname", "AdresseSpracheID", "strasse", "bezirk", "zusatz1", "ort", "land", "tel", "fax", "mobil", "email", "homepage", "gebRem", "gebRemMail", "AuftragID", "KategorieID", "type", "geb", "bemerkung"); if (Session::isPluginLoaded("mLDAP")) { $fields[] = "exportToLDAP"; } $gui->setShowAttributes($fields); $gui->setLabel("bemerkung", "Notizen"); if (Session::isPluginLoaded("mSprache")) { $gui->setLabel("AdresseSpracheID", "Sprache"); $gui->setLabelDescription("AdresseSpracheID", "und Währung"); #$ACS = anyC::get("Sprache"); #$S = array(); #while($SLW = $ACS->getNextEntry()) # $S[$SLW->getID()] = $SLW->A("SpracheSprache")." "." ".$SLW->A("SpracheWaehrung"); $gui->selectWithCollection("AdresseSpracheID", new mSprache(), "SpracheName"); #$gui->setType("AdresseSpracheID", "select"); #$gui->setOptions("AdresseSpracheID", array_keys($S), array_values($S)); #$gui->insertSpaceAbove("firma"); } else { $gui->setType("AdresseSpracheID", "hidden"); } #$gui->setAttributes($this->A); $gui->setObject($this); $gui->setName("Adresse"); $gui->setOptions("anrede", array_keys(self::getAnreden()), array_values(self::getAnreden())); $gui->setType("anrede", "select"); $gui->setType("geb", "hidden"); $gui->setType("gebRemMail", "hidden"); $gui->setType("gebRem", "hidden"); $gui->setType("exportToLDAP", "checkbox"); $gui->insertSpaceAbove("exportToLDAP"); $gui->setFieldDescription("exportToLDAP", "Soll die Adresse auf einen LDAP-Server exportiert werden?"); $gui->setType("AuftragID", "hidden"); $gui->setType("type", "hidden"); #$gui->setLabel("geb","Jahrestag"); $gui->setLabel("ort", "PLZ/Ort"); $gui->setLabel("strasse", "Straße/Hausnr."); $gui->setLabel("tel", "Telefon"); $gui->setLabel("email", "E-Mail"); $gui->setLabel("exportToLDAP", "LDAP-Export?"); $gui->setParser("strasse", "AdresseGUI::parserStrasse", array($this->A("nr"))); $gui->setParser("ort", "AdresseGUI::parserOrt", array($this->A("plz"))); #$gui->useAutoCompletion("plz", (Session::isPluginLoaded("Postleitzahlen") ? "Postleitzahlen" : "Adressen")); if (Session::isPluginLoaded("mStammdaten") or Applications::activeApplication() == "MMDB") { /*if($this->A("land") == ""){ $S = Stammdaten::getActiveStammdaten(); if($S->A("land") == "D") $S->changeA("land","DE"); $this->changeA("land", ISO3166::getCountryToCode($S->A("land"))); }*/ $gui->setType("land", "select"); $countries = ISO3166::getCountries(); $labels = array_merge(array("" => "keine Angabe"), $countries); $values = array_merge(array("" => ""), $countries); $gui->setOptions("land", array_values($values), array_values($labels)); if ($this->A("land") != ISO3166::getCountryToCode("GB") and $this->A("land") != ISO3166::getCountryToCode("US") and $this->A("land") != ISO3166::getCountryToCode("CH")) { $gui->setLineStyle("zusatz1", "display:none;"); $gui->setLineStyle("position", "display:none;"); } if ($this->A("land") != ISO3166::getCountryToCode("DK") and $this->A("land") != ISO3166::getCountryToCode("ES")) { $gui->setLineStyle("bezirk", "display:none;"); } $gui->setLabel("zusatz1", "Zusatz 1"); $gui->setInputJSEvent("land", "onchange", "contentManager.toggleFormFields((this.value == '" . ISO3166::getCountryToCode("GB") . "' || this.value == '" . ISO3166::getCountryToCode("US") . "' || this.value == '" . ISO3166::getCountryToCode("CH") . "') ? 'show' : 'hide', ['zusatz1', 'position']); contentManager.toggleFormFields((this.value == '" . ISO3166::getCountryToCode("DK") . "' || this.value == '" . ISO3166::getCountryToCode("ES") . "') ? 'show' : 'hide', ['bezirk']);"); } if (Session::isPluginLoaded("mGemeinschaft")) { $gui->activateFeature("addCustomButton", $this, "tel", Gemeinschaft::getCallButton($this->A("tel"))); $gui->activateFeature("addCustomButton", $this, "mobil", Gemeinschaft::getCallButton($this->A("mobil"), "mobile")); } $kat = new Kategorien(); $kat->addAssocV3("type", "=", $displayMode != "" ? $displayMode : "1"); $keys = $kat->getArrayWithKeys(); $keys[] = "0"; $values = $kat->getArrayWithValues(); $values[] = "bitte auswählen"; $gui->setOptions("KategorieID", $keys, $values); $gui->setType("bemerkung", "textarea"); $gui->setLabel("KategorieID", "Kategorie"); if ($AuftragID == -1) { $gui->setType("KategorieID", "select"); } else { $gui->setType("KategorieID", "hidden"); $gui->setType("bemerkung", "hidden"); $gui->setType("tel", "hidden"); $gui->setType("fax", "hidden"); $gui->insertSpaceAbove("email"); $gui->setType("homepage", "hidden"); $gui->setType("exportToLDAP", "hidden"); $gui->setType("mobil", "hidden"); } switch ($displayMode) { case "auftragsAdresse": $gui->setJSEvent("onSave", "function() {\n\t\t\t\t\tcontentManager.loadFrame('contentLeft','Auftrag',{$this->A->AuftragID});\n\t\t\t\t\tcontentManager.loadFrame('contentRight','Auftraege');\n\t\t\t\t}"); break; case "lieferAdresse": $this->A->type = "lieferAdresse"; $gui->setJSEvent("onSave", "function() {\n\t\t\t\t\tcontentManager.loadFrame('contentRight','Auftraege');\n\t\t\t\t\tcontentManager.loadFrame('subframe','GRLBM',{$this->A->AuftragID});\n\t\t\t\t}"); break; } Aspect::joinPoint("buttons", $this, __METHOD__, $OptTab); $gui->setStandardSaveButton($this, "Adressen"); $gui->customize($this->customizer); return $forReload . $OptTab . $gui->getEditHTML(); }
case "edit_aspect": // do something. $new_aspect = new Aspect(); $new_aspect->load((int) $_POST['aspect_id']); $new_aspect->aspect_type = (int) $_POST['aspect_type']; $new_aspect->aspect_data = $_POST['aspect_data']; $new_aspect->aspect_binary = NULL; $new_aspect->predicted_accuracty = NULL; $new_aspect->aspect_notes = $_POST['aspect_notes']; $new_aspect->aspect_source = $_POST['aspect_source']; $new_aspect->update(); $output = 'Updated ' . $new_aspect->return_aspect_type_name() . '.'; echo $output; break; case "delete_aspect": $new_aspect = new Aspect(); $new_aspect->load($_POST['aspect_id']); $new_aspect->delete(); echo "Deleted aspect."; break; case "new_aspect_type": $new_aspect_type = new AspectType(); $new_aspect_type->aspect_groups[] = $_POST['aspect_group']; $new_aspect_type->aspect_name = $_POST['aspect_name']; $new_aspect_type->aspect_description = $_POST['aspect_description']; $new_aspect_type->markdown = $_POST['markdown']; $new_aspect_type->is_viewable = $_POST['viewable']; $new_aspect_type->save(); echo "Added new aspect type."; break; default:
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(); } }
public static function types($nr = null) { // <editor-fold defaultstate="collapsed" desc="Aspect:jP"> try { $MArgs = func_get_args(); return Aspect::joinPoint("around", null, __METHOD__, $MArgs); } catch (AOPNoAdviceException $e) { } Aspect::joinPoint("before", null, __METHOD__, $MArgs); // </editor-fold> $types = array(1 => "Anruf", 2 => "Termin", 3 => "Termin Kaltaquise", 4 => "Termin Ersttermin", 5 => "Termin Folgetermin"); if ($nr == null) { return $types; } else { if (!isset($types[$nr])) { return "Termin"; } return $types[$nr]; } }
public function getHTML($id, $page) { #$bps = $this->getMyBPSData(); Aspect::registerOnetimePointCut("aboveList", "GUIFactory::getContainer", "FileManagerGUI::adviceAboveList"); /*$rootDir = null; if($bps != -1 AND isset($bps["root"])) $rootDir = $bps["root"]; if($rootDir != null){ $T = new HTMLTable(1); $rel = "specifics/$rootDir"; $root = Util::getRootPath().$rel; $_SESSION["BPS"]->setProperty("FileManagerGUI", "path", $root); $_SESSION["BPS"]->setProperty("FileManagerGUI", "root", $root); $F = new File($root); $F->loadMe(); if($F->getA() == null){ if(is_writable(Util::getRootPath()."specifics")) mkdir($root); else{ $B = new Button("", "stop"); $B->type("icon"); $B->style("float:left;margin-right:10px;"); $T->addRow($B."Das Verzeichnis <code>$rel</code> existiert nicht und kann nicht automatisch angelegt werden, da keine Schreibberechtigung für <code>specifics</code> vorliegt."); return $T; } } } $bps = $this->getMyBPSData(); //go again #print_r($bps); if(isset($bps["path"]) AND strpos($bps["path"], $bps["root"]) === false) $bps["path"] = $bps["root"]; if($bps != -1 AND isset($bps["path"])) $this->setDir($bps["path"]);*/ $pathing = $this->setPath(); if ($pathing !== true) { return $pathing; } $this->hideDirs(true); $gui = new HTMLGUIX(); $gui->object($this); $gui->name("Datei"); #$gui->colWidth("FileIsDir", 20); $gui->attributes(array("FileName")); #$gui->parser("FileIsDir","mFileGUI::popupIsDirParser2"); $gui->parser("FileName", "mFileGUI::nameParser2"); $gui->addToEvent("onDelete", BPS::getProperty("FileManagerGUI", "reloadFunction", "contentManager.reloadFrame('contentLeft');")); $gui->options(true, false, false); $gui->displayMode(BPS::getProperty("FileManagerGUI", "displayMode", "CRMSubframeContainer")); #$gui->displayMode("popup"); return $gui->getBrowserHTML(-1); }
public function changeAddressKlickTel($data) { $KT = new klickTel(-1); try { $result = $KT->checkAddress($data["AdresseID"]); } catch (Exception $e) { die("<p>" . $e->getMessage() . "</p>"); } #$Adresse = new Adresse($data["AdresseID"]); $useLocation = null; foreach ($result as $k => $A) { if ($k == $data["useNr"]) { $useLocation = $A; } } $AdresseNew = new Adresse($data["AdresseID"]); $AdresseNew->changeA("strasse", $useLocation->street); if (trim($useLocation->streetnumber) != "") { $AdresseNew->changeA("nr", $useLocation->streetnumber); } $AdresseNew->changeA("plz", $useLocation->zipcode); $AdresseNew->changeA("ort", $useLocation->city); $AdresseNew->saveMe(true, false); Aspect::joinPoint("after", $this, __METHOD__, array($data)); //call AFTER new Adresse! #$reload = OnEvent::script(""); #echo $reload; #die("<p>Die Adresse wurde geändert und lautet nun:</p><p>".$AdresseNew->getHTMLFormattedAddress()."</p>".$reload); }
public static function getS($value, $default) { Environment::load(); $return = Environment::$currentEnvironment->get($value, $default); switch ($value) { case "onLogout": return str_replace("%CLOUDUSER", Environment::$currentEnvironment->cloudUser(), $return); break; case "databaseData": if (is_array($return)) { return $return; } $ex = explode(";;", $return); $dbData = array(); $dbData["host"] = $ex[0]; $dbData["user"] = $ex[1]; $dbData["password"] = $ex[2]; $dbData["httpHost"] = "*"; $dbData["datab"] = $ex[3]; $return = $dbData; break; case "allowedApplications": if ($return == null) { return null; } return explode(",", $return); break; case "allowedPlugins": if ($return == null) { return null; } return explode(",", $return); break; case "customizer": if ($return == null) { return $default; } return explode(",", $return); break; } $return = Aspect::joinPoint("alter", null, __METHOD__, array($value, $default), $return); return $return; }
public function get_aspect_data($aspect_type_id) { // If the Aspect_type is present, return the data. Otherwise, return false. $output = false; if ($this->has_aspect($aspect_type_id)) { $a = new Aspect(); $a->load($this->has_aspect($aspect_type_id)); $output = $a->aspect_data; } return $output; }
public static function getS($value, $default, $forceReload = false) { Environment::load($forceReload); $return = Environment::$currentEnvironment->get($value, $default); switch ($value) { case "usePWEncryption": try { $LD = LoginData::get("ADServerUserPass"); if ($LD != null and $LD->A("server") != "") { return false; } } catch (Exception $e) { } return true; break; case "onLogout": case "onTimeout": return str_replace("%CLOUDUSER", Environment::$currentEnvironment->cloudUser(), $return); break; case "databaseData": if (is_array($return)) { return $return; } $ex = explode(";;", $return); $dbData = array(); $dbData["host"] = $ex[0]; $dbData["user"] = $ex[1]; $dbData["password"] = $ex[2]; $dbData["httpHost"] = "*"; $dbData["datab"] = $ex[3]; $return = $dbData; break; case "databaseDataWrite": if ($return == null) { return null; } if (is_array($return)) { return $return; } $ex = explode(";;", $return); $dbData = array(); $dbData["host"] = $ex[0]; $dbData["user"] = $ex[1]; $dbData["password"] = $ex[2]; $dbData["httpHost"] = "*"; $dbData["datab"] = $ex[3]; $return = $dbData; case "allowedApplications": if ($return == null) { return null; } return explode(",", $return); break; case "pluginsExtra": case "allowedPlugins": case "hiddenPlugins": if ($return == null) { return $default; } return explode(",", $return); break; case "customizer": case "customizerExtra": if ($return == null) { return $default; } return explode(",", $return); break; } $return = Aspect::joinPoint("alter", null, __METHOD__, array($value, $default), $return); return $return; }
function __construct($width, $height) { parent::__construct($width, $height); }
public static function httpTestAndLoad($url, $timeout = 10) { $timeout = (int) round($timeout / 2 + 9.999999999999999E-12); $return = array(); $query = Aspect::joinPoint("query", null, __METHOD__); ### 1 ### $inf = parse_url($url . ($query != null ? "?q={$query}" : "?q=" . Util::invokeStaticMethod("Util", "eK", array(false)))); if (!isset($inf['scheme']) or $inf['scheme'] !== 'http') { return array('status' => -1); } if (!isset($inf['host'])) { return array('status' => -2); } $host = $inf['host']; if (!isset($inf['path'])) { return array('status' => -3); } $path = $inf['path']; if (isset($inf['query'])) { $path .= '?' . $inf['query']; } if (isset($inf['port'])) { $port = $inf['port']; } else { $port = 80; } ### 2 ### $pointer = fsockopen($host, $port, $errno, $errstr, $timeout); if (!$pointer) { return array('status' => -4, 'errstr' => $errstr, 'errno' => $errno); } socket_set_timeout($pointer, $timeout); ### 3 ### $head = 'GET ' . $path . ' HTTP/1.1' . "\r\n" . 'Host: ' . $host . "\r\n"; if (isset($inf['user'])) { $head .= 'Authorization: Basic ' . base64_encode($inf['user'] . ':' . (isset($inf['pass']) ? $inf['pass'] : '')) . "\r\n"; } if (func_num_args() > 2) { for ($i = 2; $i < func_num_args(); $i++) { $arg = func_get_arg($i); if (strpos($arg, ':') !== false and strpos($arg, "\r") === false and strpos($arg, "\n") === false) { $head .= $arg . "\r\n"; } } } #else $head .= 'User-Agent: phynx Version checker' . "\r\n"; $head .= "X-Application: " . $_SESSION["applications"]->getActiveApplication() . "\r\n"; $head .= "X-Version: " . $_SESSION["applications"]->getRunningVersion() . "\r\n"; $head .= "X-PHPVersion: " . phpversion() . "\r\n"; $head .= 'Connection: close' . "\r\n" . "\r\n"; ### 4 ### fputs($pointer, $head); $response = ''; $status = socket_get_status($pointer); while (!$status['timed_out'] && !$status['eof']) { $response .= fgets($pointer); $status = socket_get_status($pointer); } fclose($pointer); if ($status['timed_out']) { return array('status' => -5, '_request' => $head); } ### 5 ### $res = str_replace("\r\n", "\n", $response); $res = str_replace("\r", "\n", $res); $res = str_replace("\t", ' ', $res); $ares = explode("\n", $res); $first_line = explode(' ', array_shift($ares), 3); $return['status'] = trim($first_line[1]); $return['reason'] = trim($first_line[2]); foreach ($ares as $line) { $temp = explode(':', $line, 2); if (isset($temp[0]) and isset($temp[1])) { $return[strtolower(trim($temp[0]))] = trim($temp[1]); } } $return['_response'] = $response; $return['_request'] = $head; return $return; }
public function lostPassword($username) { // <editor-fold defaultstate="collapsed" desc="Aspect:jP"> try { $MArgs = func_get_args(); return Aspect::joinPoint("around", $this, __METHOD__, $MArgs); } catch (AOPNoAdviceException $e) { } Aspect::joinPoint("before", $this, __METHOD__, $MArgs); // </editor-fold> if ($username == "") { Red::errorC("User", "lostPasswordErrorUser"); } $Lang = $this->loadLanguageClass("User")->getText(); $ac = new anyC(); $ac->setCollectionOf("User"); $ac->addAssocV3("username", "=", $username); $ac->lCV3(); $U = $ac->getNextEntry(); if ($U == null) { try { $AL = new mphynxAltLogin(); $AL->addAssocV3("username", "=", $username); $U = $AL->getNextEntry(); } catch (Exception $e) { Red::errorC("User", "lostPasswordErrorUser"); } } if ($U == null) { Red::errorC("User", "lostPasswordErrorUser"); } $Admin = new anyC(); $Admin->setCollectionOf("User"); $Admin->addAssocV3("isAdmin", "=", "1"); $Admin = $Admin->getNextEntry(); if ($Admin == null) { Red::errorC("User", "lostPasswordErrorAdmin"); } if ($Admin->A("UserEmail") == "") { Red::errorC("User", "lostPasswordErrorAdmin"); } $mail = new htmlMimeMail5(); $mail->setFrom("phynx@" . $_SERVER["HTTP_HOST"]); $mail->setSubject("[phynx] Password recovery for user {$username}"); $mail->setText(wordwrap("Dear " . $Admin->A("name") . ",\n\nyou received this email because the user '{$username}' of the phynx framework at {$_SERVER['HTTP_HOST']} has lost his password and is requesting a new one.\n\nBest regards\n\tphynx", 80)); if (!$mail->send(array($Admin->A("UserEmail")))) { Red::errorC("User", "lostPasswordErrorAdmin"); } Red::alertC("User", "lostPasswordOK"); }
public static function clearPointCuts() { Aspect::$pointCuts = array(); }
function saveMe($checkUserData = true, $output = true) { // <editor-fold defaultstate="collapsed" desc="Aspect:jP"> try { $MArgs = func_get_args(); return Aspect::joinPoint("around", $this, __METHOD__, $MArgs); } catch (AOPNoAdviceException $e) { } Aspect::joinPoint("before", $this, __METHOD__, $MArgs); // </editor-fold> $ps = mUserdata::getPluginSpecificData("Adressen"); if (isset($ps["pluginSpecificCanUse1xAdresse"]) and $this->A->AuftragID == -1) { die("Speichern nicht möglich!"); } $this->changeA("lastChange", time()); if ($this->A("AuftragID") != -1 and ($this->A("type") == "auftragsAdresse" or $this->A("type") == "default")) { $Auftrag = new Auftrag($this->A("AuftragID")); $Auftrag->updateAdressID($this->getID()); } // <editor-fold defaultstate="collapsed" desc="Aspect:jP"> return Aspect::joinPoint("after", $this, __METHOD__, parent::saveMe($checkUserData, $output)); // </editor-fold> }
public function write_aspect() { $new_aspect = new Aspect(); $new_aspect->aspect_type = ''; $new_aspect->aspect_data = $this->result; $new_aspect->aspect_source = 'Wikipedia API results'; $new_aspect->markdown = 0; $new_aspect->is_hidden = 1; $new_aspect->save(); $new_subject = new Subject(); $new_subject->load($this->subject_id); $new_subject->add_aspect($new_aspect); $new_subject->update(); }
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 ($A->{$v} != "") { $B = ""; if (isset($this->fieldButtons[$v])) { $B = $this->fieldButtons[$v]; $B->style("float:right;"); } $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;"); $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; }
* for those components. As for my code, it's Creative * Commons Attribution-NonCommercial-ShareAlike 3.0 * United States. (http://creativecommons.org/licenses/by-nc-sa/3.0/us/). * For more information, contact Ian Monroe: ian@ianmonroe.com * * @author Ian Monroe <*****@*****.**> * @copyright 2016 * @version 0.1 ALPHA UNSTABLE * @link http://www.ianmonroe.com * @since File included in initial release * */ if (!isset($APP)) { die; } $current_aspect = new Aspect(); $default_controller = 'src/controllers/aspect_controller.php'; $action = 'edit_aspect'; $form_id = 'edit_aspect_form'; $id = NULL; if (isset($_GET['id'])) { $id = (int) trim($_GET['id']); $current_aspect->load($id); } // $current_aspect_group = new AspectGroup; // $current_aspect_group->load($current_aspect->return_aspect_group_id()); // Dropdowns are here if you need them. // $dropdowns = new HTMLDropDown; ?>
public function getContainer($Table, $caption) { $widths = Aspect::joinPoint("changeWidths", $this, __METHOD__); if ($widths == null) { $widths = array(700); } if ($this->tableMode == "CRMSubframeContainer") { $newButton = ""; if ($this->showNew) { $newButton = $this->getNewButton(); $newButton->style("float:right;margin-left:10px;margin-top:-2px;"); } $pageBrowser = $this->getPageBrowser(); return "\n\t\t\t<div id=\"subFrameContainer{$this->collectionName}\" style=\"margin-top:20px;\">\n\t\t\t\t<div style=\"width:{$widths['0']}px;\" class=\"backgroundColor1 Tab\">\n\t\t\t\t\t<p>{$newButton}<span style=\"float:right;\">{$pageBrowser}</span>{$caption}</p>\n\t\t\t\t</div>\n\t\t\t\t<div id=\"subFrameEdit{$this->collectionName}\" style=\"display:none;width:{$widths['0']}px;padding-bottom:15px;\"></div>\n\t\t\t\t<div id=\"subFrame{$this->collectionName}\" style=\"width:{$widths['0']}px;margin-left:10px;\">\n\t\t\t\t" . Aspect::joinPoint("aboveList", $this, __METHOD__) . "\n\t\t\t\t\t<div style=\"overflow:auto;max-height:252px;\">\n\t\t\t\t\t{$Table}\n\t\t\t\t\t</div>\n\t\t\t\t" . Aspect::joinPoint("belowList", $this, __METHOD__) . "</div>\n\t\t\t</div>"; } if ($this->tableMode == "BrowserRight" or $this->tableMode == "BrowserLeft" or $this->tableMode == "popup" or $this->tableMode == "screen") { $abort = ""; if ($this->isSelection) { $abort = $this->getAbortButton(); } return $abort . Aspect::joinPoint("aboveList", $this, __METHOD__) . $Table; } }
public function getActiveApplicationName() { // <editor-fold defaultstate="collapsed" desc="Aspect:jP"> try { $MArgs = func_get_args(); return Aspect::joinPoint("around", $this, __METHOD__, $MArgs); } catch (AOPNoAdviceException $e) { } Aspect::joinPoint("before", $this, __METHOD__, $MArgs); // </editor-fold> $name = Applications::activeApplication(); echo Environment::getS("renameApplication:{$name}", $name); }
public function cols($cols) { if ($cols != 2 and $cols != 4 and $cols != 1) { return; } $widths = Aspect::joinPoint("changeWidths", $this, __METHOD__); $this->table = new HTMLTable($cols, $this->title); $this->cols = $cols; if ($cols == 4) { if ($widths == null) { $widths = array(700, 132, 218); } $this->table->setTableStyle("width:{$widths['0']}px;margin-left:10px;"); $this->table->addColStyle(1, "width:{$widths['1']}px;"); $this->table->addColStyle(2, "width:{$widths['2']}px;"); $this->table->addColStyle(3, "width:{$widths['1']}px;"); $this->table->addColStyle(4, "width:{$widths['2']}px;"); $this->table->setColClass(1, "backgroundColor3"); $this->table->setColClass(2, "backgroundColor2"); $this->table->setColClass(3, "backgroundColor3"); $this->table->setColClass(4, "backgroundColor2"); } }
public function getACHTML($attributeName, $query) { $this->inAC = true; $gui = $this->gui; switch ($attributeName) { case "plz": $this->addAssocV3("plz", "LIKE", $query . "%"); $this->addGroupV3("plz"); $this->setFieldsV3(array("plz", "ort")); $this->setLimitV3("10"); $this->lCV3(); #$gui->setAttributes($this->collector); $gui->setObject($this); $gui->setShowAttributes(array("plz", "ort")); echo $gui->getACHTMLBrowser(); break; case "quickSearchAdressen": case "quickSearchmAdresse": $mode = "quickSearchLoadFrame"; $hasNr = false; if (is_numeric($query)) { #$this->addAssocV3("kundennummer", "LIKE", "%".$query."%"); $this->addAssocV3("kundennummer", "=", $query); $this->addJoinV3("Kappendix", "AdresseID", "=", "AdresseID"); $hasNr = true; } else { unset($this->searchFields[array_search("kundennummer", $this->searchFields)]); $this->setSearchStringV3($query); $this->setSearchFieldsV3($this->searchFields); } $this->setLimitV3($this->searchLimit); Aspect::joinPoint("query", $this, __METHOD__, array($attributeName, $query)); $this->lCV3(); if (!$hasNr and $this->numLoaded() > 0) { $AC = anyC::get("Kappendix"); while ($A = $this->getNextEntry()) { $AC->addAssocV3("AdresseID", "=", $A->getID(), "OR"); } $this->resetPointer(); $kundennummern = array(); while ($K = $AC->getNextEntry()) { $kundennummern[$K->A("AdresseID")] = $K->A("kundennummer"); } while ($A = $this->getNextEntry()) { if (!isset($kundennummern[$A->getID()])) { continue; } $A->changeA("kundennummer", $kundennummern[$A->getID()]); } $this->resetPointer(); } $gui->setObject($this); #$gui->setAttributes($this->collector); $gui->setShowAttributes(array("kundennummer", "firma")); #$gui->setParser("firma","AdressenGUI::ACFirmaParser",array("\$sc->nachname","\$sc->vorname")); $gui->setParser("firma", "AdressenGUI::ACFirmaParser", array("\$sc->nachname", "\$sc->vorname", "\$sc->plz", "\$sc->ort", "\$sc->strasse")); $_SESSION["BPS"]->registerClass(get_class($gui)); $_SESSION["BPS"]->setACProperty("targetFrame", "contentLeft"); $_SESSION["BPS"]->setACProperty("targetPlugin", "Adresse"); $gui->autoCheckSelectionMode(get_class($this)); $gui->customize($this->customizer); echo $gui->getACHTMLBrowser($mode); break; } }