예제 #1
0
 function preview()
 {
     hasAdminRights($isAdm);
     if (!$isAdm) {
         handleErrorPerm(__FILE__, __LINE__);
     }
     $_S =& new AppSettings();
     foreach ($_POST as $attr => $val) {
         $_S->{$attr} = $val;
     }
 }
예제 #2
0
파일: category.php 프로젝트: alencarmo/OCF
 function recalculateAllItemNums($overridePermission = FALSE)
 {
     if (!$overridePermission) {
         hasAdminRights($isAdm);
         if (!$isAdm) {
             handleErrorPerm(__FILE__, __LINE__);
         }
     }
     $cats = new AppCategory();
     $query = "SELECT * FROM @category WHERE up=0";
     loadObjectsSql($cats, $query, $cats);
     foreach ($cats as $cat) {
         $cat->recalculateAllItemNumsCore();
     }
     Roll::setInfoText("itemNumbersRecalculated");
     $this->nextAction =& new AppController("/");
 }
예제 #3
0
파일: user.php 프로젝트: alencarmo/OCF
 function changeAdmStatus()
 {
     hasAdminRights($isAdm);
     if (!$isAdm) {
         handleErrorPerm(__FILE__, __LINE__);
     }
     load($this);
     $this->isAdm = $this->isAdm ? FALSE : TRUE;
     modify($this);
     Roll::setInfoText("admstatchanged");
 }
예제 #4
0
파일: category.php 프로젝트: alencarmo/OCF
 function organize()
 {
     global $siteDemo;
     hasAdminRights($isAdm);
     if (!$isAdm) {
         handleErrorPerm(__FILE__, __LINE__);
     }
     if (!class_exists('rss') || $siteDemo) {
         return;
     }
     ini_set("max_execution_time", 0);
     $hierarchyChanged = FALSE;
     $sortId = 100;
     $firstIndex = 0;
     // ebben osszegyujtjuk az osszes olyan kategoria id-jet, ami egy valtoztatott blokkban van:
     $cidsInBlocksSoFar = array();
     if (AppCategory::is_assoc($_REQUEST['nested-sortable-widget'])) {
         $modifiedBlocks = array($_REQUEST['nested-sortable-widget']);
     } else {
         $modifiedBlocks =& $_REQUEST['nested-sortable-widget'];
     }
     //FP::log($modifiedBlocks);
     // ha nincs pagination:
     if (count($modifiedBlocks) == 1 && $modifiedBlocks[0]["count"] == $this->getCategoryCount()) {
         //$fp->log("No pagination");
         $this->updateOrderIter($modifiedBlocks[0], $sortId, $firstIndex, $hierarchyChanged, $cidsInBlocksSoFar);
     } else {
         //$fp->log("Pagination");
         // lekerjuk a valtoztatas elotti kategoria fat, mert ossze kell fesulni a valtoztatott blokkokkal:
         G::load($cats, "SELECT * FROM @category WHERE up=0 ORDER BY sortId ASC");
         $tree =& $this->getCategoryTree($cats);
         //$fp->log($tree, "Tree");
         $firstNode =& $tree[0];
         // $tIndex egy tomb ami a tree egy agan levo node-okra mutato referenciakat tartalmaz:
         $tIndex = array($firstNode);
         foreach ($modifiedBlocks as $block) {
             //$fp->group("Block begins - first index: $firstIndex");
             //$fp->log($sortId, "Starting sortId");
             //$fp->log($block["firstIndex"], "First index of the block");
             // a regi fa nodjainak sortId-jit frissitgetjuk addig, amig el nem jutunk az aktualis blokkig:
             while ($firstIndex < $block["firstIndex"]) {
                 $this->updateOriginalTreeNode($tree, $tIndex, $sortId);
                 $firstIndex++;
             }
             //$fp->log($firstIndex, "First index after updating old nodes");
             //$fp->log($sortId, "SortId after updating old nodes");
             // a blokk elemeinek update-je:
             $this->updateOrderIter($block, $sortId, $firstIndex, $hierarchyChanged, $cidsInBlocksSoFar);
             //$fp->log($firstIndex, "First index after updating block");
             //$fp->log($sortId, "SortId after updating block");
             // amig az a blokkokban mar szereplo nodokat tartalmaz, "skippeljuk" a regi fat:
             while ($tIndex && in_array($tIndex[count($tIndex) - 1]["cat"]->id, $cidsInBlocksSoFar)) {
                 $this->advanceTreeIndex($tree, $tIndex);
             }
             //$fp->groupend();
         }
         //$fp->group("Updating the rest of the old nodes");
         // az osszes valtoztatott blokk utani regi faban levo elemet is update-ezni kell:
         while ($tIndex) {
             $this->updateOriginalTreeNode($tree, $tIndex, $sortId);
         }
         //$fp->groupend();
     }
     if ($hierarchyChanged) {
         $this->recalculateAllItemNums(TRUE);
     }
     die;
 }
예제 #5
0
파일: settings.php 프로젝트: alencarmo/OCF
 function save()
 {
     global $settings_typ, $siteDemo;
     hasAdminRights($isAdm);
     if (!$isAdm) {
         handleErrorPerm(__FILE__, __LINE__);
     }
     if ($siteDemo) {
         echo "MIU:DISABLED";
         die;
     }
     foreach ($_POST as $attr => $val) {
         if (isset($settings_typ["attributes"][$attr])) {
             executeQuery("UPDATE @settings SET {$attr}=#val# WHERE id=1", $val);
         }
     }
     echo "MIU:OK";
     die;
 }