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 20 20 ; for junittests module 21 21 enableTests = on 22 22 23 oldActionSelector = on 23 24 24 25 [plugins] 25 26 ;nom = nom_fichier_ini -
lib/jelix-scripts/templates/var/config/defaultconfig.ini.php.tpl
old new 17 17 18 18 theme = default 19 19 20 oldControllerNaming = on 21 20 22 [plugins] 21 23 ;nom = nom_fichier_ini 22 24 -
lib/jelix-modules/jauth/templates/login.form.tpl
old new 4 4 {/if} 5 5 6 6 {if ! $isLogged} 7 {if $GLOBALS['gJConfig']->oldActionSelector == false} 8 <form action="{jurl 'jauth~login:in'}" method="post" id="loginForm"> 9 {else} 7 10 <form action="{jurl 'jauth~login_in'}" method="post" id="loginForm"> 11 {/if} 8 12 <fieldset> 9 13 <table> 10 14 <tr> -
lib/jelix-modules/junittests/templates/main.tpl
old new 13 13 <h2>Tests menu</h2> 14 14 {if count($modules)} 15 15 <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} 16 20 <li><a href="{jurl 'junittests~default_index'}">Home</a></li> 17 21 <li><a href="{jurl 'junittests~default_all'}">Run all tests</a></li> 22 {/if} 18 23 </ul> 19 24 20 25 <h3>Modules</h3> 21 26 <ul> 27 {if $GLOBALS['gJConfig']->oldActionSelector == false} 22 28 {foreach $modules as $module=>$tests} 23 29 <li>{$module} 24 30 <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> 25 42 <li><a href="{jurl 'junittests~default_module', array('mod'=>$module)}">All tests</a></li> 26 43 {foreach $tests as $test} 27 44 <li><a href="{jurl 'junittests~default_single', array('mod'=>$module, 'test'=>$test[1])}">{$test[2]}</a> … … 29 46 </ul> 30 47 </li> 31 48 {/foreach} 49 {/if} 32 50 </ul> 33 51 {else} 34 52 <p>No availabled tests.</p> -
lib/jelix/plugins/urls/significant/jSignificantUrlsCompiler.class.php
old new 133 133 } 134 134 135 135 $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; 138 143 } 139 144 140 145 if(isset($url['actionoverride'])){ 141 146 $actionOverride = preg_split("/[\s,]+/", (string)$url['actionoverride']); 142 147 foreach ($actionOverride as &$each) { 143 if (strpos($each, '_') === false) {144 $each = 'default _'.$each;148 if (strpos($each, $separator) === false) { 149 $each = 'default'.$separator.$each; 145 150 } 146 151 } 147 152 }else{ -
lib/jelix/core/jSelector.class.php
old new 12 12 * @author Laurent Jouanneau 13 13 * @contributor Loic Mathaud 14 14 * @contributor Rahal 15 * @contributor Thibault PIRONT < nuKs > 15 16 * @copyright 2005-2007 Laurent Jouanneau, 2007 Loic Mathaud, 2007 Rahal 17 * @copyright 2007 Thibault PIRONT 16 18 * @link http://www.jelix.org 17 19 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 18 20 */ … … 191 193 */ 192 194 function __construct($request, $module, $action){ 193 195 $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); 195 203 if(count($r) == 1){ 196 204 $this->controller = 'default'; 197 205 $this->method = $r[0]==''?'index':$r[0]; … … 199 207 $this->controller = $r[0]=='' ? 'default':$r[0]; 200 208 $this->method = $r[1]==''?'index':$r[1]; 201 209 } 202 $this->resource = $this->controller. '_'.$this->method;210 $this->resource = $this->controller.$separator.$this->method; 203 211 204 212 $this->request = $request; 205 213 $this->_createPath(); … … 243 251 * Generic Action selector 244 252 * 245 253 * 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). 247 255 * all part are optional, but it should have one part at least. 248 256 * @package jelix 249 257 * @subpackage core_selector … … 269 277 $this->request = $gJCoord->request->type; 270 278 271 279 #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)){ 273 281 $m=array_pad($m,4,''); 274 282 if($m[1]!=''){ 275 283 if($m[1] == '#') … … 283 291 $this->resource = $gJCoord->actionName; 284 292 else 285 293 $this->resource = $m[2]; 294 295 if($GLOBALS['gJConfig']->oldActionSelector == false) 296 $separator = ':'; 297 else 298 $separator = '_'; 299 300 $r = explode($separator,$this->resource); 286 301 287 $r = explode('_',$this->resource);288 289 302 if(count($r) == 1){ 290 303 $this->controller = 'default'; 291 304 $this->method = $r[0]==''?'index':$r[0]; … … 293 306 $this->controller = $r[0]=='' ? 'default':$r[0]; 294 307 $this->method = $r[1]==''?'index':$r[1]; 295 308 } 296 $this->resource = $this->controller. '_'.$this->method;309 $this->resource = $this->controller.$separator.$this->method; 297 310 if($m[3] != '' && $enableRequestPart) 298 311 $this->request = $m[3]; 299 312 else -
lib/jelix/core/jCoordinator.class.php
old new 1 1 <?php 2 2 /** 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 10 11 */ 11 12 12 13 /** … … 178 179 if(empty($this->actionName)){ 179 180 if($this->moduleName == $gJConfig->startModule) 180 181 $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 } 183 188 } 184 189 185 190 // verification du module -
lib/jelix/core/request/jXmlRpcRequest.class.php
old new 4 4 * @subpackage core_request 5 5 * @author Laurent Jouanneau 6 6 * @contributor Frederic Guillot 7 * @contributor Thibault PIRONT < nuKs > 7 8 * @copyright 2005-2006 Laurent Jouanneau, 2007 Frederic Guillot 9 * @copyright 2007 Thibault PIRONT 8 10 * @link http://www.jelix.org 9 11 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 10 12 */ … … 42 44 43 45 // Décodage de la requete 44 46 list($nom,$vars) = jXmlRpc::decodeRequest($requestXml); 45 list($module, $action) = explode(':',$nom );47 list($module, $action) = explode(':',$nom,2); 46 48 47 49 if(count($vars) == 1 && is_array($vars[0])) 48 50 $this->params = $vars[0]; -
lib/jelix/core/request/jCmdLineRequest.class.php
old new 4 4 * @subpackage core_request 5 5 * @author Laurent Jouanneau 6 6 * @contributor Loic Mathaud 7 * @contributor Thibault PIRONT < nuKs > 7 8 * @copyright 2005-2006 Laurent Jouanneau, 2006-2007 Loic Mathaud 9 * @copyright 2007 Thibault PIRONT 8 10 * @link http://www.jelix.org 9 11 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 10 12 */ … … 38 40 } else { 39 41 $argsel = array_shift($argv); // get the module~action selector 40 42 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'; 42 47 } 43 48 if (!preg_match('/(?:([\w\.]+)~)/', $argsel)) { 44 49 $argsel = $gJConfig->startModule.'~'.$argsel; -
lib/jelix/core/jConfigCompiler.class.php
old new 1 1 <?php 2 2 /** 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 10 11 */ 11 12 12 13 /** … … 40 41 die("Syntax error in the Jelix config file $configFile !"); 41 42 } 42 43 $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 } 45 50 46 51 $config->_allBasePath = array(); 47 52 … … 90 95 self::_mergeConfig($config, $userConfig); 91 96 } 92 97 $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 96 105 $config['_allBasePath'] = array(); 97 106 $config['_modulesPathList'] = self::_loadPathList($config['modulesPath'], $config['_allBasePath']); 98 107 -
lib/jelix/core/jUrl.class.php
old new 3 3 * @package jelix 4 4 * @subpackage core_url 5 5 * @author Laurent Jouanneau 6 * @contributor 6 * @contributor Thibault PIRONT < nuKs > 7 7 * @copyright 2005-2006 Laurent Jouanneau 8 * @copyright 2007 Thibault PIRONT 8 9 * 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), 9 10 * Some lines of code are still copyrighted 2001-2005 CopixTeam (LGPL licence). 10 11 * Initial authors of this parts are Gerald Croes and Laurent Jouanneau, … … 206 207 public function toString ($forxml = false){ 207 208 $url = $this->scriptName.$this->pathInfo; 208 209 if (count ($this->params)>0){ 209 $url .='?'. http_build_query($this->params, '', ($forxml?'&':'&'));210 $url .='?'.str_replace( '%3A', ':', http_build_query($this->params, '', ($forxml?'&':'&')) ); 210 211 } 211 212 return $url; 212 213 } … … 225 226 static $url = false; 226 227 if ($url === false){ 227 228 $url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].$GLOBALS['gJCoord']->request->url_path_info.'?'; 228 $url.= http_build_query($_GET, '', ($forxml?'&':'&'));229 $url.= str_replace( '%3A', ':', http_build_query($_GET, '', ($forxml?'&':'&')) ); 229 230 } 230 231 return $url; 231 232 } … … 239 240 */ 240 241 static function appendToUrlString ($url, $params = array (), $forxml = false){ 241 242 if ((($pos = strpos ( $url, '?')) !== false) && ($pos !== (strlen ($url)-1))){ 242 return $url . ($forxml ? '&' : '&'). http_build_query($params, '', ($forxml?'&':'&'));243 return $url . ($forxml ? '&' : '&').str_replace( '%3A', ':', http_build_query($params, '', ($forxml?'&':'&')) ); 243 244 }else{ 244 return $url . '?'. http_build_query($params, '', ($forxml?'&':'&'));245 return $url . '?'.str_replace( '%3A', ':', http_build_query($params, '', ($forxml?'&':'&')) ); 245 246 } 246 247 } 247 248 -
lib/jelix/core/defaultconfig.ini.php
old new 20 20 theme = default 21 21 use_error_handler = on 22 22 23 oldActionSelector = on 23 24 24 25 [plugins] 25 26 -
lib/jelix/controllers/jControllerDaoCrud.class.php
old new 1 1 <?php 2 2 /** 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 10 12 * 11 13 */ 12 14 … … 117 119 */ 118 120 protected function _getAction($method){ 119 121 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; 121 126 } 122 127 123 128 /** -
myapp/var/config/defaultconfig.ini.php
old new 21 21 22 22 theme = default 23 23 24 oldActionSelector = on 25 24 26 [plugins] 25 27 ;nom = nom_fichier_ini 26 28
