diff options
author | xue <> | 2006-12-01 21:39:16 +0000 |
---|---|---|
committer | xue <> | 2006-12-01 21:39:16 +0000 |
commit | c0239466d7e7142a67f6233169377b10fd93e6ec (patch) | |
tree | f0d5359296a02a739c192f2b82b01553c2cc39fd | |
parent | 5975e2c0f7164ae445242aba0db4793898dc16b6 (diff) |
merge from 3.0 branch till 1537.
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | framework/Exceptions/messages.txt | 2 | ||||
-rw-r--r-- | framework/Web/UI/TTemplateManager.php | 4 | ||||
-rw-r--r-- | framework/Web/UI/TThemeManager.php | 53 | ||||
-rw-r--r-- | tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php | 2 | ||||
-rw-r--r-- | tests/FunctionalTests/tickets/protected/pages/Ticket205.page | 2 | ||||
-rw-r--r-- | tests/FunctionalTests/tickets/protected/pages/Ticket207.page | 2 |
7 files changed, 48 insertions, 19 deletions
@@ -18,11 +18,13 @@ CHG: All validators ClientSide.OnError becomes ClientSide.OnValidationError, and Version 3.0.6 December 4, 2006 ============================== BUG: Ticket#442 - TPageService getBasePath in namespace form (Qiang) +BUG: Ticket#443 - Template comment tag messed up with HTML comment tag (Qiang) BUG: Ticket#467 - typo in TUrlMapping.php (Qiang) BUG: TTableCell should render only when Text is not set and there's no child (Qiang) BUG: global state was not saved when redirect() is invoked (Qiang) BUG: TPager would not display if it was invisible previously (Qiang) ENH: Ticket#446 - Added TMetaTagCollection.getMetaTagByID method (Qiang) +ENH: Ticket#468 - Added support of using all property tags in skins (Qiang) ENH: Ticket#471 - Added methods in TAssetManager to expose published path and URL (Qiang) CHG: Ticket#437 - __autoload is replaced by spl_autoload_register (Qiang) CHG: Ticket#454 - Redundant PHP Version Check (Qiang) diff --git a/framework/Exceptions/messages.txt b/framework/Exceptions/messages.txt index f3032eb3..3afc7c3d 100644 --- a/framework/Exceptions/messages.txt +++ b/framework/Exceptions/messages.txt @@ -125,6 +125,7 @@ template_controlid_invalid = {0}.ID can only accept a static text string. template_controlskinid_invalid = {0}.SkinID can only accept a static text string.
template_content_unexpected = Unexpected content is encountered when instantiating template: {0}.
template_include_invalid = Invalid template inclusion. Make sure {0} is a valid namespace pointing to an existing template file whose extension is .tpl.
+template_tag_unexpected = Initialization for property {0} contains an unknown tag type {1}.
xmldocument_file_read_failed = TXmlDocument is unable to read file '{0}'.
xmldocument_file_write_failed = TXmlDocument is unable to write file '{0}'.
@@ -157,6 +158,7 @@ theme_skinid_duplicated = SkinID '{0}.{1}' is duplicated in theme '{2}'. theme_databind_forbidden = Databind cannot be used in theme '{0}' for control skin '{1}.{2}' about property '{3}'.
theme_property_readonly = Skin is being applied to a read-only control property '{0}.{1}'.
theme_property_undefined = Skin is being applied to an inexistent control property '{0}.{1}'.
+theme_tag_unexpected = Initialization for property {0} contains an unknown tag type {1}.
control_object_reregistered = Duplicated object ID '{0}' found.
control_id_invalid = {0}.ID '{1}' is invalid. Only alphanumeric and underline characters are allowed. The first character must be an alphabetic or underline character.
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index 950f2c70..332ed7ab 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -177,7 +177,7 @@ class TTemplate extends TApplicationComponent implements ITemplate * '<%[%#~\\$=\\[](.*?)%>' - expressions
* '<prop:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/>' - group subproperty tags
*/
- 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';
+ 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';
/**
* Different configurations of component property/event/attribute
@@ -484,6 +484,7 @@ class TTemplate extends TApplicationComponent implements ITemplate $component->$setter(Prado::localize($value[1]));
break;
default: // an error if reaching here
+ throw new TConfigurationException('template_tag_unexpected',$name,$value[1]);
break;
}
}
@@ -529,6 +530,7 @@ class TTemplate extends TApplicationComponent implements ITemplate $component->setSubProperty($name,Prado::localize($value[1]));
break;
default: // an error if reaching here
+ throw new TConfigurationException('template_tag_unexpected',$name,$value[1]);
break;
}
}
diff --git a/framework/Web/UI/TThemeManager.php b/framework/Web/UI/TThemeManager.php index f87f0783..6b3fe53c 100644 --- a/framework/Web/UI/TThemeManager.php +++ b/framework/Web/UI/TThemeManager.php @@ -301,11 +301,13 @@ class TTheme extends TApplicationComponent implements ITheme unset($skin[2]['skinid']);
if(isset($this->_skins[$type][$id]))
throw new TConfigurationException('theme_skinid_duplicated',$type,$id,dirname($themePath));
+ /*
foreach($skin[2] as $name=>$value)
{
if(is_array($value) && ($value[0]===TTemplate::CONFIG_DATABIND || $value[0]===TTemplate::CONFIG_PARAMETER))
throw new TConfigurationException('theme_databind_forbidden',dirname($themePath),$type,$id);
}
+ */
$this->_skins[$type][$id]=$skin[2];
}
}
@@ -363,28 +365,51 @@ class TTheme extends TApplicationComponent implements ITheme Prado::trace("Applying skin $name to $type",'System.Web.UI.TThemeManager');
if(is_array($value))
{
- if($value[0]===TTemplate::CONFIG_EXPRESSION)
- $value=$this->evaluateExpression($value[1]);
- else if($value[0]===TTemplate::CONFIG_ASSET)
- $value=$this->_themeUrl.'/'.ltrim($value[1],'/');
+ switch($value[0])
+ {
+ case TTemplate::CONFIG_EXPRESSION:
+ $value=$this->evaluateExpression($value[1]);
+ break;
+ case TTemplate::CONFIG_ASSET:
+ $value=$this->_themeUrl.'/'.ltrim($value[1],'/');
+ break;
+ case TTemplate::CONFIG_DATABIND:
+ $control->bindProperty($name,$value[1]);
+ break;
+ case TTemplate::CONFIG_PARAMETER:
+ $control->setSubProperty($name,$this->getApplication()->getParameters()->itemAt($value[1]));
+ break;
+ case TTemplate::CONFIG_TEMPLATE:
+ $control->setSubProperty($name,$value[1]);
+ break;
+ case TTemplate::CONFIG_LOCALIZATION:
+ $control->setSubProperty($name,Prado::localize($value[1]));
+ break;
+ default:
+ throw new TConfigurationException('theme_tag_unexpected',$name,$value[0]);
+ break;
+ }
}
- if(strpos($name,'.')===false) // is simple property or custom attribute
+ if(!is_array($value))
{
- if($control->hasProperty($name))
+ if(strpos($name,'.')===false) // is simple property or custom attribute
{
- if($control->canSetProperty($name))
+ if($control->hasProperty($name))
{
- $setter='set'.$name;
- $control->$setter($value);
+ if($control->canSetProperty($name))
+ {
+ $setter='set'.$name;
+ $control->$setter($value);
+ }
+ else
+ throw new TConfigurationException('theme_property_readonly',$type,$name);
}
else
- throw new TConfigurationException('theme_property_readonly',$type,$name);
+ throw new TConfigurationException('theme_property_undefined',$type,$name);
}
- else
- throw new TConfigurationException('theme_property_undefined',$type,$name);
+ else // complex property
+ $control->setSubProperty($name,$value);
}
- else // complex property
- $control->setSubProperty($name,$value);
}
return true;
}
diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php index d20a7955..7336ff8d 100644 --- a/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php @@ -24,9 +24,7 @@ class DataGrid1TestCase extends SeleniumTestCase // verify specific table tags
$this->verifyElementPresent("ctl0_body_DataGrid");
- $this->verifyAttribute("ctl0_body_DataGrid@rules","all");
$this->verifyAttribute("ctl0_body_DataGrid@cellpadding","2");
- $this->verifyAttribute("ctl0_body_DataGrid@cellspacing","0");
}
}
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket205.page b/tests/FunctionalTests/tickets/protected/pages/Ticket205.page index 1481a227..5735b22a 100644 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket205.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket205.page @@ -20,7 +20,7 @@ ControlCssClass="required" OnServerValidate="customValidate" ClientValidationFunction="clientSideCustomValidate" - ClientSide.OnError="alert('error')" + ClientSide.OnValidationError="alert('error')" ErrorMessage="must equal to 'Prado'" /> <com:TButton ID="button1" Text="Submit!" /> </com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket207.page b/tests/FunctionalTests/tickets/protected/pages/Ticket207.page index 556c5aae..594d512b 100644 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket207.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket207.page @@ -6,7 +6,7 @@ id="validator1" ControlToValidate="text1" Text="Error" ClientSide.ObserveChanges="false" - ClientSide.OnError="alert('error on text1 fired')" /> + ClientSide.OnValidationError="alert('error on text1 fired')" /> <br /> <com:TTextBox ID="text2" /><br /> <com:TRequiredFieldValidator id="validator2" ControlToValidate="text2" Text="Error" /> |