$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; //must reload page $cms_page = CMS_tree::getPageByID($cms_page->getID()); } else { $cms_message = $cms_language->getMessage(MESSAGE_PAGE_ACTION_MOVE_ERROR); $cms_page->raiseError('Error during move of page ' . $cms_page->getID() . '.'); } } else { $cms_message = $cms_language->getMessage(MESSAGE_PAGE_ACTION_ERROR_PAGE_PROTECTED); $cms_page->raiseError('Error during modification of page ' . $cms_page->getID() . '. Page is protected.'); } } } else { $cms_message = $cms_language->getMessage(MESSAGE_PAGE_ACTION_MOVE_ERROR_NO_RIGHTS);
define("MESSAGE_PAGE_ERROR_MOVE_ROOT", 868); define("MESSAGE_PAGE_ERROR_FATHER_IS_DESCENDANT", 869); define("MESSAGE_PAGE_ERROR_FATHER_SIBLINGS_NEVER_VALIDATED", 870); define("MESSAGE_PAGE_TASK_PENDING", 1090); define("MESSAGE_PAGE_NO_VALIDATIONS_PENDING", 1113); define("MESSAGE_PAGE_ERROR_FATHER_IS_IDENTICAL", 1319); //Action management if (isset($_GET["cms_action"]) && $_GET["cms_action"] == "displace") { if ($cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_REGENERATEPAGES)) { $cms_page = CMS_session::getPage(); $father = CMS_tree::getPageByID($_GET["new_father"]); //augment the execution time, because things here can be quite lengthy @set_time_limit(9000); //ignore user abort to avoid interuption of process @ignore_user_abort(true); if ($error = CMS_tree::movePage($cms_page, $father)) { switch ($error) { case "PAGE_NEVER_VALIDATED": $errmsg = $cms_language->getMessage(MESSAGE_PAGE_ERROR_PAGE_NEVER_VALIDATED); break; case "MOVE_ROOT": $errmsg = $cms_language->getMessage(MESSAGE_PAGE_ERROR_MOVE_ROOT); break; case "FATHER_IS_DESCENDANT": $errmsg = $cms_language->getMessage(MESSAGE_PAGE_ERROR_FATHER_IS_DESCENDANT); break; case "FATHER_SIBLINGS_NEVER_VALIDATED": $errmsg = $cms_language->getMessage(MESSAGE_PAGE_ERROR_FATHER_SIBLINGS_NEVER_VALIDATED); break; case "FATHER_IS_IDENTICAL": $errmsg = $cms_language->getMessage(MESSAGE_PAGE_ERROR_FATHER_IS_IDENTICAL);