コード例 #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)));
 }
コード例 #2
0
 /**
  * Register a param and it's value and hook into configArrayPostProc and
  * createHashBase/cHashParamsHook
  *
  * @param string $param
  * @param mixed  $value
  * @return void
  */
 public static function register($param, $value, $addToLinkVars)
 {
     self::$params[$param] = $value;
     if ($addToLinkVars) {
         self::$linkVarParams[$param] = true;
     }
     if (self::$hooksRegistered) {
         return;
     }
     self::$hooksRegistered = true;
     $conf =& $GLOBALS['TSFE']->TYPO3_CONF_VARS;
     $conf['SC_OPTIONS']['tslib/class.tslib_fe.php']['configArrayPostProc'][__CLASS__] = '&' . __CLASS__ . '->configArrayPostProc';
     // override page hash generation
     $conf['SC_OPTIONS']['tslib/class.tslib_fe.php']['createHashBase'][__CLASS__] = '&' . __CLASS__ . '->createHashBase';
 }