Ticket #317: full_patch.diff
| File full_patch.diff, 6.3 kB (added by nuks, 1 year ago) |
|---|
-
build/manifests/testapp.mn
old new 2 2 project.xml 3 3 .htaccess 4 4 application.init.php 5 INSTALL 5 INSTALL.txt 6 6 cd testapp/plugins 7 7 .htaccess 8 8 cd testapp/responses -
testapp/var/config/defaultconfig.ini.php
old new 20 20 ; for junittests module 21 21 enableTests = on 22 22 23 oldControllerNaming = 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/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']->oldControllerNaming == false) 137 { 138 $action = str_replace('%3A', ':', $action); 139 $separator = ':'; 138 140 } 141 else 142 $separator = '_'; 143 144 if (strpos($action, $separator) === false) { 145 $action = 'default'.$separator.$action; 146 } 139 147 140 148 if(isset($url['actionoverride'])){ 141 149 $actionOverride = preg_split("/[\s,]+/", (string)$url['actionoverride']); 142 150 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; 145 154 } 146 155 } 147 156 }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']->oldControllerNaming == 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). 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] == '#') … … 284 292 else 285 293 $this->resource = $m[2]; 286 294 287 $r = explode('_',$this->resource); 295 if($GLOBALS['gJConfig']->oldControllerNaming == false) 296 $separator = ':'; 297 else 298 $separator = '_'; 299 300 $r = explode($separator,$this->resource); 288 301 289 302 if(count($r) == 1){ 290 303 $this->controller = 'default'; … … 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/defaultconfig.ini.php
old new 20 20 theme = default 21 21 use_error_handler = on 22 22 23 oldControllerNaming = on 23 24 24 25 [plugins] 25 26 -
myapp/var/config/defaultconfig.ini.php
old new 21 21 22 22 theme = default 23 23 24 oldControllerNaming = on 25 24 26 [plugins] 25 27 ;nom = nom_fichier_ini 26 28
