Esempio n. 1
0
 /**
  * Checks condition for varSets
  *
  * @param array $setup Configuration for condition
  * @param string $prevVal Previous value in sequence of GET vars. The value is the "system" value; In other words: The *real* id, not the alias for a value.
  * @return bool TRUE if proceed is ok, otherwise false.
  * @see encodeSpURL_setSequence(), decodeSpURL_getSequence()
  */
 protected function checkCondition($setup, $prevVal)
 {
     $return = true;
     // Check previous value
     if (isset($setup['prevValueInList'])) {
         if (!$this->apiWrapper->inList($setup['prevValueInList'], $prevVal)) {
             $return = false;
         }
     }
     return $return;
 }
 /**
  * Gets the value of current language. Defaults to value
  * taken from the system configuration.
  *
  * @param array $urlParameters
  * @return integer Current language or system default
  */
 protected function getLanguageVar(array $urlParameters)
 {
     // Get the default language from the TSFE
     $lang = intval($GLOBALS['TSFE']->config['config']['sys_language_uid']);
     // Setting the language variable based on GETvar in URL which has been configured to carry the language uid
     if ($this->conf['languageGetVar']) {
         if (isset($urlParameters[$this->conf['languageGetVar']])) {
             $lang = intval($urlParameters[$this->conf['languageGetVar']]);
         } elseif (isset($this->pObj->orig_paramKeyValues[$this->conf['languageGetVar']])) {
             $lang = intval($this->pObj->orig_paramKeyValues[$this->conf['languageGetVar']]);
         }
     }
     // Might be excepted (like you should for CJK cases which does not translate to ASCII equivalents)
     if (isset($this->conf['languageExceptionUids']) && $this->apiWrapper->inList($this->conf['languageExceptionUids'], $lang)) {
         $lang = 0;
     }
     return $lang;
 }