Changeset 1536
- Timestamp:
- 12/01/2006 01:51:21 PM (2 years ago)
- Location:
- branches/3.0
- Files:
-
- 4 modified
-
HISTORY (modified) (1 diff)
-
framework/Exceptions/messages.txt (modified) (2 diffs)
-
framework/Web/UI/TTemplateManager.php (modified) (2 diffs)
-
framework/Web/UI/TThemeManager.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/HISTORY
r1535 r1536 8 8 BUG: TPager would not display if it was invisible previously (Qiang) 9 9 ENH: Ticket#446 - Added TMetaTagCollection.getMetaTagByID method (Qiang) 10 ENH: Ticket#468 - Added support of using all property tags in skins (Qiang) 10 11 ENH: Ticket#471 - Added methods in TAssetManager to expose published path and URL (Qiang) 11 12 CHG: Ticket#437 - __autoload is replaced by spl_autoload_register (Qiang) -
branches/3.0/framework/Exceptions/messages.txt
r1403 r1536 125 125 template_content_unexpected = Unexpected content is encountered when instantiating template: {0}. 126 126 template_include_invalid = Invalid template inclusion. Make sure {0} is a valid namespace pointing to an existing template file whose extension is .tpl. 127 template_tag_unexpected = Initialization for property {0} contains an unknown tag type {1}. 127 128 128 129 xmldocument_file_read_failed = TXmlDocument is unable to read file '{0}'. … … 157 158 theme_property_readonly = Skin is being applied to a read-only control property '{0}.{1}'. 158 159 theme_property_undefined = Skin is being applied to an inexistent control property '{0}.{1}'. 160 theme_tag_unexpected = Initialization for property {0} contains an unknown tag type {1}. 159 161 160 162 control_object_reregistered = Duplicated object ID '{0}' found. -
branches/3.0/framework/Web/UI/TTemplateManager.php
r1535 r1536 458 458 break; 459 459 default: // an error if reaching here 460 throw new TConfigurationException('template_tag_unexpected',$name,$value[1]); 460 461 break; 461 462 } … … 503 504 break; 504 505 default: // an error if reaching here 506 throw new TConfigurationException('template_tag_unexpected',$name,$value[1]); 505 507 break; 506 508 } -
branches/3.0/framework/Web/UI/TThemeManager.php
r1397 r1536 302 302 if(isset($this->_skins[$type][$id])) 303 303 throw new TConfigurationException('theme_skinid_duplicated',$type,$id,dirname($themePath)); 304 /* 304 305 foreach($skin[2] as $name=>$value) 305 306 { … … 307 308 throw new TConfigurationException('theme_databind_forbidden',dirname($themePath),$type,$id); 308 309 } 310 */ 309 311 $this->_skins[$type][$id]=$skin[2]; 310 312 } … … 364 366 if(is_array($value)) 365 367 { 366 if($value[0]===TTemplate::CONFIG_EXPRESSION) 367 $value=$this->evaluateExpression($value[1]); 368 else if($value[0]===TTemplate::CONFIG_ASSET) 369 $value=$this->_themeUrl.'/'.ltrim($value[1],'/'); 368 switch($value[0]) 369 { 370 case TTemplate::CONFIG_EXPRESSION: 371 $value=$this->evaluateExpression($value[1]); 372 break; 373 case TTemplate::CONFIG_ASSET: 374 $value=$this->_themeUrl.'/'.ltrim($value[1],'/'); 375 break; 376 case TTemplate::CONFIG_DATABIND: 377 $control->bindProperty($name,$value[1]); 378 break; 379 case TTemplate::CONFIG_PARAMETER: 380 $control->setSubProperty($name,$this->getApplication()->getParameters()->itemAt($value[1])); 381 break; 382 case TTemplate::CONFIG_TEMPLATE: 383 $control->setSubProperty($name,$value[1]); 384 break; 385 case TTemplate::CONFIG_LOCALIZATION: 386 $control->setSubProperty($name,Prado::localize($value[1])); 387 break; 388 default: 389 throw new TConfigurationException('theme_tag_unexpected',$name,$value[0]); 390 break; 391 } 370 392 } 371 if( strpos($name,'.')===false) // is simple property or custom attribute393 if(!is_array($value)) 372 394 { 373 if( $control->hasProperty($name))395 if(strpos($name,'.')===false) // is simple property or custom attribute 374 396 { 375 if($control-> canSetProperty($name))397 if($control->hasProperty($name)) 376 398 { 377 $setter='set'.$name; 378 $control->$setter($value); 399 if($control->canSetProperty($name)) 400 { 401 $setter='set'.$name; 402 $control->$setter($value); 403 } 404 else 405 throw new TConfigurationException('theme_property_readonly',$type,$name); 379 406 } 380 407 else 381 throw new TConfigurationException('theme_property_ readonly',$type,$name);408 throw new TConfigurationException('theme_property_undefined',$type,$name); 382 409 } 383 else 384 throw new TConfigurationException('theme_property_undefined',$type,$name);410 else // complex property 411 $control->setSubProperty($name,$value); 385 412 } 386 else // complex property387 $control->setSubProperty($name,$value);388 413 } 389 414 return true;
