Changeset 1538
- Timestamp:
- 12/01/2006 03:39:16 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 7 modified
-
HISTORY (modified) (2 diffs)
-
framework/Exceptions/messages.txt (modified) (2 diffs)
-
framework/Web/UI/TTemplateManager.php (modified) (3 diffs)
-
framework/Web/UI/TThemeManager.php (modified) (3 diffs)
-
tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php (modified) (1 diff)
-
tests/FunctionalTests/tickets/protected/pages/Ticket205.page (modified) (1 diff)
-
tests/FunctionalTests/tickets/protected/pages/Ticket207.page (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/HISTORY
r1532 r1538 19 19 ============================== 20 20 BUG: Ticket#442 - TPageService getBasePath in namespace form (Qiang) 21 BUG: Ticket#443 - Template comment tag messed up with HTML comment tag (Qiang) 21 22 BUG: Ticket#467 - typo in TUrlMapping.php (Qiang) 22 23 BUG: TTableCell should render only when Text is not set and there's no child (Qiang) … … 24 25 BUG: TPager would not display if it was invisible previously (Qiang) 25 26 ENH: Ticket#446 - Added TMetaTagCollection.getMetaTagByID method (Qiang) 27 ENH: Ticket#468 - Added support of using all property tags in skins (Qiang) 26 28 ENH: Ticket#471 - Added methods in TAssetManager to expose published path and URL (Qiang) 27 29 CHG: Ticket#437 - __autoload is replaced by spl_autoload_register (Qiang) -
trunk/framework/Exceptions/messages.txt
r1504 r1538 126 126 template_content_unexpected = Unexpected content is encountered when instantiating template: {0}. 127 127 template_include_invalid = Invalid template inclusion. Make sure {0} is a valid namespace pointing to an existing template file whose extension is .tpl. 128 template_tag_unexpected = Initialization for property {0} contains an unknown tag type {1}. 128 129 129 130 xmldocument_file_read_failed = TXmlDocument is unable to read file '{0}'. … … 158 159 theme_property_readonly = Skin is being applied to a read-only control property '{0}.{1}'. 159 160 theme_property_undefined = Skin is being applied to an inexistent control property '{0}.{1}'. 161 theme_tag_unexpected = Initialization for property {0} contains an unknown tag type {1}. 160 162 161 163 control_object_reregistered = Duplicated object ID '{0}' found. -
trunk/framework/Web/UI/TTemplateManager.php
r1490 r1538 178 178 * '<prop:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/>' - group subproperty tags 179 179 */ 180 const REGEX_RULES='/<!--.*?--! >|<!--.*?-->|<\/?com:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?")*)\s*%>|<%[%#~\\$=\\[](.*?)%>|<prop:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/>/msS';180 const REGEX_RULES='/<!--.*?--!?>|<\/?com:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?")*)\s*%>|<%[%#~\\$=\\[](.*?)%>|<prop:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/>/msS'; 181 181 182 182 /** … … 485 485 break; 486 486 default: // an error if reaching here 487 throw new TConfigurationException('template_tag_unexpected',$name,$value[1]); 487 488 break; 488 489 } … … 530 531 break; 531 532 default: // an error if reaching here 533 throw new TConfigurationException('template_tag_unexpected',$name,$value[1]); 532 534 break; 533 535 } -
trunk/framework/Web/UI/TThemeManager.php
r1398 r1538 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; -
trunk/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php
r1398 r1538 25 25 // verify specific table tags 26 26 $this->verifyElementPresent("ctl0_body_DataGrid"); 27 $this->verifyAttribute("ctl0_body_DataGrid@rules","all");28 27 $this->verifyAttribute("ctl0_body_DataGrid@cellpadding","2"); 29 $this->verifyAttribute("ctl0_body_DataGrid@cellspacing","0");30 28 } 31 29 } -
trunk/tests/FunctionalTests/tickets/protected/pages/Ticket205.page
r1398 r1538 21 21 OnServerValidate="customValidate" 22 22 ClientValidationFunction="clientSideCustomValidate" 23 ClientSide.On Error="alert('error')"23 ClientSide.OnValidationError="alert('error')" 24 24 ErrorMessage="must equal to 'Prado'" /> 25 25 <com:TButton ID="button1" Text="Submit!" /> -
trunk/tests/FunctionalTests/tickets/protected/pages/Ticket207.page
r1398 r1538 7 7 ControlToValidate="text1" Text="Error" 8 8 ClientSide.ObserveChanges="false" 9 ClientSide.On Error="alert('error on text1 fired')" />9 ClientSide.OnValidationError="alert('error on text1 fired')" /> 10 10 <br /> 11 11 <com:TTextBox ID="text2" /><br />
