Ticket #317: patch_without_defaultaction_feature.diff
| File patch_without_defaultaction_feature.diff, 6.0 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 137 /* 138 Implémenté dans jSelector.class.php 139 */ 140 /* 141 if($GLOBALS['gJConfig']->oldControllerNaming == false) 142 $separator = ':'; 143 else 144 $separator = '_'; 145 146 if (strpos($action, $separator) === false) { 147 $action = 'default'.$separator.$action; 138 148 } 149 */ 139 150 140 151 if(isset($url['actionoverride'])){ 141 152 $actionOverride = preg_split("/[\s,]+/", (string)$url['actionoverride']); 153 /* 142 154 foreach ($actionOverride as &$each) { 143 if (strpos($each, '_') === false) {144 $each = 'default _'.$each;155 if (strpos($each, $separator) === false) { 156 $each = 'default'.$separator.$each; 145 157 } 146 158 } 159 */ 147 160 }else{ 148 161 $actionOverride = false; 149 162 } -
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(); … … 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
