/** * This function has various possible results: * 1) $lUid unchanged - * there was nothing to do for langvis and the overlay is requested is fine * 2) $lUid == null * is relevant if we did the overlay ourselfs and the processing within getPageOverlay function is not relevant anymore * 3) $lUid changed * is relevant if we just changed the target-languge but require getPageOverlay to proceed with the overlay-chrunching * 4) $lUid changed to 0 (which may be the case for forced fallbacks to default). Please check Core Setting hideIfNotTranslated in this case to be sure the page can be shown in this case * * @param mixed $pageInput * @param integer $lUid Passed ad reference! * @param t3lib_pageSelect $parent * @return void */ public function getPageOverlay_preProcess(&$pageInput, &$lUid, t3lib_pageSelect $parent) { if (!is_array($pageInput) || !isset($pageInput['uid'])) { return; } $page_id = $pageInput['uid']; //call service to know if element is visible and which overlay language to use $overlayLanguage = tx_languagevisibility_feservices::getOverlayLanguageIdForElementRecord($page_id, 'pages', $lUid); if ($overlayLanguage === false) { $overlayLanguageForced = tx_languagevisibility_feservices::getOverlayLanguageIdForElementRecordForced($page_id, 'pages', $lUid); // don't use this recursion without further checks!!!! // this isn't used because there seems to be no reason why we should overlay an invisible page... // $pageInput = $parent->getPageOverlay ( &$pageInput, $overlayLanguageForced ); $pageInput['_NOTVISIBLE'] = TRUE; $lUid = null; } else { $lUid = $overlayLanguage; } }
/** * Returns the relevant page overlay record fields * * @param mixed If $pageInput is an integer, it's the pid of the pageOverlay record and thus the page overlay record is returned. If $pageInput is an array, it's a page-record and based on this page record the language record is found and OVERLAYED before the page record is returned. * @param integer Language UID if you want to set an alternative value to $this->sys_language_uid which is default. Should be >=0 * @return array Page row which is overlayed with language_overlay record (or the overlay record alone) */ function getPageOverlay($pageInput, $lUid = -1) { if ($lUid < 0) { $lUid = $this->sys_language_uid; } if (is_array($pageInput)) { $page_id = $pageInput['uid']; } else { $page_id = $pageInput; } //call service to know if element is visible and which overlay language to use $overlayLanguage = tx_languagevisibility_feservices::getOverlayLanguageIdForElementRecord($page_id, 'pages', $lUid); if ($overlayLanguage === false) { $overlayLanguageForced = tx_languagevisibility_feservices::getOverlayLanguageIdForElementRecordForced($page_id, 'pages', $lUid); // $pageInput['title'].=' [[not visible]]'; $pageInput = $this->_original_getPageOverlay($pageInput, $overlayLanguageForced); $pageInput['_NOTVISIBLE'] = TRUE; return $pageInput; } else { //$pageInput['title'].='-allowed- '.$lUid.'-'.$page_id.'-'.$overlayLanguage; return $this->_original_getPageOverlay($pageInput, $overlayLanguage); } }