/** * Creates $this->sysPage if it does not exist yet * * @return void */ protected function createSysPageIfNecessary() { if (!is_object($this->sysPage)) { $this->sysPage = t3lib_div::makeInstance('t3lib_pageSelect'); $this->sysPage->init($GLOBALS['TSFE']->showHiddenPage || $this->pObj->isBEUserLoggedIn()); } }
/** * Creates $this->sysPage if it does not exist yet * * @return void */ protected function createSysPageIfNecessary() { if (!is_object($this->sysPage)) { $this->sysPage = $this->apiWrapper->getPageRepository(); $this->sysPage->init($GLOBALS['TSFE']->showHiddenPage || $this->pObj->isBEUserLoggedIn()); } }
/** * Creates an isntance of this class. * * @return void */ public function __construct() { $urlParameters = tx_realurl::array_merge_recursive_overrule($_GET, $_POST); $this->currentPage = max(1, intval($urlParameters['page'])); unset($urlParameters['page']); unset($urlParameters['cmd']); $this->baseURL = t3lib_div::getIndpEnv('TYPO3_REQUEST_SCRIPT') . '?' . t3lib_div::implodeArrayForUrl('', $urlParameters); $this->resultsPerPage = self::RESULTS_PER_PAGE_DEFAULT; }
/** * Search recursively for the URL in the page tree and return the ID of the path ("manual" id resolve) * * @param array Path parts, passed by reference. * @return array Info array, currently with "id" set to the ID. */ function findIDByURL(&$urlParts) { // Initialize: $info = array(); $info['id'] = 0; $GET_VARS = ''; // Find the PID where to begin the resolve: if ($this->conf['rootpage_id']) { // Take PID from rootpage_id if any: $pid = intval($this->conf['rootpage_id']); } else { $pid = $this->pObj->findRootPageId(); } // Now, recursively search for the path from this root (if there are any elements in $urlParts) if ($pid && count($urlParts)) { list($info['id'], $mpvar) = $this->searchTitle($pid, '', $urlParts); if ($mpvar) { $GET_VARS = array('MP' => $mpvar); } } return array($info, $GET_VARS); }
/** * Obtains amount of results per page for the given view. * * @param string $view * @return int */ protected function getResultsPerPage($view) { $tsConfig = t3lib_BEfunc::getModTSconfig($this->pObj->id, 'tx_realurl.' . $view . '.pagebrowser.resultsPerPage'); $resultsPerPage = $tsConfig['value']; return tx_realurl::testInt($resultsPerPage) ? intval($resultsPerPage) : tx_realurl_pagebrowser::RESULTS_PER_PAGE_DEFAULT; }
/** * Decode everything starting with 'yag' and pass the rest back to realurl * * @param array $params * @param tx_realurl $ref */ public function decodeSpURL_preProc(&$params, &$ref) { $urlTodo = $params['URL']; $cHash = $ref->decodeSpURL_cHashCache($urlTodo); list($path, $additionalParams) = explode('?', $urlTodo); // Strip ending .html if exist $pathParts = explode('/', preg_replace('/\\.html$/i', '', $path)); $startKey = array_search('yag', $pathParts); if ($startKey !== false) { $myPathParts = array_slice($pathParts, ++$startKey); $realUrlPathParts = array_slice($pathParts, 0, --$startKey); } else { return; //nothing to do } /* * The first 3 pathParts are standard: * 0: contextIdentifier * 1: controller * 2: action */ $this->initVarSetConfig($myPathParts[0]); $varSetCfg = $this->getVarSetConfigForControllerAction($myPathParts[1], $myPathParts[2]); $decodedUrl = $ref->decodeSpURL_getSequence($myPathParts, $varSetCfg); $GET_string = $this->combineDecodedURL($decodedUrl, $cHash, $additionalParams); if ($GET_string) { $GET_VARS = false; parse_str($GET_string, $GET_VARS); $ref->decodeSpURL_fixBrackets($GET_VARS); $ref->pObj->mergingWithGetVars($GET_VARS); } $params['URL'] = implode('/', $realUrlPathParts) . '/'; }
/** * Processes page and content changes in regard to RealURL caches. * * @param string $status * @param string $tableName * @param int $recordId * @param array $databaseData * @return void * @todo Handle changes to tx_realurl_exclude recursively */ protected function processContentUpdates($status, $tableName, $recordId, array $databaseData) { if ($status == 'update' && tx_realurl::testInt($recordId)) { list($pageId, $languageId) = $this->getPageData($tableName, $recordId); $this->fetchRealURLConfiguration($pageId); if ($this->shouldFixCaches($tableName, $databaseData)) { if (isset($databaseData['alias'])) { $this->expirePathCacheForAllLanguages($pageId); } else { $this->expirePathCache($pageId, $languageId); } $this->clearOtherCaches($pageId); } } }
/** * Processes page and content changes in regard to RealURL caches. * * @param string $status * @param string $tableName * @param int $recordId * @param array $databaseData * @param t3lib_TCEmain $pObj * @return void * @todo Handle changes to tx_realurl_exclude recursively */ protected function processContentUpdates($status, $tableName, $recordId, array $databaseData, t3lib_TCEmain $pObj) { if ($tableName !== 'pages' || $status == 'update') { if (!tx_realurl::testInt($recordId)) { $recordId = intval($pObj->substNEWwithIDs[$recordId]); } list($pageId, $languageId) = $this->getPageData($tableName, $recordId); $this->fetchRealURLConfiguration($pageId); if ($this->shouldFixCaches($tableName, $databaseData)) { if (isset($databaseData['alias'])) { $this->expirePathCacheForAllLanguages($pageId); } else { $this->expirePathCache($pageId, $languageId); } $this->clearOtherCaches($pageId); } $this->clearOtherCaches($pageId); } }