Ticket #317: full_patch3.diff

File full_patch3.diff, 17.4 kB (added by nuks, 1 year ago)
  • testapp/var/config/defaultconfig.ini.php

    old new  
    2020; for junittests module 
    2121enableTests = on 
    2222 
     23oldActionSelector = 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-modules/jauth/templates/login.form.tpl

    old new  
    44{/if} 
    55 
    66{if ! $isLogged} 
     7{if $GLOBALS['gJConfig']->oldActionSelector == false} 
     8<form action="{jurl 'jauth~login:in'}" method="post" id="loginForm"> 
     9{else} 
    710<form action="{jurl 'jauth~login_in'}" method="post" id="loginForm"> 
     11{/if} 
    812      <fieldset> 
    913      <table> 
    1014       <tr> 
  • lib/jelix-modules/junittests/templates/main.tpl

    old new  
    1313<h2>Tests menu</h2> 
    1414{if count($modules)} 
    1515    <ul> 
     16        {if $GLOBALS['gJConfig']->oldActionSelector == false} 
     17        <li><a href="{jurl 'junittests~default:index'}">Home</a></li> 
     18        <li><a href="{jurl 'junittests~default:all'}">Run all tests</a></li> 
     19        {else} 
    1620        <li><a href="{jurl 'junittests~default_index'}">Home</a></li> 
    1721        <li><a href="{jurl 'junittests~default_all'}">Run all tests</a></li> 
     22        {/if} 
    1823    </ul> 
    1924 
    2025    <h3>Modules</h3> 
    2126    <ul> 
     27{if $GLOBALS['gJConfig']->oldActionSelector == false} 
    2228    {foreach $modules as $module=>$tests} 
    2329        <li>{$module} 
    2430            <ul> 
     31                <li><a href="{jurl 'junittests~default:module', array('mod'=>$module)}">All tests</a></li> 
     32        {foreach $tests as $test} 
     33                <li><a href="{jurl 'junittests~default:single', array('mod'=>$module, 'test'=>$test[1])}">{$test[2]}</a> 
     34        {/foreach} 
     35            </ul> 
     36        </li> 
     37    {/foreach} 
     38{else} 
     39    {foreach $modules as $module=>$tests} 
     40        <li>{$module} 
     41            <ul> 
    2542                <li><a href="{jurl 'junittests~default_module', array('mod'=>$module)}">All tests</a></li> 
    2643        {foreach $tests as $test} 
    2744                <li><a href="{jurl 'junittests~default_single', array('mod'=>$module, 'test'=>$test[1])}">{$test[2]}</a> 
     
    2946            </ul> 
    3047        </li> 
    3148    {/foreach} 
     49{/if} 
    3250    </ul> 
    3351{else} 
    3452    <p>No availabled tests.</p> 
  • 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']->oldActionSelector == false) 
     137                   $separator = ':'; 
     138               else 
     139                   $separator = '_'; 
     140                
     141               if (strpos($action, $separator) === false) { 
     142                  $action = 'default'.$separator.$action; 
    138143               } 
    139144 
    140145               if(isset($url['actionoverride'])){ 
    141146                  $actionOverride = preg_split("/[\s,]+/", (string)$url['actionoverride']); 
    142147                  foreach ($actionOverride as &$each) { 
    143                      if (strpos($each, '_') === false) { 
    144                         $each = 'default_'.$each; 
     148                     if (strpos($each, $separator) === false) { 
     149                        $each = 'default'.$separator.$each; 
    145150                     } 
    146151                  } 
    147152               }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']->oldActionSelector == 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 or 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] == '#') 
     
    283291                $this->resource = $gJCoord->actionName; 
    284292            else 
    285293                $this->resource = $m[2]; 
     294             
     295            if($GLOBALS['gJConfig']->oldActionSelector == false) 
     296                $separator = ':'; 
     297            else 
     298                $separator = '_'; 
     299             
     300            $r = explode($separator,$this->resource); 
    286301 
    287             $r = explode('_',$this->resource); 
    288  
    289302            if(count($r) == 1){ 
    290303                $this->controller = 'default'; 
    291304                $this->method = $r[0]==''?'index':$r[0]; 
     
    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/jCoordinator.class.php

    old new  
    11<?php 
    22/** 
    3 * @package    jelix 
    4 * @subpackage core 
    5 * @author     Laurent Jouanneau 
    6 * @contributor 
    7 * @copyright  2005-2006 laurent Jouanneau 
    8 * @link       http://www.jelix.org 
    9 * @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     3* @package      jelix 
     4* @subpackage   core 
     5* @author       Laurent Jouanneau 
     6* @contributor  Thibault PIRONT < nuKs > 
     7* @copyright    2005-2006 laurent Jouanneau 
     8* @copyright    2007 Thibault PIRONT 
     9* @link         http://www.jelix.org 
     10* @licence      GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
    1011*/ 
    1112 
    1213/** 
     
    178179        if(empty($this->actionName)){ 
    179180            if($this->moduleName == $gJConfig->startModule) 
    180181                $this->actionName = $gJConfig->startAction; 
    181             else 
    182                 $this->actionName = 'default_index'; 
     182            else { 
     183                if($GLOBALS['gJConfig']->oldActionSelector == false) 
     184                    $this->actionName = 'default:index'; 
     185                else 
     186                    $this->actionName = 'default_index'; 
     187            } 
    183188        } 
    184189 
    185190        // verification du module 
  • lib/jelix/core/request/jXmlRpcRequest.class.php

    old new  
    44* @subpackage  core_request 
    55* @author      Laurent Jouanneau 
    66* @contributor Frederic Guillot 
     7* @contributor Thibault PIRONT < nuKs > 
    78* @copyright   2005-2006 Laurent Jouanneau, 2007 Frederic Guillot 
     9* @copyright   2007 Thibault PIRONT 
    810* @link        http://www.jelix.org 
    911* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
    1012*/ 
     
    4244 
    4345            // Décodage de la requete 
    4446            list($nom,$vars) = jXmlRpc::decodeRequest($requestXml); 
    45             list($module, $action) = explode(':',$nom); 
     47            list($module, $action) = explode(':',$nom,2); 
    4648 
    4749            if(count($vars) == 1 && is_array($vars[0])) 
    4850                $this->params = $vars[0]; 
  • lib/jelix/core/request/jCmdLineRequest.class.php

    old new  
    44* @subpackage  core_request 
    55* @author      Laurent Jouanneau 
    66* @contributor Loic Mathaud 
     7* @contributor Thibault PIRONT < nuKs > 
    78* @copyright   2005-2006 Laurent Jouanneau, 2006-2007 Loic Mathaud 
     9* @copyright   2007 Thibault PIRONT 
    810* @link        http://www.jelix.org 
    911* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
    1012*/ 
     
    3840        } else { 
    3941            $argsel = array_shift($argv); // get the module~action selector 
    4042            if ($argsel == 'help') { 
    41                 $argsel = 'jelix~help_index'; 
     43                if($GLOBALS['gJConfig']->oldActionSelector == false) 
     44                    $argsel = 'jelix~help:index'; 
     45                else 
     46                    $argsel = 'jelix~help_index'; 
    4247            } 
    4348            if (!preg_match('/(?:([\w\.]+)~)/', $argsel)) { 
    4449                $argsel = $gJConfig->startModule.'~'.$argsel; 
  • lib/jelix/core/jConfigCompiler.class.php

    old new  
    11<?php 
    22/** 
    3 * @package  jelix 
    4 * @subpackage core 
    5 * @author   Jouanneau Laurent 
    6 * @contributor 
    7 * @copyright   2006-2007 Jouanneau laurent 
    8 * @link        http://www.jelix.org 
    9 * @licence  GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     3* @package      jelix 
     4* @subpackage   core 
     5* @author       Jouanneau Laurent 
     6* @contributor  Thibault PIRONT < nuKs > 
     7* @copyright    2006-2007 Jouanneau laurent 
     8* @copyright    2007 Thibault PIRONT 
     9* @link         http://www.jelix.org 
     10* @licence      GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
    1011*/ 
    1112 
    1213/** 
     
    4041                die("Syntax error in the Jelix config file $configFile !"); 
    4142        } 
    4243        $config->isWindows = (DIRECTORY_SEPARATOR == '\\'); 
    43         if(trim( $config->startAction) == '') 
    44              $config->startAction = '_'; 
     44        if(trim( $config->startAction) == '') { 
     45            if($GLOBALS['gJConfig']->oldActionSelector == false) 
     46                $config->startAction = ':'; 
     47            else 
     48                $config->startAction = '_'; 
     49       } 
    4550 
    4651        $config->_allBasePath = array(); 
    4752         
     
    9095            self::_mergeConfig($config, $userConfig); 
    9196        } 
    9297        $config['isWindows'] =  (DIRECTORY_SEPARATOR == '\\'); 
    93         if(trim( $config['startAction']) == '') 
    94              $config['startAction'] = '_'; 
    95  
     98        if(trim( $config['startAction']) == '') { 
     99            if($GLOBALS['gJConfig']->oldActionSelector == false) 
     100                $config['startAction'] = ':'; 
     101            else 
     102                $config['startAction'] = '_'; 
     103        } 
     104         
    96105        $config['_allBasePath'] = array(); 
    97106        $config['_modulesPathList'] = self::_loadPathList($config['modulesPath'], $config['_allBasePath']); 
    98107 
  • lib/jelix/core/jUrl.class.php

    old new  
    33* @package     jelix 
    44* @subpackage  core_url 
    55* @author      Laurent Jouanneau 
    6 * @contributor 
     6* @contributor Thibault PIRONT < nuKs > 
    77* @copyright   2005-2006 Laurent Jouanneau 
     8* @copyright   2007 Thibault PIRONT 
    89* Some parts of this file are took from an experimental branch of the Copix project (CopixUrl.class.php, Copix 2.3dev20050901, http://www.copix.org), 
    910* Some lines of code are still copyrighted 2001-2005 CopixTeam (LGPL licence). 
    1011* Initial authors of this parts are Gerald Croes and Laurent Jouanneau, 
     
    206207    public function toString ($forxml = false){ 
    207208        $url = $this->scriptName.$this->pathInfo; 
    208209        if (count ($this->params)>0){ 
    209             $url .='?'.http_build_query($this->params, '', ($forxml?'&amp;':'&')); 
     210            $url .='?'.str_replace( '%3A', ':', http_build_query($this->params, '', ($forxml?'&amp;':'&')) ); 
    210211        } 
    211212        return $url; 
    212213    } 
     
    225226        static $url = false; 
    226227        if ($url === false){ 
    227228           $url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].$GLOBALS['gJCoord']->request->url_path_info.'?'; 
    228            $url.= http_build_query($_GET, '', ($forxml?'&amp;':'&')); 
     229           $url.= str_replace( '%3A', ':', http_build_query($_GET, '', ($forxml?'&amp;':'&')) ); 
    229230        } 
    230231        return $url; 
    231232    } 
     
    239240    */ 
    240241    static function appendToUrlString ($url, $params = array (), $forxml = false){ 
    241242        if ((($pos = strpos ( $url, '?')) !== false) && ($pos !== (strlen ($url)-1))){ 
    242             return $url . ($forxml ? '&amp;' : '&').http_build_query($params, '', ($forxml?'&amp;':'&')); 
     243            return $url . ($forxml ? '&amp;' : '&').str_replace( '%3A', ':', http_build_query($params, '', ($forxml?'&amp;':'&')) ); 
    243244        }else{ 
    244             return $url . '?'.http_build_query($params, '', ($forxml?'&amp;':'&')); 
     245            return $url . '?'.str_replace( '%3A', ':', http_build_query($params, '', ($forxml?'&amp;':'&')) ); 
    245246        } 
    246247    } 
    247248 
  • lib/jelix/core/defaultconfig.ini.php

    old new  
    2020theme = default 
    2121use_error_handler = on 
    2222 
     23oldActionSelector = on 
    2324 
    2425[plugins] 
    2526 
  • lib/jelix/controllers/jControllerDaoCrud.class.php

    old new  
    11<?php 
    22/** 
    3 * @package    jelix 
    4 * @subpackage controllers 
    5 * @author     Laurent Jouanneau 
    6 * @contributor Bastien Jaillot 
    7 * @copyright  2007 Laurent Jouanneau 
    8 * @link        http://www.jelix.org 
    9 * @licence  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     3* @package      jelix 
     4* @subpackage   controllers 
     5* @author       Laurent Jouanneau 
     6* @contributor  Bastien Jaillot 
     7* @contributor  Thibault PIRONT < nuKs > 
     8* @copyright    2007 Laurent Jouanneau 
     9* @copyright    2007 Thibault PIRONT 
     10* @link         http://www.jelix.org 
     11* @licence      http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
    1012* 
    1113*/ 
    1214 
     
    117119     */ 
    118120    protected function _getAction($method){ 
    119121        global $gJCoord; 
    120         return $gJCoord->action->module.'~'.$gJCoord->action->controller.'_'.$method; 
     122        if($GLOBALS['gJConfig']->oldActionSelector == false) 
     123            return $gJCoord->action->module.'~'.$gJCoord->action->controller.':'.$method; 
     124        else 
     125            return $gJCoord->action->module.'~'.$gJCoord->action->controller.'_'.$method; 
    121126    } 
    122127 
    123128    /** 
  • myapp/var/config/defaultconfig.ini.php

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