/**
  *
  * @param tslib_fe $ref
  * @return void
  */
 public function settingLanguage_preProcess($params, &$ref)
 {
     // Get values from TypoScript:
     $lUid = intval($ref->config['config']['sys_language_uid']);
     //works only with "ignore" setting
     //need to check access for current page and show error:
     if (!tx_languagevisibility_feservices::checkVisiblityForElement($ref->page['uid'], 'pages', $lUid)) {
         $GLOBALS['TSFE']->pageNotFoundAndExit('Page is not visible in requested language [' . $lUid . '/' . $ref->page['uid'] . ']');
     }
 }
コード例 #2
0
 /**
  * Setting the language key that'll be used by the current page.
  * In this function it should be checked, 1) that this language exists, 2) that a page_overlay_record exists, .. and if not the default language, 0 (zero), should be set.
  *
  * @return	void
  * @access private
  */
 function settingLanguage()
 {
     // Get values from TypoScript:
     $lUid = intval($this->config['config']['sys_language_uid']);
     //works only with "ignore" setting
     //need to check access for current page and show error:
     if (!tx_languagevisibility_feservices::checkVisiblityForElement($this->page['uid'], 'pages', $lUid)) {
         $GLOBALS['TSFE']->pageNotFoundAndExit('Page is not visible in requested language [' . $lUid . '/' . $this->page['uid'] . ']');
     }
     //overlay of current page is handled in ux_t3lib_pageSelect::getPageOverlay
     parent::settingLanguage();
 }
 /**
  * Process the prepared crawler urls and check wether these pages have the chance to get crawled or not
  *
  * @param array $params		the crawler result
  * @param object $ref		the crawler_lib
  * @return void
  */
 public function processUrls(&$params, &$ref)
 {
     foreach ($params['res'] as $cfg => $sub) {
         $list = array();
         foreach ($params['res'][$cfg]['URLs'] as $key => $url) {
             list($id, $lang) = self::extractIdAndLangFromUrl($url);
             if (tx_languagevisibility_feservices::checkVisiblityForElement($id, 'pages', $lang)) {
                 $list[] = $url;
             } else {
                 // $url not visible therefore we drop it
             }
         }
         $params['res'][$cfg]['URLs'] = $list;
     }
 }