Changeset 1196
- Timestamp:
- 12/02/08 16:05:45 (1 month ago)
- Files:
-
- branches/1.0.x/lib/jelix/core-modules/jelix/templates/atom10.tpl (modified) (1 diff)
- branches/1.0.x/lib/jelix/core-modules/jelix/templates/rss20.tpl (modified) (1 diff)
- branches/1.0.x/lib/jelix/core/jCoordinator.class.php (modified) (2 diffs)
- branches/1.0.x/lib/jelix/core/jSelector.class.php (modified) (2 diffs)
- branches/1.0.x/lib/jelix/CREDITS (modified) (2 diffs)
- branches/1.0.x/lib/jelix/forms/jFormsBuilderBase.class.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0.x/lib/jelix/core-modules/jelix/templates/atom10.tpl
r755 r1196 86 86 </entry> 87 87 {/foreach} 88 <!-- fin generee par le response --> 88 {* endtag is generated by the response *} branches/1.0.x/lib/jelix/core-modules/jelix/templates/rss20.tpl
r705 r1196 58 58 59 59 </channel> 60 <!-- fin generee par le response --> 60 {* endtag is generated by the response *} branches/1.0.x/lib/jelix/core/jCoordinator.class.php
r821 r1196 23 23 class jCoordinator { 24 24 25 /**26 * plugin list27 * @var array28 */25 /** 26 * plugin list 27 * @var array 28 */ 29 29 public $plugins=array(); 30 30 … … 280 280 * instancy a response object corresponding to the default response type 281 281 * of the current resquest 282 * @param boolean $originalResponse TRUE to get the original, non overloaded response 282 283 * @return mixed error string or false 283 284 */ 284 public function initDefaultResponseOfRequest(){ 285 global $gJConfig; 285 public function initDefaultResponseOfRequest($originalResponse = false){ 286 if($originalResponse) 287 $responses = &$GLOBALS['gJConfig']->_coreResponses; 288 else 289 $responses = &$GLOBALS['gJConfig']->responses; 286 290 287 291 $type= $this->request->defaultResponseType; 288 292 289 if(!isset($ gJConfig->responses[$type])){293 if(!isset($responses[$type])) 290 294 return jLocale::get('jelix~errors.default.response.type.unknow',array($this->moduleName.'~'.$this->actionName,$type)); 291 } 292 293 $respclass = $gJConfig->responses[$type]; 294 if(file_exists($path=JELIX_LIB_RESPONSE_PATH.$respclass.'.class.php')){ 295 require_once ($path); 296 }elseif(file_exists($path=JELIX_APP_PATH.'responses/'.$respclass.'.class.php')){ 297 require_once ($path); 298 }else{ 299 return jLocale::get('jelix~errors.default.response.not.loaded',array($this->moduleName.'~'.$this->actionName,$type)); 300 } 301 302 $this->response = new $respclass(); 303 304 return false; 295 296 try{ 297 $respclass = $responses[$type]; 298 if($originalResponse) 299 $path = JELIX_LIB_RESPONSE_PATH.$respclass.'.class.php'; 300 else 301 $path = JELIX_APP_PATH.'responses/'.$respclass.'.class.php'; 302 303 if(!file_exists($path)) 304 throw new Exception(); 305 306 require_once($path); 307 308 $this->response = new $respclass(); 309 return false; 310 } 311 catch(Exception $e){ 312 if($originalResponse) 313 return jLocale::get('jelix~errors.default.response.not.loaded',array($this->moduleName.'~'.$this->actionName,$type)); 314 return $this->initDefaultResponseOfRequest(true); 315 } 305 316 } 306 317 branches/1.0.x/lib/jelix/core/jSelector.class.php
r887 r1196 15 15 * @contributor Thibault PIRONT < nuKs > 16 16 * @contributor Julien Issler 17 * @contributor Baptiste Toinot 17 18 * @copyright 2005-2007 Laurent Jouanneau, 2007 Loic Mathaud, 2007 Rahal 18 19 * @copyright 2007 Thibault PIRONT 19 20 * @copyright 2008 Julien Issler 21 * @copyright 2008 Baptiste Toinot 20 22 * @link http://www.jelix.org 21 23 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 520 522 } 521 523 // else check for the original locale file 522 $path = $gJConfig->_modulesPathList[$this->module].' /locales/'.$locale.'/'.$this->resource.$this->_suffix;524 $path = $gJConfig->_modulesPathList[$this->module].'locales/'.$locale.'/'.$this->resource.$this->_suffix; 523 525 if (is_readable ($path)){ 524 526 $this->_where = 'modules/'; branches/1.0.x/lib/jelix/CREDITS
r1177 r1196 86 86 - jDao: autoremove of empty groups in jDaoConditions (#724) 87 87 - jForms: server side check for <input type="url"> doesn't work (#743) 88 - jForms: some controls are selected by default if their values are "0" (#757) 89 - jCoordinator: exception loop when response's constructor fails (#749) 88 90 89 91 Bastien Jaillot (aka bastnic) … … 153 155 - fixed bugs in jDao (#576, #643) 154 156 157 Baptiste Toinot (aka Surfoo) 158 - double / in path for locale selector 159 155 160 Christian Tritten 156 161 - improvements on pagelinks plugin (#340) branches/1.0.x/lib/jelix/forms/jFormsBuilderBase.class.php
r946 r1196 205 205 206 206 if(is_array($value)){ 207 $value = array_map(create_function('$v', 'return (string) $v;'),$value); 207 208 foreach($ctrl->datasource->getDatas() as $v=>$label){ 208 209 echo $span,$attrs,$i,'" value="',htmlspecialchars($v),'"'; 209 if(in_array( $v,$value))210 if(in_array((string) $v,$value,true)) 210 211 echo ' checked="checked"'; 211 212 echo $readonly,$class,$this->_endt,'<label for="',$id,$i,'">',htmlspecialchars($label),'</label></span>'; … … 213 214 } 214 215 }else{ 216 $value = (string) $value; 215 217 foreach($ctrl->datasource->getDatas() as $v=>$label){ 216 218 echo $span,$attrs,$i,'" value="',htmlspecialchars($v),'"'; 217 if( $v== $value)219 if((string) $v === $value) 218 220 echo ' checked="checked"'; 219 221 echo $readonly,$class,$this->_endt,'<label for="',$id,$i,'">',htmlspecialchars($label),'</label></span>'; … … 232 234 $value=''; 233 235 } 236 $value = (string) $value; 234 237 $span ='<span class="jforms-radio jforms-ctl-'.$ctrl->ref.'"><input type="radio"'; 235 238 foreach($ctrl->datasource->getDatas() as $v=>$label){ 236 echo $span,$id,$i,'" value="',htmlspecialchars($v),'"',( $v==$value?' checked="checked"':''),$readonly,$class,$this->_endt;239 echo $span,$id,$i,'" value="',htmlspecialchars($v),'"',((string) $v===$value?' checked="checked"':''),$readonly,$class,$this->_endt; 237 240 echo '<label for="',$this->_name,'_',$ctrl->ref,'_',$i,'">',htmlspecialchars($label),'</label></span>'; 238 241 $i++; … … 248 251 $value=''; 249 252 } 253 $value = (string) $value; 250 254 if (!$ctrl->required) { 251 echo '<option value=""',($value== ''?' selected="selected"':''),'></option>';255 echo '<option value=""',($value===''?' selected="selected"':''),'></option>'; 252 256 } 253 257 foreach($ctrl->datasource->getDatas() as $v=>$label){ 254 echo '<option value="',htmlspecialchars($v),'"',( $v==$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>';258 echo '<option value="',htmlspecialchars($v),'"',((string) $v===$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 255 259 } 256 260 echo '</select>'; … … 265 269 266 270 if(is_array($value)){ 271 $value = array_map(create_function('$v', 'return (string) $v;'),$value); 267 272 foreach($ctrl->datasource->getDatas() as $v=>$label){ 268 echo '<option value="',htmlspecialchars($v),'"',(in_array( $v,$value)?' selected="selected"':''),'>',htmlspecialchars($label),'</option>';273 echo '<option value="',htmlspecialchars($v),'"',(in_array((string) $v,$value,true)?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 269 274 } 270 275 }else{ 276 $value = (string) $value; 271 277 foreach($ctrl->datasource->getDatas() as $v=>$label){ 272 echo '<option value="',htmlspecialchars($v),'"',( $v==$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>';278 echo '<option value="',htmlspecialchars($v),'"',((string) $v===$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 273 279 } 274 280 } … … 283 289 $value =''; 284 290 } 285 291 $value = (string) $value; 286 292 echo '<select',$id,$hint,$class,' size="',$ctrl->size,'">'; 287 293 foreach($ctrl->datasource->getDatas() as $v=>$label){ 288 echo '<option value="',htmlspecialchars($v),'"',( $v==$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>';294 echo '<option value="',htmlspecialchars($v),'"',((string) $v===$value?' selected="selected"':''),'>',htmlspecialchars($label),'</option>'; 289 295 } 290 296 echo '</select>';
