Esempio n. 1
0
     //the page used is the father of the current page
     //load parent page
     $cms_page = CMS_tree::getPageByID($newParent);
     $currentPage = $newParent;
     if ($cms_page->hasError()) {
         CMS_grandFather::raiseError('Selected page (' . $currentPage . ') has error ...');
         $view->show();
     }
     //check for user rights on page
     if (!$cms_user->hasPageClearance($cms_page->getID(), CLEARANCE_PAGE_EDIT)) {
         CMS_grandFather::raiseError('User has no edition rights on page (' . $currentPage . ') ...');
         $view->show();
     }
     $initialStatus = $cms_page->getStatus()->getHTML(false, $cms_user, MOD_STANDARD_CODENAME, $cms_page->getID());
     $newPagesOrder = explode(',', $value);
     if (CMS_tree::changePagesOrder($newPagesOrder, $cms_user)) {
         $edited = RESOURCE_EDITION_SIBLINGSORDER;
         $logAction = CMS_log::LOG_ACTION_RESOURCE_EDIT_SIBLINGSORDER;
         //must reload page
         $cms_page = CMS_tree::getPageByID($cms_page->getID());
     } else {
         $cms_message = $cms_language->getMessage(MESSAGE_PAGE_ACTION_SIBLINGMOVE_ERROR);
         $cms_page->raiseError('Error during move of page ' . $cms_page->getID() . '. Can\'t apply new order.');
     }
 } else {
     if (!$cms_page->isProtected()) {
         //this is a page moving
         $newPagesOrder = explode(',', $value);
         if (CMS_tree::movePage($cms_page, CMS_tree::getPageByID($newParent), $newPagesOrder, $cms_user)) {
             $edited = RESOURCE_EDITION_MOVE;
             $logAction = CMS_log::LOG_ACTION_RESOURCE_EDIT_MOVE;