Changeset 224
- Timestamp:
- 12/24/2005 09:26:35 PM (3 years ago)
- Location:
- trunk/framework/Web
- Files:
-
- 3 modified
-
THttpRequest.php (modified) (2 diffs)
-
UI/THtmlWriter.php (modified) (2 diffs)
-
UI/TTemplateManager.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/framework/Web/THttpRequest.php
r209 r224 336 336 * @param string service parameter 337 337 * @param array GET parameters, null if not needed 338 * @param boolean whether to encode the ampersand in URL, defaults to false. 338 339 * @return string URL 339 340 */ 340 public function constructUrl($serviceID,$serviceParam,$getItems=null )341 public function constructUrl($serviceID,$serviceParam,$getItems=null,$encodeAmpersand=false) 341 342 { 342 343 $url=$this->getApplicationPath(); … … 344 345 if(!empty($serviceParam)) 345 346 $url.=$serviceParam; 347 $amp=$encodeAmpersand?'&':'&'; 346 348 if(is_array($getItems) || $getItems instanceof Traversable) 347 349 { 348 350 foreach($getItems as $name=>$value) 349 $url.= '&'.urlencode($name).'='.urlencode($value);351 $url.=$amp.urlencode($name).'='.urlencode($value); 350 352 } 351 353 if(defined('SID') && SID != '') 352 $url.= '&'.SID;354 $url.=$amp.SID; 353 355 return $url; 354 356 } -
trunk/framework/Web/UI/THtmlWriter.php
r136 r224 114 114 'abbr'=>true, 115 115 'accesskey'=>true, 116 'align'=>false,117 116 'alt'=>true, 118 'autocomplete'=>false,119 117 'axis'=>true, 120 118 'background'=>true, 121 'bgcolor'=>false,122 'border'=>false,123 'bordercolor'=>false,124 'cellpadding'=>false,125 'cellspacing'=>false,126 'checked'=>false,127 119 'class'=>true, 128 'cols'=>false,129 'colspan'=>false,130 120 'content'=>true, 131 'coords'=>false,132 'dir'=>false,133 'disabled'=>false,134 'for'=>false,135 121 'headers'=>true, 136 'height'=>false,137 122 'href'=>true, 138 'id'=>false,139 123 'longdesc'=>true, 140 'maxlength'=>false,141 'multiple'=>false,142 'name'=>false,143 'nowrap'=>false,144 124 'onclick'=>true, 145 125 'onchange'=>true, 146 'readonly'=>false,147 'rel'=>false,148 'rows'=>false,149 'rowspan'=>false,150 'rules'=>false,151 'scope'=>false,152 'selected'=>false,153 'shape'=>false,154 'size'=>false,155 126 'src'=>true, 156 'style'=>false,157 'tabindex'=>false,158 'target'=>false,159 127 'title'=>true, 160 'type'=>false, 161 'usemap'=>false, 162 'valign'=>false, 163 'value'=>true, 164 'vcard_name'=>false, 165 'width'=>false, 166 'wrap'=>false 128 'value'=>true 167 129 ); 168 130 private static $_styleEncode=array( 169 131 'background-image'=>true, 170 'font-family'=>false,171 132 'list-style-image'=>true 172 133 ); … … 199 160 public function addStyleAttribute($name,$value) 200 161 { 201 if(isset(self::$_styleEncode[$name])) 202 $this->_styles[$name]=THttpUtility::htmlEncode($value); 203 else 204 $this->_styles[$name]=$value; 162 $this->_styles[$name]=isset(self::$_styleEncode[$name])?THttpUtility::htmlEncode($value):$value; 205 163 } 206 164 -
trunk/framework/Web/UI/TTemplateManager.php
r212 r224 318 318 protected function configureEvent($component,$name,$value) 319 319 { 320 $value=THttpUtility::htmlDecode($value); 320 321 if(strpos($value,'.')===false) 321 322 $component->attachEventHandler($name,array($component,'TemplateControl.'.$value)); … … 337 338 if(is_array($value)) 338 339 { 340 $v=THttpUtility::htmlDecode($value[1]); 339 341 switch($value[0]) 340 342 { 341 343 case self::CONFIG_DATABIND: 342 $component->bindProperty($name,$v alue[1]);344 $component->bindProperty($name,$v); 343 345 break; 344 346 case self::CONFIG_EXPRESSION: 345 $component->$setter($component->evaluateExpression($v alue[1]));347 $component->$setter($component->evaluateExpression($v)); 346 348 break; 347 349 case self::CONFIG_ASSET: // asset URL 348 $url=$this->_assetManager->publishFilePath($this->_contextPath.'/'.$v alue[1]);350 $url=$this->_assetManager->publishFilePath($this->_contextPath.'/'.$v); 349 351 $component->$setter($url); 350 352 break; 351 353 case self::CONFIG_PARAMETER: // application parameter 352 $component->$setter(Prado::getApplication()->getParameters()->itemAt($v alue[1]));354 $component->$setter(Prado::getApplication()->getParameters()->itemAt($v)); 353 355 break; 354 356 default: // an error if reaching here … … 357 359 } 358 360 else 359 $component->$setter( $value);361 $component->$setter(THttpUtility::htmlDecode($value)); 360 362 } 361 363 else … … 373 375 if(is_array($value)) 374 376 { 377 $v=THttpUtility::htmlDecode($value[1]); 375 378 switch($value[0]) 376 379 { 377 380 case self::CONFIG_DATABIND: // databinding 378 $component->bindProperty($name,$v alue[1]);381 $component->bindProperty($name,$v); 379 382 break; 380 383 case self::CONFIG_EXPRESSION: // expression 381 $component->setSubProperty($name,$component->evaluateExpression($v alue[1]));384 $component->setSubProperty($name,$component->evaluateExpression($v)); 382 385 break; 383 386 case self::CONFIG_ASSET: // asset URL 384 $url=$this->_assetManager->publishFilePath($this->_contextPath.'/'.$v alue[1]);387 $url=$this->_assetManager->publishFilePath($this->_contextPath.'/'.$v); 385 388 $component->setSubProperty($name,$url); 386 389 break; 387 390 case self::CONFIG_PARAMETER: // application parameter 388 $component->setSubProperty($name,Prado::getApplication()->getParameters()->itemAt($v alue[1]));391 $component->setSubProperty($name,Prado::getApplication()->getParameters()->itemAt($v)); 389 392 break; 390 393 default: // an error if reaching here … … 393 396 } 394 397 else 395 $component->setSubProperty($name, $value);398 $component->setSubProperty($name,THttpUtility::htmlDecode($value)); 396 399 } 397 400
