Changeset 693

Show
Ignore:
Timestamp:
12/13/07 22:25:14 (1 year ago)
Author:
laurentj
Message:

worked on ticket #317: now when enableOldActionSelector is true, you can use also new action selector, only if you use full action selector : controler and method should be indicate. And selectors in urls.xml should be new action selector

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix/controllers/jControllerDaoCrud.class.php

    r691 r693  
    120120    protected function _getAction($method){ 
    121121        global $gJCoord; 
    122 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    123         if($GLOBALS['gJConfig']->enableOldActionSelector == false) 
    124             return $gJCoord->action->module.'~'.$gJCoord->action->controller.':'.$method; 
    125         else 
    126             return $gJCoord->action->module.'~'.$gJCoord->action->controller.'_'.$method; 
    127 #else 
    128122        return $gJCoord->action->module.'~'.$gJCoord->action->controller.':'.$method; 
    129 #endif 
    130123    } 
    131124 
  • trunk/lib/jelix/controllers/jControllerDaoCrud.class.php

    r691 r693  
    120120    protected function _getAction($method){ 
    121121        global $gJCoord; 
    122 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    123         if($GLOBALS['gJConfig']->enableOldActionSelector == false) 
    124             return $gJCoord->action->module.'~'.$gJCoord->action->controller.':'.$method; 
    125         else 
    126             return $gJCoord->action->module.'~'.$gJCoord->action->controller.'_'.$method; 
    127 #else 
    128122        return $gJCoord->action->module.'~'.$gJCoord->action->controller.':'.$method; 
    129 #endif 
    130123    } 
    131124 
  • trunk/lib/jelix/core/jConfigCompiler.class.php

    r691 r693  
    4343        $config->isWindows = (DIRECTORY_SEPARATOR == '\\'); 
    4444        if(trim( $config->startAction) == '') { 
    45 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    46             if($GLOBALS['gJConfig']->enableOldActionSelector == false) 
    47                 $config->startAction = ':'; 
    48             else 
    49                 $config->startAction = '_'; 
    50 #else 
    5145            $config->startAction = ':'; 
    52 #endif 
    53        } 
     46        } 
    5447 
    5548        $config->_allBasePath = array(); 
     
    10194        $config['isWindows'] =  (DIRECTORY_SEPARATOR == '\\'); 
    10295        if(trim( $config['startAction']) == '') { 
    103 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    104             if($GLOBALS['gJConfig']->enableOldActionSelector == false) 
    105                 $config['startAction'] = ':'; 
    106             else 
    107                 $config['startAction'] = '_'; 
    108 #else 
    10996            $config['startAction'] = ':'; 
    110 #endif 
    11197        } 
    11298         
  • trunk/lib/jelix/core/jConfigCompiler.class.php

    r691 r693  
    4343        $config->isWindows = (DIRECTORY_SEPARATOR == '\\'); 
    4444        if(trim( $config->startAction) == '') { 
    45 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    46             if($GLOBALS['gJConfig']->enableOldActionSelector == false) 
    47                 $config->startAction = ':'; 
    48             else 
    49                 $config->startAction = '_'; 
    50 #else 
    5145            $config->startAction = ':'; 
    52 #endif 
    53        } 
     46        } 
    5447 
    5548        $config->_allBasePath = array(); 
     
    10194        $config['isWindows'] =  (DIRECTORY_SEPARATOR == '\\'); 
    10295        if(trim( $config['startAction']) == '') { 
    103 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    104             if($GLOBALS['gJConfig']->enableOldActionSelector == false) 
    105                 $config['startAction'] = ':'; 
    106             else 
    107                 $config['startAction'] = '_'; 
    108 #else 
    10996            $config['startAction'] = ':'; 
    110 #endif 
    11197        } 
    11298         
  • trunk/lib/jelix/core/jCoordinator.class.php

    r691 r693  
    181181                $this->actionName = $gJConfig->startAction; 
    182182            else { 
    183 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    184                 if($GLOBALS['gJConfig']->enableOldActionSelector == false) 
    185                     $this->actionName = 'default:index'; 
    186                 else 
    187                     $this->actionName = 'default_index'; 
    188 #else 
    189183                $this->actionName = 'default:index'; 
    190 #endif 
    191184            } 
    192185        } 
  • trunk/lib/jelix/core/jCoordinator.class.php

    r691 r693  
    181181                $this->actionName = $gJConfig->startAction; 
    182182            else { 
    183 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    184                 if($GLOBALS['gJConfig']->enableOldActionSelector == false) 
    185                     $this->actionName = 'default:index'; 
    186                 else 
    187                     $this->actionName = 'default_index'; 
    188 #else 
    189183                $this->actionName = 'default:index'; 
    190 #endif 
    191184            } 
    192185        } 
  • trunk/lib/jelix/core/jSelector.class.php

    r691 r693  
    195195        $this->module = $module; 
    196196#ifdef ENABLE_OLD_ACTION_SELECTOR 
    197         if($GLOBALS['gJConfig']->enableOldActionSelector == false
     197        if($GLOBALS['gJConfig']->enableOldActionSelector == false || strpos($action,':') !== false
    198198            $separator = ':'; 
    199199        else 
     
    210210            $this->method = $r[1]==''?'index':$r[1]; 
    211211        } 
    212 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    213         $this->resource = $this->controller.$separator.$this->method; 
    214 #else 
    215212        $this->resource = $this->controller.':'.$this->method; 
    216 #endif 
    217213        $this->request = $request; 
    218214        $this->_createPath(); 
     
    273269#if ENABLE_PHP_JELIX 
    274270#ifdef ENABLE_OLD_ACTION_SELECTOR 
    275         if($GLOBALS['gJConfig']->enableOldActionSelector == false) { 
     271        if($GLOBALS['gJConfig']->enableOldActionSelector == false || strpos($sel,':') !== false) { 
    276272            $res = jelix_scan_action_sel($sel, $this, $gJCoord->actionName) 
    277273        } 
     
    308304                $this->resource = $m[2]; 
    309305#ifdef ENABLE_OLD_ACTION_SELECTOR 
    310             if($GLOBALS['gJConfig']->enableOldActionSelector == false
    311                 $separator = ':'
     306            if($GLOBALS['gJConfig']->enableOldActionSelector == false || strpos($this->resource,':') !== false
     307                $r = explode(':',$this->resource)
    312308            else 
    313                 $separator = '_'; 
    314  
    315             $r = explode($separator,$this->resource); 
     309                $r = explode('_',$this->resource); 
    316310#else 
    317311            $r = explode(':',$this->resource); 
     
    324318                $this->method = $r[1]==''?'index':$r[1]; 
    325319            } 
    326 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    327             $this->resource = $this->controller.$separator.$this->method; 
    328 #else 
    329320            $this->resource = $this->controller.':'.$this->method; 
    330 #endif 
     321             
    331322            if($m[3] != '' && $enableRequestPart) 
    332323                $this->request = $m[3]; 
  • trunk/lib/jelix/core/jSelector.class.php

    r691 r693  
    195195        $this->module = $module; 
    196196#ifdef ENABLE_OLD_ACTION_SELECTOR 
    197         if($GLOBALS['gJConfig']->enableOldActionSelector == false
     197        if($GLOBALS['gJConfig']->enableOldActionSelector == false || strpos($action,':') !== false
    198198            $separator = ':'; 
    199199        else 
     
    210210            $this->method = $r[1]==''?'index':$r[1]; 
    211211        } 
    212 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    213         $this->resource = $this->controller.$separator.$this->method; 
    214 #else 
    215212        $this->resource = $this->controller.':'.$this->method; 
    216 #endif 
    217213        $this->request = $request; 
    218214        $this->_createPath(); 
     
    273269#if ENABLE_PHP_JELIX 
    274270#ifdef ENABLE_OLD_ACTION_SELECTOR 
    275         if($GLOBALS['gJConfig']->enableOldActionSelector == false) { 
     271        if($GLOBALS['gJConfig']->enableOldActionSelector == false || strpos($sel,':') !== false) { 
    276272            $res = jelix_scan_action_sel($sel, $this, $gJCoord->actionName) 
    277273        } 
     
    308304                $this->resource = $m[2]; 
    309305#ifdef ENABLE_OLD_ACTION_SELECTOR 
    310             if($GLOBALS['gJConfig']->enableOldActionSelector == false
    311                 $separator = ':'
     306            if($GLOBALS['gJConfig']->enableOldActionSelector == false || strpos($this->resource,':') !== false
     307                $r = explode(':',$this->resource)
    312308            else 
    313                 $separator = '_'; 
    314  
    315             $r = explode($separator,$this->resource); 
     309                $r = explode('_',$this->resource); 
    316310#else 
    317311            $r = explode(':',$this->resource); 
     
    324318                $this->method = $r[1]==''?'index':$r[1]; 
    325319            } 
    326 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    327             $this->resource = $this->controller.$separator.$this->method; 
    328 #else 
    329320            $this->resource = $this->controller.':'.$this->method; 
    330 #endif 
     321             
    331322            if($m[3] != '' && $enableRequestPart) 
    332323                $this->request = $m[3]; 
  • trunk/lib/jelix/core/request/jCmdLineRequest.class.php

    r691 r693  
    4141            $argsel = array_shift($argv); // get the module~action selector 
    4242            if ($argsel == 'help') { 
    43 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    44                 if($GLOBALS['gJConfig']->enableOldActionSelector == false) 
    45                     $argsel = 'jelix~help:index'; 
    46                 else 
    47                     $argsel = 'jelix~help_index'; 
    48 #else 
    4943                $argsel = 'jelix~help:index'; 
    50 #endif 
    5144            } 
    5245            if (!preg_match('/(?:([\w\.]+)~)/', $argsel)) { 
  • trunk/lib/jelix/core/request/jCmdLineRequest.class.php

    r691 r693  
    4141            $argsel = array_shift($argv); // get the module~action selector 
    4242            if ($argsel == 'help') { 
    43 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    44                 if($GLOBALS['gJConfig']->enableOldActionSelector == false) 
    45                     $argsel = 'jelix~help:index'; 
    46                 else 
    47                     $argsel = 'jelix~help_index'; 
    48 #else 
    4943                $argsel = 'jelix~help:index'; 
    50 #endif 
    5144            } 
    5245            if (!preg_match('/(?:([\w\.]+)~)/', $argsel)) { 
  • trunk/lib/jelix/plugins/urls/significant/jSignificantUrlsCompiler.class.php

    r691 r693  
    134134 
    135135               $action = (string)$url['action']; 
    136 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    137                if($GLOBALS['gJConfig']->enableOldActionSelector == false) 
    138                    $separator = ':'; 
    139                else 
    140                    $separator = '_'; 
    141                 
    142                if (strpos($action, $separator) === false) { 
    143                   $action = 'default'.$separator.$action; 
    144                } 
    145  
    146                if(isset($url['actionoverride'])){ 
    147                   $actionOverride = preg_split("/[\s,]+/", (string)$url['actionoverride']); 
    148                   foreach ($actionOverride as &$each) { 
    149                      if (strpos($each, $separator) === false) { 
    150                         $each = 'default'.$separator.$each; 
    151 #else 
     136 
    152137               if (strpos($action, ':') === false) { 
    153138                  $action = 'default:'.$action; 
     
    159144                     if (strpos($each, ':') === false) { 
    160145                        $each = 'default:'.$each; 
    161 #endif 
    162146                     } 
    163147                  } 
  • trunk/lib/jelix/plugins/urls/significant/jSignificantUrlsCompiler.class.php

    r691 r693  
    134134 
    135135               $action = (string)$url['action']; 
    136 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    137                if($GLOBALS['gJConfig']->enableOldActionSelector == false) 
    138                    $separator = ':'; 
    139                else 
    140                    $separator = '_'; 
    141                 
    142                if (strpos($action, $separator) === false) { 
    143                   $action = 'default'.$separator.$action; 
    144                } 
    145  
    146                if(isset($url['actionoverride'])){ 
    147                   $actionOverride = preg_split("/[\s,]+/", (string)$url['actionoverride']); 
    148                   foreach ($actionOverride as &$each) { 
    149                      if (strpos($each, $separator) === false) { 
    150                         $each = 'default'.$separator.$each; 
    151 #else 
     136 
    152137               if (strpos($action, ':') === false) { 
    153138                  $action = 'default:'.$action; 
     
    159144                     if (strpos($each, ':') === false) { 
    160145                        $each = 'default:'.$each; 
    161 #endif 
    162146                     } 
    163147                  } 
  • trunk/lib/jelix/plugins/urls/significant/significant.urls.php

    r691 r693  
    170170                // et qu'elle fait partie des actions secondaires, alors on la laisse 
    171171                // sinon on prend celle indiquée dans la conf 
    172                 if( $infoparsing[3] 
    173                     && isset($params['action']) 
    174                     && in_array($params['action'], $infoparsing[3])){ 
    175  
    176                     $url->params['action']=$params['action']; // action peut avoir été écrasé par une itération précédente 
     172                if ($infoparsing[3] && isset($params['action'])) { 
     173#ifdef ENABLE_OLD_ACTION_SELECTOR 
     174                    if(strpos($params['action'], ':') === false) { 
     175                        if(!$gJConfig->enableOldActionSelector || strpos($params['action'], '_') === false) { 
     176                            $params['action'] = 'default:'.$params['action']; 
     177                        } else if($gJConfig->enableOldActionSelector && strpos($params['action'], '_') !== false) { 
     178                            $params['action'] = str_replace("_",":",$params['action']); 
     179                        } 
     180                    } 
     181#else 
     182                    if(strpos($params['action'], ':') === false) { 
     183                        $params['action'] = 'default:'.$params['action']; 
     184                    } 
     185#endif 
     186                    if(in_array($params['action'], $infoparsing[3])) 
     187                        $url->params['action']=$params['action']; // action peut avoir été écrasé par une itération précédente 
     188                    else 
     189                        $url->params['action']=$infoparsing[1]; 
    177190                }else{ 
    178191                    $url->params['action']=$infoparsing[1]; 
     
    197210                    // et qu'elle fait partie des actions secondaires, alors on la laisse 
    198211                    // sinon on prend celle indiquée dans la conf 
    199                     if( !($infoparsing[6] 
    200                         && isset($params['action']) 
    201                         && in_array($params['action'], $infoparsing[6]))){ 
    202  
     212 
     213                    if($infoparsing[6] && isset($params['action']) ) { 
     214#ifdef ENABLE_OLD_ACTION_SELECTOR 
     215                        if(strpos($params['action'], ':') === false) { 
     216                            if(!$gJConfig->enableOldActionSelector || strpos($params['action'], '_') === false) { 
     217                                $params['action'] = 'default:'.$params['action']; 
     218                            } else if($gJConfig->enableOldActionSelector && strpos($params['action'], '_') !== false) { 
     219                                $params['action'] = str_replace("_",":",$params['action']); 
     220                            } 
     221                        } 
     222#else 
     223                        if(strpos($params['action'], ':') === false) { 
     224                            $params['action'] = 'default:'.$params['action']; 
     225                        } 
     226#endif 
     227                        if(!in_array($params['action'], $infoparsing[6]) && $infoparsing[1] !='') { 
     228                            $params['action']=$infoparsing[1]; 
     229                        } 
     230 
     231                    } else { 
    203232                        if($infoparsing[1] !='') 
    204233                            $params['action']=$infoparsing[1]; 
     
    231260                $urlact = jUrl::get($gJConfig->urlengine['notfoundAct'],array(),jUrl::JURLACTION); 
    232261            }catch(Exception $e){ 
    233 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    234                 if($gJConfig->enableOldActionSelector) 
    235                     $urlact = new jUrlAction(array('module'=>'jelix', 'action'=>'error_notfound')); 
    236                 else 
    237                     $urlact = new jUrlAction(array('module'=>'jelix', 'action'=>'error:notfound')); 
    238 #else 
    239262                $urlact = new jUrlAction(array('module'=>'jelix', 'action'=>'error:notfound')); 
    240 #endif 
    241263            } 
    242264        }else if(!$urlact && $isDefault){ 
  • trunk/lib/jelix/plugins/urls/significant/significant.urls.php

    r691 r693  
    170170                // et qu'elle fait partie des actions secondaires, alors on la laisse 
    171171                // sinon on prend celle indiquée dans la conf 
    172                 if( $infoparsing[3] 
    173                     && isset($params['action']) 
    174                     && in_array($params['action'], $infoparsing[3])){ 
    175  
    176                     $url->params['action']=$params['action']; // action peut avoir été écrasé par une itération précédente 
     172                if ($infoparsing[3] && isset($params['action'])) { 
     173#ifdef ENABLE_OLD_ACTION_SELECTOR 
     174                    if(strpos($params['action'], ':') === false) { 
     175                        if(!$gJConfig->enableOldActionSelector || strpos($params['action'], '_') === false) { 
     176                            $params['action'] = 'default:'.$params['action']; 
     177                        } else if($gJConfig->enableOldActionSelector && strpos($params['action'], '_') !== false) { 
     178                            $params['action'] = str_replace("_",":",$params['action']); 
     179                        } 
     180                    } 
     181#else 
     182                    if(strpos($params['action'], ':') === false) { 
     183                        $params['action'] = 'default:'.$params['action']; 
     184                    } 
     185#endif 
     186                    if(in_array($params['action'], $infoparsing[3])) 
     187                        $url->params['action']=$params['action']; // action peut avoir été écrasé par une itération précédente 
     188                    else 
     189                        $url->params['action']=$infoparsing[1]; 
    177190                }else{ 
    178191                    $url->params['action']=$infoparsing[1]; 
     
    197210                    // et qu'elle fait partie des actions secondaires, alors on la laisse 
    198211                    // sinon on prend celle indiquée dans la conf 
    199                     if( !($infoparsing[6] 
    200                         && isset($params['action']) 
    201                         && in_array($params['action'], $infoparsing[6]))){ 
    202  
     212 
     213                    if($infoparsing[6] && isset($params['action']) ) { 
     214#ifdef ENABLE_OLD_ACTION_SELECTOR 
     215                        if(strpos($params['action'], ':') === false) { 
     216                            if(!$gJConfig->enableOldActionSelector || strpos($params['action'], '_') === false) { 
     217                                $params['action'] = 'default:'.$params['action']; 
     218                            } else if($gJConfig->enableOldActionSelector && strpos($params['action'], '_') !== false) { 
     219                                $params['action'] = str_replace("_",":",$params['action']); 
     220                            } 
     221                        } 
     222#else 
     223                        if(strpos($params['action'], ':') === false) { 
     224                            $params['action'] = 'default:'.$params['action']; 
     225                        } 
     226#endif 
     227                        if(!in_array($params['action'], $infoparsing[6]) && $infoparsing[1] !='') { 
     228                            $params['action']=$infoparsing[1]; 
     229                        } 
     230 
     231                    } else { 
    203232                        if($infoparsing[1] !='') 
    204233                            $params['action']=$infoparsing[1]; 
     
    231260                $urlact = jUrl::get($gJConfig->urlengine['notfoundAct'],array(),jUrl::JURLACTION); 
    232261            }catch(Exception $e){ 
    233 #ifdef ENABLE_OLD_ACTION_SELECTOR 
    234                 if($gJConfig->enableOldActionSelector) 
    235                     $urlact = new jUrlAction(array('module'=>'jelix', 'action'=>'error_notfound')); 
    236                 else 
    237                     $urlact = new jUrlAction(array('module'=>'jelix', 'action'=>'error:notfound')); 
    238 #else 
    239262                $urlact = new jUrlAction(array('module'=>'jelix', 'action'=>'error:notfound')); 
    240 #endif 
    241263            } 
    242264        }else if(!$urlact && $isDefault){ 
  • trunk/testapp/modules/jelix_tests/tests/core.old_urls_generation.html.php

    r691 r693  
    3030      $this->oldActionSelector = $gJConfig->enableOldActionSelector; 
    3131      $gJConfig->enableOldActionSelector = true; 
    32       $gJConfig->simple_urlengine_entrypoints['testnews'] = "jelix_tests~urlsig_url2@classic jelix_tests~urlsig_url3@classic"; 
    33       $gJConfig->simple_urlengine_entrypoints['foo/bar'] = "jelix_tests~urlsig_url4@classic"; 
     32      $gJConfig->simple_urlengine_entrypoints['testnews'] = "jelix_tests~urlsig:url2@classic jelix_tests~urlsig:url3@classic"; 
     33      $gJConfig->simple_urlengine_entrypoints['foo/bar'] = "jelix_tests~urlsig:url4@classic"; 
    3434    } 
    3535 
     
    107107         'entrypointExtension'=>'.php', 
    108108         'notfoundAct'=>'jelix~notfound', 
    109          'simple_urlengine_https'=>'jelix_tests~urlsig_url8@classic @xmlrpc', 
     109         'simple_urlengine_https'=>'jelix_tests~urlsig:url8@classic @xmlrpc', 
    110110         'significantFile'=>'urls_old.xml', 
    111111       ); 
     
    130130 
    131131      $trueResult=array( 
    132           "/index.php?mois=10&annee=2005&id=35&module=jelix_tests&action=urlsig_url1", 
    133           "/testnews.php?mois=05&annee=2004&module=jelix_tests&action=urlsig_url2", 
    134           "/testnews.php?rubrique=actualite&id_art=65&article=c%27est+la+f%C3%AAte+au+village&module=jelix_tests&action=urlsig_url3", 
    135           "/foo/bar.php?first=premier&second=deuxieme&module=jelix_tests&action=urlsig_url4", 
    136           "/index.php?foo=oof&bar=rab&module=jelix_tests&action=urlsig_url5", 
     132          "/index.php?mois=10&annee=2005&id=35&module=jelix_tests&action=urlsig:url1", 
     133          "/testnews.php?mois=05&annee=2004&module=jelix_tests&action=urlsig:url2", 
     134          "/testnews.php?rubrique=actualite&id_art=65&article=c%27est+la+f%C3%AAte+au+village&module=jelix_tests&action=urlsig:url3", 
     135          "/foo/bar.php?first=premier&second=deuxieme&module=jelix_tests&action=urlsig:url4", 
     136          "/index.php?foo=oof&bar=rab&module=jelix_tests&action=urlsig:url5", 
    137137          "/xmlrpc.php", 
    138           "/index.php?rubrique=vetements&id_article=98&module=jelix_tests&action=urlsig_url8", 
     138          "/index.php?rubrique=vetements&id_article=98&module=jelix_tests&action=urlsig:url8", 
    139139       ); 
    140140 
     
    147147      jUrl::getEngine(true); // on recharge le nouveau moteur d'url 
    148148      $trueResult=array( 
    149           "/index?mois=10&annee=2005&id=35&module=jelix_tests&action=urlsig_url1", 
    150           "/testnews?mois=05&annee=2004&module=jelix_tests&action=urlsig_url2", 
    151           "/testnews?rubrique=actualite&id_art=65&article=c%27est+la+f%C3%AAte+au+village&module=jelix_tests&action=urlsig_url3", 
    152           "/foo/bar?first=premier&second=deuxieme&module=jelix_tests&action=urlsig_url4", 
    153           "/index?foo=oof&bar=rab&module=jelix_tests&action=urlsig_url5", 
     149          "/index?mois=10&annee=2005&id=35&module=jelix_tests&action=urlsig:url1", 
     150          "/testnews?mois=05&annee=2004&module=jelix_tests&action=urlsig:url2", 
     151          "/testnews?rubrique=actualite&id_art=65&article=c%27est+la+f%C3%AAte+au+village&module=jelix_tests&action=urlsig:url3", 
     152          "/foo/bar?first=premier&second=deuxieme&module=jelix_tests&action=urlsig:url4", 
     153          "/index?foo=oof&bar=rab&module=jelix_tests&action=urlsig:url5", 
    154154          "/xmlrpc", 
    155           "/index?rubrique=vetements&id_article=98&module=jelix_tests&action=urlsig_url8", 
     155          "/index?rubrique=vetements&id_article=98&module=jelix_tests&action=urlsig:url8", 
    156156       ); 
    157157      $trueResult[5]='https://'.$_SERVER['HTTP_HOST'].$trueResult[5]; 
     
    176176         'defaultEntrypoint'=>'index', 
    177177         'entrypointExtension'=>'.php', 
    178          'notfoundAct'=>'jelix~notfound', 
    179          'simple_urlengine_https'=>'jelix_tests~urlsig_url8@classic @xmlrpc', 
     178         'notfoundAct'=>'jelix~error:notfound', 
     179         'simple_urlengine_https'=>'jelix_tests~urlsig:url8@classic @xmlrpc', 
    180180         'significantFile'=>'urls_old.xml', 
    181181       ); 
     
    218218         'defaultEntrypoint'=>'index', 
    219219         'entrypointExtension'=>'.php', 
    220          'notfoundAct'=>'jelix~notfound', 
     220         'notfoundAct'=>'jelix~error:notfound', 
    221221         'significantFile'=>'urls_old.xml', 
    222222       ); 
     
    229229      $urlList=array(); 
    230230      $urlList[]= array('urlsig_url1', array('mois'=>'10',  'annee'=>'2005', 'id'=>'01')); 
     231      $urlList[]= array('urlsig:url1', array('mois'=>'10',  'annee'=>'2005', 'id'=>'01')); 
    231232      $urlList[]= array('urlsig_url9', array('mois'=>'10',  'annee'=>'2005', 'id'=>'09')); 
     233      $urlList[]= array('urlsig:url9', array('mois'=>'10',  'annee'=>'2005', 'id'=>'09')); 
    232234      $urlList[]= array('urlsig_url10', array('mois'=>'10',  'annee'=>'2005', 'id'=>'10')); 
    233235      $urlList[]= array('urlsig_url2', array('mois'=>'05',  'annee'=>'2004')); 
     
    253255      $trueResult=array( 
    254256          "/index.php/test/news/2005/10/01", 
    255           "/index.php/test/news/2005/10/09?action=urlsig_url9", 
    256           "/index.php/test/news/2005/10/10?action=urlsig_url10", 
     257          "/index.php/test/news/2005/10/01", 
     258          "/index.php/test/news/2005/10/09?action=urlsig:url9", 
     259          "/index.php/test/news/2005/10/09?action=urlsig:url9", 
     260          "/index.php/test/news/2005/10/10?action=urlsig:url10", 
    257261          "/testnews.php/2004/05", 
    258262          "/index.php/test/cms/actualite/65-c-est-la-fete-au-village", 
    259263          "/test/cms2/actualite/65", 
    260264          "/foo/bar.php/withhandler/premier/deuxieme", 
    261           "/index.php?foo=oof&bar=rab&module=jelix_tests&action=urlsig_url5", 
     265          "/index.php?foo=oof&bar=rab&module=jelix_tests&action=urlsig:url5", 
    262266          "/xmlrpc.php", 
    263           "/news.php?aaa=bbb&action=default_bar", 
    264           "/index.php/test/news/2007/23/74?action=urlsig_url8", 
     267          "/news.php?aaa=bbb&action=default:bar", 
     268          "/index.php/test/news/2007/23/74?action=urlsig:url8", 
    265269          "/index.php/shop/vetements/98", 
    266270          "/index.php/shop/bricolage/53/", 
     
    275279       ); 
    276280 
    277       $trueResult[11]='https://'.$_SERVER['HTTP_HOST'].$trueResult[11]; 
     281      $trueResult[13]='https://'.$_SERVER['HTTP_HOST'].$trueResult[13]; 
    278282      $this->_doCompareUrl("significant, multiview = false", $urlList,$trueResult); 
    279283 
     
    282286      $trueResult=array( 
    283287          "/index/test/news/2005/10/01", 
    284           "/index/test/news/2005/10/09?action=urlsig_url9", 
    285           "/index/test/news/2005/10/10?action=urlsig_url10", 
     288          "/index/test/news/2005/10/01", 
     289          "/index/test/news/2005/10/09?action=urlsig:url9", 
     290          "/index/test/news/2005/10/09?action=urlsig:url9", 
     291          "/index/test/news/2005/10/10?action=urlsig:url10", 
    286292          "/testnews/2004/05", 
    287293          "/index/test/cms/actualite/65-c-est-la-fete-au-village", 
    288294          "/test/cms2/actualite/65", 
    289295          "/foo/bar/withhandler/premier/deuxieme", 
    290           "/index?foo=oof&bar=rab&module=jelix_tests&action=urlsig_url5", 
     296          "/index?foo=oof&bar=rab&module=jelix_tests&action=urlsig:url5", 
    291297          "/xmlrpc", 
    292           "/news?aaa=bbb&action=default_bar", 
    293           "/index/test/news/2007/23/74?action=urlsig_url8", 
     298          "/news?aaa=bbb&action=default:bar", 
     299          "/index/test/news/2007/23/74?action=urlsig:url8", 
    294300          "/index/shop/vetements/98", 
    295301          "/index/shop/bricolage/53/", 
     
    303309          "/index/hello3", 
    304310       ); 
    305       $trueResult[11]='https://'.$_SERVER['HTTP_HOST'].$trueResult[11]; 
     311      $trueResult[13]='https://'.$_SERVER['HTTP_HOST'].$trueResult[13]; 
    306312      $this->_doCompareUrl("significant, multiview = true", $urlList,$trueResult); 
    307313 
     
    348354       ); 
    349355      $this->_doCompareError("significant, errors multiview = true", $urlList,$trueResult); 
    350  
    351  
    352     } 
    353  
    354  
    355  
    356  
     356    } 
    357357} 
    358358?> 
  • trunk/testapp/modules/jelix_tests/tests/core.old_urls_generation.html.php

    r691 r693  
    3030      $this->oldActionSelector = $gJConfig->enableOldActionSelector; 
    3131      $gJConfig->enableOldActionSelector = true; 
    32       $gJConfig->simple_urlengine_entrypoints['testnews'] = "jelix_tests~urlsig_url2@classic jelix_tests~urlsig_url3@classic"; 
    33       $gJConfig->simple_urlengine_entrypoints['foo/bar'] = "jelix_tests~urlsig_url4@classic"; 
     32      $gJConfig->simple_urlengine_entrypoints['testnews'] = "jelix_tests~urlsig:url2@classic jelix_tests~urlsig:url3@classic"; 
     33      $gJConfig->simple_urlengine_entrypoints['foo/bar'] = "jelix_tests~urlsig:url4@classic"; 
    3434    } 
    3535 
     
    107107         'entrypointExtension'=>'.php', 
    108108         'notfoundAct'=>'jelix~notfound', 
    109          'simple_urlengine_https'=>'jelix_tests~urlsig_url8@classic @xmlrpc', 
     109         'simple_urlengine_https'=>'jelix_tests~urlsig:url8@classic @xmlrpc', 
    110110         'significantFile'=>'urls_old.xml', 
    111111       ); 
     
    130130 
    131131      $trueResult=array( 
    132           "/index.php?mois=10&annee=2005&id=35&module=jelix_tests&action=urlsig_url1", 
    133           "/testnews.php?mois=05&annee=2004&module=jelix_tests&action=urlsig_url2", 
    134           "/testnews.php?rubrique=actualite&id_art=65&article=c%27est+la+f%C3%AAte+au+village&module=jelix_tests&action=urlsig_url3", 
    135           "/foo/bar.php?first=premier&second=deuxieme&module=jelix_tests&action=urlsig_url4", 
    136           "/index.php?foo=oof&bar=rab&module=jelix_tests&action=urlsig_url5", 
     132          "/index.php?mois=10&annee=2005&id=35&module=jelix_tests&action=urlsig:url1", 
     133          "/testnews.php?mois=05&annee=2004&module=jelix_tests&action=urlsig:url2", 
     134          "/testnews.php?rubrique=actualite&id_art=65&article=c%27est+la+f%C3%AAte+au+village&module=jelix_tests&action=urlsig:url3", 
     135          "/foo/bar.php?first=premier&second=deuxieme&module=jelix_tests&action=urlsig:url4", 
     136          "/index.php?foo=oof&bar=rab&module=jelix_tests&action=urlsig:url5", 
    137137          "/xmlrpc.php", 
    138           "/index.php?rubrique=vetements&id_article=98&module=jelix_tests&action=urlsig_url8", 
     138          "/index.php?rubrique=vetements&id_article=98&module=jelix_tests&action=urlsig:url8", 
    139139       ); 
    140140 
     
    147147      jUrl::getEngine(true); // on recharge le nouveau moteur d'url 
    148148      $trueResult=array( 
    149           "/index?mois=10&annee=2005&id=35&module=jelix_tests&action=urlsig_url1", 
    150           "/testnews?mois=05&annee=2004&module=jelix_tests&action=urlsig_url2", 
    151           "/testnews?rubrique=actualite&id_art=65&article=c%27est+la+f%C3%AAte+au+village&module=jelix_tests&action=urlsig_url3", 
    152           "/foo/bar?first=premier&second=deuxieme&module=jelix_tests&action=urlsig_url4", 
    153           "/index?foo=oof&bar=rab&module=jelix_tests&action=urlsig_url5", 
     149          "/index?mois=10&annee=2005&id=35&module=jelix_tests&action=urlsig:url1", 
     150          "/testnews?mois=05&annee=2004&module=jelix_tests&action=urlsig:url2", 
     151          "/testnews?rubrique=actualite&id_art=65&article=c%27est+la+f%C3%AAte+au+village&module=jelix_tests&action=urlsig:url3", 
     152          "/foo/bar?first=premier&second=deuxieme&module=jelix_tests&action=urlsig:url4", 
     153          "/index?foo=oof&bar=rab&module=jelix_tests&action=urlsig:url5", 
    154154          "/xmlrpc", 
    155           "/index?rubrique=vetements&id_article=98&module=jelix_tests&action=urlsig_url8", 
     155          "/index?rubrique=vetements&id_article=98&module=jelix_tests&action=urlsig:url8", 
    156156       ); 
    157157      $trueResult[5]='https://'.$_SERVER['HTTP_HOST'].$trueResult[5]; 
     
    176176         'defaultEntrypoint'=>'index', 
    177177         'entrypointExtension'=>'.php', 
    178          'notfoundAct'=>'jelix~notfound', 
    179          'simple_urlengine_https'=>'jelix_tests~urlsig_url8@classic @xmlrpc', 
     178         'notfoundAct'=>'jelix~error:notfound', 
     179         'simple_urlengine_https'=>'jelix_tests~urlsig:url8@classic @xmlrpc', 
    180180         'significantFile'=>'urls_old.xml', 
    181181       ); 
     
    218218         'defaultEntrypoint'=>'index', 
    219219         'entrypointExtension'=>'.php', 
    220          'notfoundAct'=>'jelix~notfound', 
     220         'notfoundAct'=>'jelix~error:notfound', 
    221221         'significantFile'=>'urls_old.xml', 
    222222       ); 
     
    229229      $urlList=array(); 
    230230      $urlList[]= array('urlsig_url1', array('mois'=>'10',  'annee'=>'2005', 'id'=>'01')); 
     231      $urlList[]= array('urlsig:url1', array('mois'=>'10',  'annee'=>'2005', 'id'=>'01')); 
    231232      $urlList[]= array('urlsig_url9', array('mois'=>'10',  'annee'=>'2005', 'id'=>'09')); 
     233      $urlList[]= array('urlsig:url9', array('mois'=>'10',  'annee'=>'2005', 'id'=>'09')); 
    232234      $urlList[]= array('urlsig_url10', array('mois'=>'10',  'annee'=>'2005', 'id'=>'10')); 
    233235      $urlList[]= array('urlsig_url2', array('mois'=>'05',  'annee'=>'2004')); 
     
    253255      $trueResult=array( 
    254256          "/index.php/test/news/2005/10/01", 
    255           "/index.php/test/news/2005/10/09?action=urlsig_url9", 
    256           "/index.php/test/news/2005/10/10?action=urlsig_url10", 
     257          "/index.php/test/news/2005/10/01", 
     258          "/index.php/test/news/2005/10/09?action=urlsig:url9", 
     259          "/index.php/test/news/2005/10/09?action=urlsig:url9", 
     260          "/index.php/test/news/2005/10/10?action=urlsig:url10", 
    257261          "/testnews.php/2004/05", 
    258262          "/index.php/test/cms/actualite/65-c-est-la-fete-au-village", 
    259263          "/test/cms2/actualite/65", 
    260264          "/foo/bar.php/withhandler/premier/deuxieme", 
    261           "/index.php?foo=oof&bar=rab&module=jelix_tests&action=urlsig_url5", 
     265          "/index.php?foo=oof&bar=rab&module=jelix_tests&action=urlsig:url5", 
    262266          "/xmlrpc.php", 
    263           "/news.php?aaa=bbb&action=default_bar", 
    264           "/index.php/test/news/2007/23/74?action=urlsig_url8", 
     267          "/news.php?aaa=bbb&action=default:bar", 
     268          "/index.php/test/news/2007/23/74?action=urlsig:url8", 
    265269          "/index.php/shop/vetements/98", 
    266270          "/index.php/shop/bricolage/53/", 
     
    275279       ); 
    276280 
    277       $trueResult[11]='https://'.$_SERVER['HTTP_HOST'].$trueResult[11]; 
     281      $trueResult[13]='https://'.$_SERVER['HTTP_HOST'].$trueResult[13]; 
    278282      $this->_doCompareUrl("significant, multiview = false", $urlList,$trueResult); 
    279283 
     
    282286      $trueResult=array( 
    283287          "/index/test/news/2005/10/01", 
    284           "/index/test/news/2005/10/09?action=urlsig_url9", 
    285           "/index/test/news/2005/10/10?action=urlsig_url10", 
     288