Ticket #317: full_patch.diff

File full_patch.diff, 6.3 kB (added by nuks, 1 year ago)

True leader !

  • build/manifests/testapp.mn

    old new  
    22  project.xml 
    33  .htaccess 
    44  application.init.php 
    5   INSTALL 
     5  INSTALL.txt 
    66cd testapp/plugins 
    77  .htaccess 
    88cd testapp/responses 
  • testapp/var/config/defaultconfig.ini.php

    old new  
    2020; for junittests module 
    2121enableTests = on 
    2222 
     23oldControllerNaming = on 
    2324 
    2425[plugins] 
    2526;nom = nom_fichier_ini 
  • lib/jelix-scripts/templates/var/config/defaultconfig.ini.php.tpl

    old new  
    1717 
    1818theme = default 
    1919 
     20oldControllerNaming = on 
     21 
    2022[plugins] 
    2123;nom = nom_fichier_ini 
    2224 
  • lib/jelix/plugins/urls/significant/jSignificantUrlsCompiler.class.php

    old new  
    133133               } 
    134134 
    135135               $action = (string)$url['action']; 
    136                if (strpos($action, '_') === false) { 
    137                   $action = 'default_'.$action; 
     136               if($GLOBALS['gJConfig']->oldControllerNaming == false) 
     137               { 
     138                   $action = str_replace('%3A', ':', $action); 
     139                   $separator = ':'; 
    138140               } 
     141               else 
     142                   $separator = '_'; 
     143                
     144               if (strpos($action, $separator) === false) { 
     145                  $action = 'default'.$separator.$action; 
     146               } 
    139147 
    140148               if(isset($url['actionoverride'])){ 
    141149                  $actionOverride = preg_split("/[\s,]+/", (string)$url['actionoverride']); 
    142150                  foreach ($actionOverride as &$each) { 
    143                      if (strpos($each, '_') === false) { 
    144                         $each = 'default_'.$each; 
     151                     if (strpos($each, $separator) === false) 
     152                     { 
     153                        $each = 'default'.$separator.$each; 
    145154                     } 
    146155                  } 
    147156               }else{ 
  • lib/jelix/core/jSelector.class.php

    old new  
    1212* @author      Laurent Jouanneau 
    1313* @contributor Loic Mathaud 
    1414* @contributor Rahal 
     15* @contributor Thibault PIRONT < nuks > 
    1516* @copyright   2005-2007 Laurent Jouanneau, 2007 Loic Mathaud, 2007 Rahal 
     17* @copyright   2007 Thibault PIRONT 
    1618* @link        http://www.jelix.org 
    1719* @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
    1820*/ 
     
    191193     */ 
    192194    function __construct($request, $module, $action){ 
    193195        $this->module = $module; 
    194         $r = explode('_',$action); 
     196         
     197        if($GLOBALS['gJConfig']->oldControllerNaming == false) 
     198            $separator = ':'; 
     199        else 
     200            $separator = '_'; 
     201         
     202        $r = explode($separator,$action); 
    195203        if(count($r) == 1){ 
    196204            $this->controller = 'default'; 
    197205            $this->method = $r[0]==''?'index':$r[0]; 
     
    199207            $this->controller = $r[0]=='' ? 'default':$r[0]; 
    200208            $this->method = $r[1]==''?'index':$r[1]; 
    201209        } 
    202         $this->resource = $this->controller.'_'.$this->method; 
     210        $this->resource = $this->controller.$separator.$this->method; 
    203211 
    204212        $this->request = $request; 
    205213        $this->_createPath(); 
     
    243251 * Generic Action selector 
    244252 * 
    245253 * main syntax: "module~action@requestType". module should be a valid module name or # (#=says to get 
    246  * the module of the current request). action should be an action name (controller_method). 
     254 * the module of the current request). action should be an action name (controller:method). 
    247255 * all part are optional, but it should have one part at least. 
    248256 * @package    jelix 
    249257 * @subpackage core_selector 
     
    269277                $this->request = $gJCoord->request->type; 
    270278 
    271279#else 
    272         if(preg_match("/^(?:([a-zA-Z0-9_\.]+|\#)~)?([a-zA-Z0-9_]+|\#)?(?:@([a-zA-Z0-9_]+))?$/", $sel, $m)){ 
     280        if(preg_match("/^(?:([a-zA-Z0-9_\.]+|\#)~)?([a-zA-Z0-9_:]+|\#)?(?:@([a-zA-Z0-9_]+))?$/", $sel, $m)){ 
    273281            $m=array_pad($m,4,''); 
    274282            if($m[1]!=''){ 
    275283                if($m[1] == '#') 
     
    284292            else 
    285293                $this->resource = $m[2]; 
    286294 
    287             $r = explode('_',$this->resource); 
     295            if($GLOBALS['gJConfig']->oldControllerNaming == false) 
     296                $separator = ':'; 
     297            else 
     298                $separator = '_'; 
     299             
     300            $r = explode($separator,$this->resource); 
    288301 
    289302            if(count($r) == 1){ 
    290303                $this->controller = 'default'; 
     
    293306                $this->controller = $r[0]=='' ? 'default':$r[0]; 
    294307                $this->method = $r[1]==''?'index':$r[1]; 
    295308            } 
    296             $this->resource = $this->controller.'_'.$this->method; 
     309            $this->resource = $this->controller.$separator.$this->method; 
    297310            if($m[3] != '' && $enableRequestPart) 
    298311                $this->request = $m[3]; 
    299312            else 
  • lib/jelix/core/defaultconfig.ini.php

    old new  
    2020theme = default 
    2121use_error_handler = on 
    2222 
     23oldControllerNaming = on 
    2324 
    2425[plugins] 
    2526 
  • myapp/var/config/defaultconfig.ini.php

    old new  
    2121 
    2222theme = default 
    2323 
     24oldControllerNaming = on 
     25 
    2426[plugins] 
    2527;nom = nom_fichier_ini 
    2628 
Download in other formats: Original Format