Esempio n. 1
0
 /**
  * Decode everything starting with 'yag' and pass the rest back to realurl 
  * 
  * @param array $params
  * @param tx_realurl $ref
  */
 public function decodeSpURL_preProc(&$params, &$ref)
 {
     $urlTodo = $params['URL'];
     $cHash = $ref->decodeSpURL_cHashCache($urlTodo);
     list($path, $additionalParams) = explode('?', $urlTodo);
     // Strip ending .html if exist
     $pathParts = explode('/', preg_replace('/\\.html$/i', '', $path));
     $startKey = array_search('yag', $pathParts);
     if ($startKey !== false) {
         $myPathParts = array_slice($pathParts, ++$startKey);
         $realUrlPathParts = array_slice($pathParts, 0, --$startKey);
     } else {
         return;
         //nothing to do
     }
     /*
      * The first 3 pathParts are standard:
      * 0: contextIdentifier
      * 1: controller
      * 2: action 
      */
     $this->initVarSetConfig($myPathParts[0]);
     $varSetCfg = $this->getVarSetConfigForControllerAction($myPathParts[1], $myPathParts[2]);
     $decodedUrl = $ref->decodeSpURL_getSequence($myPathParts, $varSetCfg);
     $GET_string = $this->combineDecodedURL($decodedUrl, $cHash, $additionalParams);
     if ($GET_string) {
         $GET_VARS = false;
         parse_str($GET_string, $GET_VARS);
         $ref->decodeSpURL_fixBrackets($GET_VARS);
         $ref->pObj->mergingWithGetVars($GET_VARS);
     }
     $params['URL'] = implode('/', $realUrlPathParts) . '/';
 }