Changeset 98

Show
Ignore:
Timestamp:
03/08/06 23:20:54 (3 years ago)
Author:
laurentj
Message:

suppression du fichier actions.xml : valeur d'action=actiongroup_methode, modifiée dans tous les modules, dans les configs...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/manifests/jelix-dev.mn

    r89 r98  
    122122  template.tpl 
    123123  zone.tpl 
    124   actions.xml.tpl 
    125124  project.xml.tpl 
    126125  application.init.php.tpl 
  • trunk/build/manifests/jelix-lib.mn

    r89 r98  
    11cd . 
    22  README 
    3    
     3 
    44cd lib 
    55  .htaccess 
     
    1818 
    1919cd lib/jelix/core 
    20   jActionDesc.class.php 
    2120  jActionGroup.class.php 
    22   jActionsCompiler.class.php 
    2321  jConfig.class.php 
    2422  jContext.class.php 
     
    160158  auth.ISO-8859-1.properties 
    161159cd lib/jelix-modules/auth 
    162   actions.xml 
    163160  module.xml 
    164161cd lib/jelix-modules/auth/plugins/auth 
  • trunk/build/manifests/myapp.mn

    r89 r98  
    2020  .htaccess 
    2121cd myapp/modules/myapp 
    22   actions.xml 
    2322  module.xml 
    2423cd myapp/modules/myapp/actiongroups 
  • trunk/build/manifests/testapp.mn

    r89 r98  
    2424  .htaccess 
    2525cd testapp/modules/testapp 
    26   actions.xml 
    2726  module.xml 
    2827cd testapp/modules/testapp/locales/en_US 
     
    4443cd testapp/modules/unittest 
    4544  events.xml 
    46   actions.xml 
    4745  module.xml 
    4846cd testapp/modules/unittest/classes 
  • trunk/lib/jelix-modules/auth/actiongroups/login.ag.php

    r79 r98  
    1818 
    1919class AGLogin extends jActionGroup { 
     20 
     21    public $pluginParams = array( 
     22      '*'=>array('auth.required'=>false) 
     23    ); 
     24 
    2025    /** 
    2126    * 
    2227    */ 
    23     function doLogin (){ 
     28    function in (){ 
    2429        $conf = $GLOBALS['gJCoord']->getPlugin ('auth')->config; 
    2530 
     
    3035        if (!jAuth::login($this->param('login'), $this->param('password'))){ 
    3136            sleep (intval($conf['on_error_sleep'])); 
    32             $url_return = jUrl::get('auth~loginform',array ('login'=>$this->param('login'), 'failed'=>1)); 
     37            $url_return = jUrl::get('auth~login_form',array ('login'=>$this->param('login'), 'failed'=>1)); 
    3338        } 
    3439 
    35         $rep = $this->getResponse('next'); 
     40        $rep = $this->getResponse('redirectUrl'); 
    3641        $rep->url = $url_return; 
    3742        return $rep; 
     
    4146    * 
    4247    */ 
    43     function doLogout (){ 
     48    function out (){ 
    4449        jAuth::logout(); 
    4550        $conf = $GLOBALS['gJCoord']->getPlugin ('auth')->config; 
     
    4853            $url_return =  jUrl::get($conf['after_logout']); 
    4954        } 
    50         $rep = $this->getResponse('next'); 
     55        $rep = $this->getResponse('redirectUrl'); 
    5156        $rep->url = $url_return; 
    5257        return $rep; 
     
    5661    * Shows the login form 
    5762    */ 
    58     function getLoginForm() { 
    59         $rep = $this->getResponse('loginform'); 
     63    function form() { 
     64        $rep = $this->getResponse('html'); 
    6065 
    6166        $rep->title =  jLocale::get ('auth.titlePage.login'); 
  • trunk/lib/jelix-modules/auth/plugins/auth/auth.plugin.ini.php.dist

    r21 r98  
    2727 
    2828; action �xecuter en cas de d�ut d'authentification quand onError = 2 
    29 on_error_ag = auth~login 
    30 on_error_method = doLogout 
     29on_error_action = auth~login_out 
    3130 
    3231; nombre de secondes d'attentes apr�un d�ut d'authentification 
     
    4140 
    4241; action en cas de piratage de la session et si onError = 2 
    43 bad_ip_ag = auth~login 
    44 bad_ip_method = doLogout 
     42bad_ip_action = auth~login_out 
    4543 
    4644enable_after_login_override = off 
     
    4846 
    4947enable_after_logout_override = off 
    50 after_logout = auth~login 
     48after_logout = auth~login_out 
    5149 
    5250login_template = auth~login.form 
  • trunk/lib/jelix-modules/auth/plugins/auth/auth.plugin.php

    r21 r98  
    2525 
    2626    /** 
    27          * IPCheck if needed, creating the user object if not yet. 
    28          * @param       CopixAction     $action le descripteur de page d�ct�     * @access public 
    29         */ 
    30     public function beforeProcess (&$action){ 
     27     * @param    array  $params   plugin parameters for the current action 
     28     * @return null or jSelectorAct  if action should change 
     29    */ 
     30    public function beforeProcess ($params){ 
    3131        $notLogged = false; 
    3232        $badip = false; 
     33        $selector = null; 
    3334 
    3435        //Do we check the ip ? 
     
    3940                if (($_SESSION['JELIX_AUTH_SECURE_WITH_IP'] != $this->_getIpForSecure ())){ 
    4041                    session_destroy (); 
    41                     $sel= new jSelectorAg($this->config['bad_ip_ag']); 
    42                     $action->actionsGroupPath = $sel->getPath(); 
    43                     $action->actionsGroupClass = 'AG'.$sel->ressource; 
    44                     $action->method = $this->config['bad_ip_method']; 
     42                    $selector = new jSelectorAct($this->config['bad_ip_action']); 
    4543                    $notLogged = true; 
    4644                    $badip = true; 
     
    6664        } 
    6765 
    68         $needAuth = isset($action->pluginParams['auth.required']) ? ($action->pluginParams['auth.required']=='true'):$this->config['auth_required']; 
     66        $needAuth = isset($action->pluginParams['auth.required']) ? ($action->pluginParams['auth.required']==true):$this->config['auth_required']; 
    6967        $authok = false; 
    7068 
     
    7674                }else{ 
    7775                    if(!$badip){ 
    78                         $sel= new jSelectorAg($this->config['on_error_ag']); 
    79                         $action->actionsGroupPath = $sel->getPath(); 
    80                         $action->actionsGroupClass = 'AG'.$sel->ressource; 
    81                         $action->method = $this->config['on_error_method']; 
     76                        $selector= new jSelectorAct($this->config['on_error_action']); 
    8277                    } 
    8378                } 
     
    8883          $authok= true; 
    8984        } 
     85 
     86        return $selector; 
    9087    } 
    9188 
  • trunk/lib/jelix-modules/jelix/locales/en_US/errors.ISO-8859-1.properties

    r42 r98  
    77 
    88ad.response.unknow=(110)Action %s : response %s doesn't exists (file : %s) 
    9 ad.response.type.unknow=(111)Action %s : the type "%s" of the response %s is unknown (file : %s) 
    10 ad.response.not.loaded=(112)Action %s : the class for the response %3$s (type "%2$s") can't be loaded 
     9ad.response.type.unknow=(111)Action %s : the response type "%s" is unknown (file : %s) 
     10ad.response.not.loaded=(112)Action %s : the class for the response type "%s" can't be loaded (file : %s) 
     11ad.response.type.notallowed=(112)Action %s : the response type "%s" is not allowed for the current request (file : %s) 
    1112 
    1213 
  • trunk/lib/jelix-modules/jelix/locales/fr_FR/errors.ISO-8859-1.properties

    r42 r98  
    77 
    88ad.response.unknow=(110)Action %s : la r�nse %s n'existe pas (fichier : %s) 
    9 ad.response.type.unknow=(111)Action %s : Le type "%s" de la r�nse %s est inconnu (fichier : %s) 
    10 ad.response.not.loaded=(112)Action %s : La classe pour la r�nse %3$s de type "%2$s" ne peut �e charg� 
     9ad.response.type.unknow=(111)Action %s : Le type de r�nse "%s" est inconnu (fichier : %s) 
     10ad.response.not.loaded=(112)Action %s : La classe pour la r�nse de type "%s" ne peut �e charg�(fichier : %s) 
     11ad.response.type.notallowed=(112)Action %s : le type de reponse "%s" n'est pas permis pour la requ� courante (file : %s) 
    1112 
    1213#---- compilateur d'action 
  • trunk/lib/jelix-plugins/magicquotes/magicquotes.plugin.php

    r31 r98  
    4747        } 
    4848   } 
    49    /** 
    50      * @param    jAction  $action  action that will be executed 
     49    /** 
     50     * @param    array  $params   plugin parameters for the current action 
     51     * @return null or jSelectorAct  if action should change 
    5152     */ 
    52     public function beforeAction(& $action){ } 
    53  
     53    public function beforeAction($params){ return null;} 
    5454    public function beforeOutput() {} 
    5555 
  • trunk/lib/jelix-scripts/commands/createmodule.cmd.php

    r20 r98  
    1919    public  $syntaxhelp = "[-nosubdir] [-noag]  MODULE"; 
    2020    public  $help=" 
    21     Cr� un nouveau module, avec son fichier module.xml, action.xml 
     21    Cr� un nouveau module, avec son fichier module.xml, 
    2222    et un actiongroup par d�ut, ainsi que tous les sous-repertoires courants 
    2323    (zones, templates, daos, locales, classes...). 
     
    3636       $this->createDir($path); 
    3737       $this->createFile($path.'module.xml','module.xml.tpl',array('name'=>$this->_parameters['module'])); 
    38        $this->createFile($path.'actions.xml','actions.xml.tpl',array('module'=>$this->_parameters['module'])); 
     38       //$this->createFile($path.'actions.xml','actions.xml.tpl',array('module'=>$this->_parameters['module'])); 
    3939 
    4040       if(!$this->getOption('-nosubdir')){ 
  • trunk/lib/jelix/core/jActionGroup.class.php

    r40 r98  
    1818class jActionGroup { 
    1919 
     20    public $pluginParams=array(); 
    2021    private $request; 
    21     private $action; 
    2222 
    2323    /** 
     
    2525    * @param 
    2626    */ 
    27     function __construct ($action, $request){ 
     27    function __construct ( $request){ 
    2828        $this->request = $request; 
    29         $this->action = $action; 
    3029    } 
    3130 
     
    5049 
    5150    protected function getResponse($name){ 
    52         return $this->action->getResponse($name); 
     51        return $this->request->getResponse($name); 
    5352    } 
    5453 
  • trunk/lib/jelix/core/jConfig.class.php

    r75 r98  
    4444        $config->isWindows = (strtolower($os) == 'win'); 
    4545        if(trim( $config->defaultAction) == '') 
    46              $config->defaultAction = 'default'; 
     46             $config->defaultAction = '_'; 
    4747 
    4848        $config->pluginsPathList = self::_loadPathList($config, $configFile,'plugins'); 
  • trunk/lib/jelix/core/jCoordinator.class.php

    r66 r98  
    107107        session_start(); 
    108108 
    109         $this->moduleName = $this->request->getParam('module', $gJConfig->defaultModule,true); 
    110         $this->actionName = $this->request->getParam('action', $gJConfig->defaultAction,true); 
     109        $this->moduleName = $this->request->getParam('module'); 
     110        $this->actionName = $this->request->getParam('action'); 
     111 
     112        if($this->moduleName === null){ 
     113            $this->moduleName = $gJConfig->defaultModule; 
     114            if($this->actionName === null) 
     115               $this->actionName = $gJConfig->defaultAction; 
     116        } 
     117        if($this->actionName === null){ 
     118            $this->actionName = 'default_index'; 
     119        } 
     120 
    111121 
    112122        // verification du module 
     
    118128        jContext::push ($this->moduleName); 
    119129 
    120         $selector = new jSelectorAct($this->actionName); 
    121  
    122         $result = jIncluder::inc($selector); 
    123         if($result['compileok'] == false || $this->action===null){ 
    124            trigger_error(jLocale::get('jelix~errors.action.unknow',$this->actionName), E_USER_ERROR); 
    125            return; 
    126         } 
    127  
     130        $this->action = new jSelectorAct($this->actionName); 
     131 
     132        $ag = $this->getController($this->action); 
     133 
     134        $pluginparams = array(); 
     135        if(isset($ag->pluginsParam['*'])){ 
     136            $pluginparams = $ag->pluginsParam['*']; 
     137        } 
     138 
     139        if(isset($ag->pluginsParam[$this->action->method])){ 
     140            $pluginparams = array_merge($pluginparams, $ag->pluginsParam[$this->action->method]); 
     141        } 
    128142 
    129143        foreach ($this->plugins as $name => $obj){ 
    130             $this->plugins[$name]->beforeProcess ($this->action); 
     144            $result = $this->plugins[$name]->beforeProcess ($pluginparams); 
     145            if($result){ 
     146               $this->action = $result; 
     147               $ag = $this->getController($this->action); 
     148               break; 
     149            } 
    131150        } 
    132151 
    133152        //try{ 
    134             $this->response = $this->action->perform(); 
     153            $this->response = $ag->{$this->action->method}(); 
    135154        /*}catch(jException $e){ 
    136155            trigger_error($e->getLocaleMessage(), E_USER_ERROR); 
     
    160179 
    161180        jContext::pop(); 
     181    } 
     182 
     183    private function getController($selector){ 
     184 
     185        $agpath = $selector->getPath(); 
     186        $class = $selector->getClass(); 
     187        $method = $selector->method; 
     188 
     189        if(!file_exists($agpath)){ 
     190            trigger_error(jLocale::get('jelix~errors.ad.actiongroup.file.unknow',array($this->actionName,$agpath)),E_USER_ERROR); 
     191            return; 
     192        } 
     193        require($agpath); 
     194        if(!class_exists($class,false)){ 
     195            trigger_error(jLocale::get('jelix~errors.ad.actiongroup.class.unknow',array($this->actionName,$class, $agpath)),E_USER_ERROR); 
     196            return; 
     197        } 
     198 
     199        $ag = new $class($this->request); 
     200 
     201        if(!method_exists($ag,$method)){ 
     202            trigger_error(jLocale::get('jelix~errors.ad.actiongroup.method.unknow',array($this->actionName,$method, $class, $agpath)),E_USER_ERROR); 
     203            return; 
     204        } 
     205        return $ag; 
    162206    } 
    163207 
  • trunk/lib/jelix/core/jDefaultConfig.lib.php

    r75 r98  
    1414$gDefaultConfig = array ( 
    1515  'defaultModule' => 'myapp', 
    16   'defaultAction' => 'default', 
     16  'defaultAction' => '_', 
    1717  'checkTrustedModules' => '', 
    1818  'trustedModules' => '', // liste des modules, s�r�par des virgules, sans espace 
  • trunk/lib/jelix/core/jIPlugin.iface.php

    r1 r98  
    2424 
    2525    /** 
    26      * @param    jAction  $action  action that will be executed 
     26     * @param    array  $params   plugin parameters for the current action 
     27     * @return null or jSelectorAct  if action should change 
    2728     */ 
    28     public function beforeAction(& $action); 
     29    public function beforeAction($params); 
    2930 
    3031    /** 
  • trunk/lib/jelix/core/jRequest.class.php

    r75 r98  
    9898    } 
    9999 
     100    public function getResponse($type=''){ 
     101        global $gJCoord, $gJConfig; 
     102        if($type == ''){ 
     103            $type = $this->defaultResponseType; 
     104        } 
     105 
     106        if(!isset($gJConfig->responses[$type])){ 
     107            trigger_error(jLocale::get('jelix~errors.ad.response.type.unknow',array($gJCoord->action->resource,$type,$gJCoord->action->getPath())),E_USER_ERROR); 
     108            return null; 
     109        } 
     110        $respclass = $gJConfig->responses[$type]; 
     111        if(file_exists($path=JELIX_LIB_RESPONSE_PATH.$respclass.'.class.php')){ 
     112           require_once ($path); 
     113        }elseif(file_exists($path=JELIX_APP_PATH.'responses/'.$respclass.'.class.php')){ 
     114           require_once ($path); 
     115        }else{ 
     116           trigger_error(jLocale::get('jelix~errors.ad.response.not.loaded',array($gJCoord->action->resource,$type,$gJCoord->action->getPath())),E_USER_ERROR); 
     117           return null; 
     118        } 
     119 
     120        if(!$this->isAllowedResponse($respclass)){ 
     121           trigger_error(jLocale::get('jelix~errors.ad.response.type.notallowed',array($gJCoord->action->resource,$type,$gJCoord->action->getPath())),E_USER_ERROR); 
     122           return null; 
     123        } 
     124 
     125        $response = new $respclass(); 
     126        $gJCoord->response= $response; 
     127 
     128        return $response; 
     129    } 
    100130} 
    101131 
  • trunk/lib/jelix/core/jSelector.class.php

    r97 r98  
    138138    public $type = 'act'; 
    139139    public $request = ''; 
     140    public $controller = ''; 
     141    public $method=''; 
    140142    protected $_dirname='actions/'; 
    141143 
    142144    function __construct($sel){ 
    143145        global $gJCoord; 
    144         $this->_compiler='jActionsCompiler'; 
    145         $this->_compilerPath=JELIX_LIB_CORE_PATH.'jActionsCompiler.class.php'; 
    146         $this->request = $gJCoord->request->type; 
    147146 
    148147        if(preg_match("/^(?:([\w\.]+|\#)~)?([\w\.]+|\#)(?:@([\w\.]+))?$/", $sel, $m)){ 
     
    161160               $this->resource = $m[2]; 
    162161 
     162            $r = explode('_',$this->resource); 
     163 
     164            if(count($r) == 1){ 
     165               $this->controller = 'default'; 
     166               $this->method = $r[0]==''?'index':$r[0]; 
     167            }else{ 
     168               $this->controller = $r[0]=='' ? 'default':$r[0]; 
     169               $this->method = $r[1]==''?'index':$r[1]; 
     170            } 
     171 
    163172            if(isset($m[3]) && $m[3] != '') 
    164173              $this->request = $m[3]; 
     
    179188            $this->_valid = false; 
    180189        }else{ 
    181             $this->_path = $gJConfig->modulesPathList[$this->module].'actions.xml'; 
    182         } 
    183     } 
    184  
    185     protected function _createCachePath(){ 
    186         $this->_cachePath = JELIX_APP_TEMP_PATH.'compiled/'.$this->_dirname.$this->module.'~'.$this->resource.'~'.$this->request.'.php'; 
    187     } 
    188     public function getCacheDir(){ 
    189         return JELIX_APP_TEMP_PATH.'compiled/'.$this->_dirname; 
    190     } 
     190           // $this->_path = $gJConfig->modulesPathList[$this->module].'actiongroups/'.$this->controller.'.'.$this->request.'.php'; 
     191            $this->_path = $gJConfig->modulesPathList[$this->module].'actiongroups/'.$this->controller.'.ag.php'; 
     192        } 
     193    } 
     194 
     195    protected function _createCachePath(){ 
     196        $this->_cachePath = ''; 
     197    } 
     198 
    191199    public function toString($full=false){ 
    192200        if($full) 
     
    195203            return $this->module.'~'.$this->resource.'@'.$this->request; 
    196204    } 
     205 
     206    public function getClass(){ 
     207      return 'AG'.$this->controller; 
     208    } 
     209 
    197210} 
    198211 
  • trunk/lib/jelix/init.php

    r86 r98  
    4141require_once (JELIX_LIB_CORE_PATH . 'url/jUrl.class.php'); 
    4242require_once (JELIX_LIB_CORE_PATH . 'jCoordinator.class.php'); 
    43 require_once (JELIX_LIB_CORE_PATH . 'jActionDesc.class.php'); 
    4443require_once (JELIX_LIB_CORE_PATH . 'jActionGroup.class.php'); 
    4544require_once (JELIX_LIB_CORE_PATH . 'jRequest.class.php'); 
  • trunk/myapp/modules/myapp/actiongroups/main.ag.php

    r40 r98  
    1313class AGMain extends jActionGroup { 
    1414 
    15   function getDefault(){ 
    16       $rep = $this->getResponse('hello'); 
     15  function index(){ 
     16      $rep = $this->getResponse('html'); 
    1717      $rep->bodyTpl = 'myapp~hello'; 
    1818      return $rep; 
  • trunk/myapp/var/config/config.classic.ini.php.dist

    r75 r98  
    33 
    44defaultModule = "myapp" 
    5 defaultAction = "default
     5defaultAction = "main_
    66defaultLocale = "fr_FR" 
    77defaultCharset = "ISO-8859-1" 
  • trunk/testapp/modules/testapp/actiongroups/main.ag.php

    r69 r98  
    1313class AGMain extends jActionGroup { 
    1414 
    15   function getDefault(){ 
     15  function index(){ 
    1616 
    1717      if($this->param('output') == 'text'){ 
    18          $rep = $this->getResponse('hellotext'); 
     18         $rep = $this->getResponse('text'); 
    1919         $rep->content = 'Hello World !'; 
    2020      }else{ 
    2121 
    22          $rep = $this->getResponse('hello'); 
     22         $rep = $this->getResponse('html'); 
    2323         $rep->title = 'Hello From Jelix !'; 
    2424         $rep->bodyTpl = 'testapp~hello'; 
     
    3030   } 
    3131 
    32  
    33  
    34    function getTestDao(){ 
     32   function testdao(){ 
    3533    if( $id=$this->param('newid')){ 
    3634        $dao = jDAO::get('config'); 
     
    4240    } 
    4341 
    44     $rep = $this->getResponse('dao'); 
     42    $rep = $this->getResponse('html'); 
    4543    $rep->title = 'This is a DAO Test'; 
    4644    $rep->bodyTpl = 'testapp~main'; 
  • trunk/testapp/modules/testapp/templates/testzone.tpl

    r88 r98  
    2323<p>Link to actions:</p> 
    2424<ul> 
    25 <li> "testapp~default@classic" : {jurl "testapp~default@classic"}</li> 
    26 <li> "default@classic": {jurl "default@classic"}</li> 
    27 <li> "default" : {jurl "default"}</li> 
    28 <li> "testapp~default" : {jurl "testapp~default"}</li> 
     25<li> "testapp~main_index@classic" : {jurl "testapp~main_index@classic"}</li> 
     26<li> "main_index@classic": {jurl "main_index@classic"}</li> 
     27<li> "main_index" : {jurl "main_index"}</li> 
     28<li> "testapp~main_" : {jurl "testapp~main_"}</li> 
    2929<li> "testapp~#" : {jurl "testapp~#"}</li> 
    3030<li> "#~#" : {jurl "#~#"}</li> 
  • trunk/testapp/modules/unittest/actiongroups/default.ag.php

    r78 r98  
    1313class AGDefault extends jActionGroup { 
    1414 
    15    function home() { 
    16       $rep = $this->getResponse(); 
     15   function index() { 
     16      $rep = $this->getResponse('unittest'); 
    1717      $rep->title = 'test unitaires'; 
    1818      $rep->body->assign('MAIN',''); 
     
    2323   * 
    2424   */ 
    25    function getTestEvents (){ 
    26       $rep = $this->getResponse(); 
     25   function testevent (){ 
     26      $rep = $this->getResponse('unittest'); 
    2727      $rep->title = 'test unitaires sur jEvent'; 
    2828 
     
    3535 
    3636   function testurlcreate(){ 
    37       $rep = $this->getResponse(); 
     37      $rep = $this->getResponse('unittest'); 
    3838      $rep->title = 'test unitaires sur la creation d\'url avec jUrl'; 
    3939 
     
    4545   } 
    4646   function testurlparse(){ 
    47       $rep = $this->getResponse(); 
     47      $rep = $this->getResponse('unittest'); 
    4848      $rep->title = 'test unitaires sur le parsing d\'url avec jUrl'; 
    4949 
     
    5353 
    5454      return $rep; 
    55    }} 
     55   } 
     56
    5657?> 
  • trunk/testapp/modules/unittest/actiongroups/urlsig.ag.php

    r71 r98  
    1414class AGUrlsig extends jActionGroup { 
    1515 
    16    function getDummyUrl() { 
    17       return $this->getResponse('default'); 
     16   function url1() { 
     17      return $this->getResponse('testunit'); 
    1818   } 
    19  
    20  
     19   function url2() { 
     20      return $this->getResponse('testunit'); 
     21   } 
     22   function url3() { 
     23      return $this->getResponse('testunit'); 
     24   } 
     25   function url4() { 
     26      return $this->getResponse('testunit'); 
     27   } 
     28   function url5() { 
     29      return $this->getResponse('testunit'); 
     30   } 
    2131} 
    2232 
  • trunk/testapp/modules/unittest/classes/utcreateurls.class.php

    r75 r98  
    6565 
    6666      $urlList=array(); 
    67       $urlList[]= array('url1', array('mois'=>'10',  'annee'=>'2005', 'id'=>'35')); 
    68       $urlList[]= array('url2', array('mois'=>'05',  'annee'=>'2004')); 
    69       $urlList[]= array('unittest~url3', array('rubrique'=>'actualite',  'id_art'=>'65', 'article'=>'c\'est la f� au village')); 
    70       $urlList[]= array('unittest~url4', array('first'=>'premier',  'second'=>'deuxieme')); 
     67      $urlList[]= array('urlsig_url1', array('mois'=>'10',  'annee'=>'2005', 'id'=>'35')); 
     68      $urlList[]= array('urlsig_url2', array('mois'=>'05',  'annee'=>'2004')); 
     69      $urlList[]= array('unittest~urlsig_url3', array('rubrique'=>'actualite',  'id_art'=>'65', 'article'=>'c\'est la f� au village')); 
     70      $urlList[]= array('unittest~urlsig_url4', array('first'=>'premier',  'second'=>'deuxieme')); 
    7171      // celle ci n'a pas de d�nition dans urls.xml *expr� 
    72       $urlList[]= array('url5', array('foo'=>'oof',  'bar'=>'rab')); 
     72      $urlList[]= array('urlsig_url5', array('foo'=>'oof',  'bar'=>'rab')); 
    7373      $urlList[]= array('foo~bar@xmlrpc', array('aaa'=>'bbb')); 
    7474 
    7575      $trueResult=array( 
    76           "index.php?mois=10&annee=2005&id=35&module=unittest&action=url1", 
    77           "testnews.php?mois=05&annee=2004&module=unittest&action=url2", 
    78           "testnews.php?rubrique=actualite&id_art=65&article=c%27est+la+f%EAte+au+village&module=unittest&action=url3", 
    79           "foo/bar.php?first=premier&second=deuxieme&module=unittest&action=url4", 
    80           "index.php?foo=oof&bar=rab&module=unittest&action=url5", 
     76          "index.php?mois=10&annee=2005&id=35&module=unittest&action=urlsig_url1", 
     77          "testnews.php?mois=05&annee=2004&module=unittest&action=urlsig_url2", 
     78          "testnews.php?rubrique=actualite&id_art=65&article=c%27est+la+f%EAte+au+village&module=unittest&action=urlsig_url3", 
     79          "foo/bar.php?first=premier&second=deuxieme&module=unittest&action=urlsig_url4", 
     80          "index.php?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 
    8181          "xmlrpc.php", 
    8282       ); 
     
    9292      $gJConfig->urlengine['multiview']=true; 
    9393      $trueResult=array( 
    94           "index?mois=10&annee=2005&id=35&module=unittest&action=url1", 
    95           "testnews?mois=05&annee=2004&module=unittest&action=url2", 
    96           "testnews?rubrique=actualite&id_art=65&article=c%27est+la+f%EAte+au+village&module=unittest&action=url3", 
    97           "foo/bar?first=premier&second=deuxieme&module=unittest&action=url4", 
    98           "index?foo=oof&bar=rab&module=unittest&action=url5", 
     94          "index?mois=10&annee=2005&id=35&module=unittest&action=urlsig_url1", 
     95          "testnews?mois=05&annee=2004&module=unittest&action=urlsig_url2", 
     96          "testnews?rubrique=actualite&id_art=65&article=c%27est+la+f%EAte+au+village&module=unittest&action=urlsig_url3", 
     97          "foo/bar?first=premier&second=deuxieme&module=unittest&action=urlsig_url4", 
     98          "index?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 
    9999          "xmlrpc", 
    100100       ); 
     
    130130 
    131131      $urlList=array(); 
    132       $urlList[]= array('url1', array('mois'=>'10',  'annee'=>'2005', 'id'=>'35')); 
    133       $urlList[]= array('url2', array('mois'=>'05',  'annee'=>'2004')); 
    134       $urlList[]= array('unittest~url3', array('rubrique'=>'actualite',  'id_art'=>'65', 'article'=>'c\'est la f� au village')); 
    135       $urlList[]= array('unittest~url4', array('first'=>'premier',  'second'=>'deuxieme')); 
     132      $urlList[]= array('urlsig_url1', array('mois'=>'10',  'annee'=>'2005', 'id'=>'35')); 
     133      $urlList[]= array('urlsig_url2', array('mois'=>'05',  'annee'=>'2004')); 
     134      $urlList[]= array('unittest~urlsig_url3', array('rubrique'=>'actualite',  'id_art'=>'65', 'article'=>'c\'est la f� au village')); 
     135      $urlList[]= array('unittest~urlsig_url4', array('first'=>'premier',  'second'=>'deuxieme')); 
    136136      // celle ci n'a pas de d�nition dans urls.xml *expr� 
    137       $urlList[]= array('url5', array('foo'=>'oof',  'bar'=>'rab')); 
     137      $urlList[]= array('urlsig_url5', array('foo'=>'oof',  'bar'=>'rab')); 
    138138      $urlList[]= array('foo~bar@xmlrpc', array('aaa'=>'bbb')); 
    139139      $urlList[]= array('news~bar', array('aaa'=>'bbb')); 
     
    144144          "index.php/test/cms/actualite/65-c-est-la-fete-au-village", 
    145145          "foo/bar.php/withhandler/premier/deuxieme", 
    146           "index.php?foo=oof&bar=rab&module=unittest&action=url5", 
     146          "index.php?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 
    147147          "xmlrpc.php", 
    148148          "news.php?aaa=bbb&action=bar" 
     
    163163          "index/test/cms/actualite/65-c-est-la-fete-au-village", 
    164164          "foo/bar/withhandler/premier/deuxieme", 
    165           "index?foo=oof&bar=rab&module=unittest&action=url5", 
     165          "index?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 
    166166          "xmlrpc", 
    167167          "news?aaa=bbb&action=bar" 
  • trunk/testapp/modules/unittest/classes/utparseurls.class.php

    r76 r98  
    5959 
    6060      $resultList=array(); 
    61       $resultList[]= array('module'=>'unittest', 'action'=>'url1', 'mois'=>'10',  'annee'=>'2005', 'id'=>'35'); 
    62       $resultList[]= array('module'=>'unittest', 'action'=>'url8', 'mois'=>'10',  'annee'=>'2005', 'id'=>'35'); 
    63       $resultList[]= array('module'=>'unittest', 'action'=>'url2', 'mois'=>'05',  'annee'=>'2004', "mystatic"=>"valeur statique"); 
    64       $resultList[]= array('module'=>'unittest', 'action'=>'url3', 'rubrique'=>'actualite',  'id_art'=>'65', 'article'=>'c est la fete au village'); 
    65       $resultList[]= array('module'=>'unittest', 'action'=>'url4', 'first'=>'premier',  'second'=>'deuxieme'); 
     61      $resultList[]= array('module'=>'unittest', 'action'=>'urlsig_url1', 'mois'=>'10',  'annee'=>'2005', 'id'=>'35'); 
     62      $resultList[]= array('module'=>'unittest', 'action'=>'urlsig_url8', 'mois'=>'10',  'annee'=>'2005', 'id'=>'35'); 
     63      $resultList[]= array('module'=>'unittest', 'action'=>'urlsig_url2', 'mois'=>'05',  'annee'=>'2004', "mystatic"=>"valeur statique"); 
     64      $resultList[]= array('module'=>'unittest', 'action'=>'urlsig_url3', 'rubrique'=>'actualite',  'id_art'=>'65', 'article'=>'c est la fete au village'); 
     65      $resultList[]= array('module'=>'unittest', 'action'=>'urlsig_url4', 'first'=>'premier',  'second'=>'deuxieme'); 
    6666      // celle ci n'a pas de d�nition dans urls.xml *expr� 
    67       $resultList[]= array('module'=>'unittest', 'action'=>'url5', 'foo'=>'oof',  'bar'=>'rab'); 
     67      $resultList[]= array('module'=>'unittest', 'action'=>'urlsig_url5', 'foo'=>'oof',  'bar'=>'rab'); 
    6868      $resultList[]= array(); 
    69       $resultList[]= array('module'=>'news', 'action'=>'bar', 'aaa'=>'bbb'); 
     69      $resultList[]= array('module'=>'news', 'action'=>'main_bar', 'aaa'=>'bbb'); 
    7070 
    7171      $request=array( 
    7272          array("index.php","/test/news/2005/10/35",array()), 
    73           array("index.php","/test/news/2005/10/35",array("action"=>"url8")), 
     73          array("index.php","/test/news/2005/10/35",array("action"=>"urlsig_url8")), 
    7474          array("testnews.php","/2004/05",array()), 
    7575          array("index.php","/test/cms/actualite/65-c-est-la-fete-au-village",array()), 
    7676          array("foo/bar.php","/withhandler/premier/deuxieme",array()), 
    77           array("index.php",'',array('module'=>'unittest', 'action'=>'url5', 'foo'=>'oof',  'bar'=>'rab')), 
     77          array("index.php",'',array('module'=>'unittest', 'action'=>'urlsig_url5', 'foo'=>'oof',  'bar'=>'rab')), 
    7878          array("xmlrpc.php","",array()), 
    79           array("news.php","",array('aaa'=>'bbb','action'=>'bar')) 
     79          array("news.php","",array('aaa'=>'bbb','action'=>'main_bar')) 
    8080       ); 
    8181 
     
    9595      $request=array( 
    9696          array("index","/test/news/2005/10/35",array()), 
    97           array("index","/test/news/2005/10/35",array("action"=>"url8")), 
     97          array("index","/test/news/2005/10/35",array("action"=>"urlsig_url8")), 
    9898          array("testnews","/2004/05",array()), 
    9999          array("index","/test/cms/actualite/65-c-est-la-fete-au-village",array()), 
    100100          array("foo/bar","/withhandler/premier/deuxieme",array()), 
    101           array("index",'',array('module'=>'unittest', 'action'=>'url5', 'foo'=>'oof',  'bar'=>'rab')), 
     101          array("index",'',array('module'=>'unittest', 'action'=>'urlsig_url5', 'foo'=>'oof',  'bar'=>'rab')), 
    102102          array("xmlrpc","",array()), 
    103           array("news","",array('aaa'=>'bbb','action'=>'bar')) 
     103          a