Example #1
0
     if ($reload == 'false') {
         $reload = false;
     } else {
         $reload = true;
     }
     // Move page down
     if ($pageMgr->tree->down($pageID) === true) {
         //$koala->callJSFunction('Koala.yg_moveDown', 'page', $pageID.'-'.$siteID, 'name', NULL, $reload);
         $jsQueue->add($pageID, HISTORYTYPE_PAGE, 'PAGE_MOVEDOWN', sGuiUS(), 'name');
     } else {
         $koala->alert($itext['TXT_ERROR_ACCESS_DENIED']);
     }
     break;
 case 'orderPageSubpages':
     $pagelist = $this->params['listArray'];
     $subnodes = $pageMgr->getSubnodes($pageID);
     foreach ($subnodes as $sn_idx => $subnode) {
         if ($subnode['ID'] != $pagelist[$sn_idx]) {
             $count++;
             if ($count == 1) {
                 $firstchanged = array($subnode['ID'], $pagelist[$sn_idx]);
             }
             $lastchanged = array($subnode['ID'], $pagelist[$sn_idx]);
         }
     }
     $count = 0;
     if ($firstchanged && $lastchanged) {
         // Find out which item has been dragged
         if ($firstchanged[0] == $lastchanged[1]) {
             $changed = $firstchanged[0];
         } elseif ($firstchanged[1] == $lastchanged[0]) {
Example #2
0
switch ($action) {
    case 'shredderObject':
        $objectType = $this->params['yg_type'];
        $objectYGID = $this->params['yg_id'];
        $confirmed = $this->params['confirmed'];
        $positive = $this->params['positive'];
        $winID = $this->params['winID'];
        $currObject = explode('-', $objectYGID);
        $currObject = $currObject[0];
        switch ($objectType) {
            case 'page':
                $currSite = explode('-', $objectYGID);
                $currSite = $currSite[1];
                $pageMgr = new PageMgr($currSite);
                // Check if object has subnodes
                $subnodes = $pageMgr->getSubnodes($currObject, false);
                if (count($subnodes) > 0) {
                    // Move subnodes to parent
                    $currPage = $pageMgr->getPage($currObject);
                    $pageInfo = $currPage->get();
                    $currentLevel = $pageInfo['LEVEL'];
                    $currentParent = $pageInfo['PARENT'];
                    foreach ($subnodes as $subnode) {
                        if ($subnode['LEVEL'] == $currentLevel + 1) {
                            if (!$pageMgr->tree->moveTo($subnode['ID'], $currentParent)) {
                                $koala->alert($itext['TXT_ERROR_ACCESS_DENIED']);
                            }
                        }
                    }
                }
                if (!in_array($currObject, $pageMgr->remove($currObject))) {