コード例 #1
0
ファイル: GetParam.php プロジェクト: schams-net/t3x-contexts
 /**
  * Check if the context is active now.
  *
  * @param array $arDependencies Array of dependent context objects
  *
  * @return boolean True if the context is active, false if not
  */
 public function match(array $arDependencies = array())
 {
     $param = trim($this->getConfValue('field_name'));
     if ($param === '') {
         throw new Exception('Parameter name missing from GET Parameter' . ' context configuration');
     }
     $value = t3lib_div::_GET($param);
     if ($value === null) {
         //load from session if no param given
         list($bUseMatch, $bMatch) = $this->getMatchFromSession();
         if ($bUseMatch) {
             return $this->invert($bMatch);
         }
     }
     // Register param on TSFE service for cache and linkVars management
     Tx_Contexts_Context_Type_GetParam_TsfeService::register($param, $value, !(bool) $this->use_session);
     return $this->invert($this->storeInSession($this->matchParameters($value)));
 }