function processMethod($ctrl = 0, $elementName = "") { global $allowedMethods, $gorumview, $includeOnceList; $saveCtrl = gclone($this->ctrl); // elmentjuk az aktualis Controllert // beallitjuk az erre a processMethodra ervenyes uj Controllert: if ($ctrl) { $this->ctrl =& new AppController($ctrl); $this->propagateFieldsForEasyAccess(); } if (isset($includeOnceList[$this->getClass()])) { // ha olyan class erkezik, ami alapbol nincs beinkludolva, akkor azt itt tesszuk meg: foreach ($includeOnceList[$this->getClass()] as $file) { include_once $file; } } if (!isset($allowedMethods[$this->method]) || !class_exists($this->getClass())) { // Ez akkor lehet, ha egy legbolkapott queryStringet hasznal valaki, // vagy pl. ha egy template-ben nem letezo js/css/img hivatkozas van $this->ctrl =& new AppController("staticpage/show/uetreufgdjhgf"); // something that certainly doesn't exist $this->propagateFieldsForEasyAccess(); } if ($cl = $this->getClass()) { $base = is_callable(array($cl, "createObject")) ? call_user_func(array($cl, "createObject")) : new $cl(FALSE); // without init (az appsettings kedveert) $base->initClassVars($this->getClassVars()); if ($this->isAction() && !$this->isAjax()) { $this->beforeAction($base); } } else { $base = 0; } $cacheManager = new CacheManager($base); $ret = 0; // a vegrehajtott metodusnak lehet visszateresi erteke, de nem biztos if ($cacheManager->checkCache()) { //FP::log("Toltes cache-bol"); $gorumview->addElement($elementName, $cacheManager); } else { //FP::log("Tenyleges vegrehajtas"); eval($allowedMethods[$this->method]); // $elementName es $cacheManager itt atmehet parameterkent if ($cacheManager->isCacheActive()) { $cacheManager->saveIncludeCache(); } } if ($cl && $this->isAction() && !$this->isAjax()) { $this->afterAction($base); } elseif (!$this->isAjax()) { $this->afterView($base); } if ($ctrl) { $this->ctrl = $saveCtrl; // visszaallitjuk a regi Controllert: $this->propagateFieldsForEasyAccess(); } //var_dump($_SESSION); return $ret; }
function move() { global $gorumroll; // csak admin move-olhat: hasAdminRights($isAdm); if (!$isAdm) { return; } $oldCid = G::getAttr($this->id, "item", "cid"); // ha nincs move-olas: if ($oldCid == $this->cid) { return; } G::load($newCategory, array("SELECT * FROM @category WHERE id=#cid#", $this->cid)); // Ellenorzes: ItemField::filterCompatibleCategories($oldCid, $newCategory); if (!count($newCategory)) { return; } // trukkozes $newCategory = $newCategory[0]; CustomField::addCustomColumns("item"); G::load($oldFields, array("SELECT columnIndex FROM @customfield WHERE cid=#cid# ORDER BY sortId ASC", $oldCid)); G::load($newFields, array("SELECT columnIndex FROM @customfield WHERE cid=#cid# ORDER BY sortId ASC", $this->cid)); load($this); $newObj = gclone($this); $newObj->cid = $newCategory->id; if ($newCategory->immediateAppear) { $newObj->status = TRUE; } for ($i = 0; $i < count($oldFields); $i++) { if (isset($this->{$oldFields[$i]->columnIndex})) { $newObj->{$newFields[$i]->columnIndex} = $this->{$oldFields[$i]->columnIndex}; } } modify($newObj); // itemnumok beallitasa if ($newObj->status) { $newCategory->increaseDirectItemNum(); } G::load($oldCategory, $oldCid, "appcategory"); if ($this->status) { $oldCategory->decreaseDirectItemNum(); } Roll::setInfoText("adMoved"); CacheManager::resetCache($this->cid); CacheManager::resetCache($oldCid); }
function cacheFatherObjects() { global $fatherCatList; global $gorumroll; if ((!isset($this->id) || !$this->id) && $gorumroll->rollid) { $this->id = $gorumroll->rollid; $ret = load($this); if ($ret) { $txt = "can not load category object"; handleError($txt); } } if (!isset($fatherCatList) || !$fatherCatList) { $fatherCatList = array(); //if ($withOwn) $fatherCatList[] = $this; $childCat = gclone($this); while (!empty($childCat->up)) { G::load($childCat, $childCat->up, "appcategory"); $fatherCatList[] = $childCat; } $fatherCatList = array_reverse($fatherCatList); } }
function savePost(&$base) { $_SESSION["post"] = gclone($base); Object::trimUnnecessaryAssociations($_SESSION["post"]); }