/** * Approves the specified version of this Page and all embedded Cblocks * * @param int $version (optional) Page version * @return int|false New version or FALSE in case of an error */ public function approveVersion($version = 0) { $result = parent::approveVersion($version); // Check if there are blind entrymasks in this page (and add a version) $colist = $this->getCblockList(); foreach ($colist as $colist_item) { if ($colist_item['EMBEDDED'] == 1) { $tmpCb = sCblockMgr()->getCblock($colist_item['OBJECTID'], $colist_item['VERSION']); $tmpCb->approveVersion(); } } if ((int) $version == 0) { $version = (int) $this->getVersion(); } $this->history->add(HISTORYTYPE_PAGE, NULL, $version, 'TXT_PAGE_H_APPROVE'); $pageMgr = new PageMgr($this->getSite()); if ($this->getPublishedVersion() == ALWAYS_LATEST_APPROVED_VERSION) { $this->history->add(HISTORYTYPE_PAGE, NULL, $version, 'TXT_PAGE_H_AUTOPUBLISH'); $pageMgr->callExtensionHook("onPublish", $this->getSite(), $this->_id, $version); if (Singleton::cache_config()->getVar("CONFIG/INVALIDATEON/PAGE_PUBLISH") == "true") { Singleton::FC()->emptyBucket(); } } $pageMgr->callExtensionHook('onApprove', $this->getSite(), (int) $this->_id, (int) $version); return $result; }
unset($version); } $this->displaymode = "live"; } $page = $pageMgr->getPage($pageID, $version); // check if no permissions if (!$page) { sUserMgr()->impersonate(sUserMgr()->getAdministratorID()); $tmpPageMgr = new PageMgr($siteID); $tmpPage = $tmpPageMgr->getPublishedPage($pageID); if (!$tmpPage) { throwErrorPage('404'); } $tmpPageinfo = $tmpPage->get(); // Call callback $pageMgr->callExtensionHook("onAccessDenied", $siteID, $pageID, $tmpPageinfo['VERSION'], array("FILTER" => $filter, "CONTENTAREAS" => &$inhalte)); sUserMgr()->unimpersonate(); // Throw status 403 throwErrorPage('403'); } if ((int) $siteInfo['FAVICON'] > 0) { $sinfo['FAVICON_URL'] = $webroot_path_string . '/image/' . $sinfo['FAVICON']; } else { $sinfo['FAVICON_URL'] = ''; } // check version if (strlen($version) > 0) { $filter = ""; $tmpUser = new User(sUserMgr()->getCurrentUserID()); $tmpUserInfo = $tmpUser->get(); $backendAllowed = $tmpUser->checkPermission('RBACKEND');