diff options
author | xue <> | 2006-05-05 12:04:18 +0000 |
---|---|---|
committer | xue <> | 2006-05-05 12:04:18 +0000 |
commit | 398455e7b319b52667558a62b8760aebb3a33ed8 (patch) | |
tree | 50bae38122627eecb4f803267d1b7bd13a99a866 | |
parent | 46e634f33637dea65f9184b8a07fe7b44a860f45 (diff) |
undo changeset #1010.
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | framework/Web/UI/TTemplateManager.php | 21 |
2 files changed, 15 insertions, 9 deletions
@@ -3,9 +3,8 @@ Version 3.0.1 June 1, 2006 ENH: Ticket#150 - TDataGrid and TDataList now render table section tags (Qiang)
ENH: Ticket#152 - constituent parts of TWizard are exposed (Qiang)
ENH: added sanity check to calling event handlers (Qiang)
-CHG: Ticket#153 - TAssetManager now ignores .svn directories (Qiang)
-CHG: Ticket#154 - HTML comments are now parsed as regular template strings (Qiang)
CHG: Ticket#151 - URL format is modified to handle empty GET values (Qiang)
+CHG: Ticket#153 - TAssetManager now ignores .svn directories (Qiang)
CHG: Renamed TValidatorClientScript to TClientSideValidatorOptions, TValidationSummaryClientScript to TClientSideValidationSummaryOptions (wei)
NEW: TTableHeaderRow, TTableFooterRow and table section support (Qiang)
NEW: TCompositeControl (Qiang)
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index ee38405b..0ea80b7e 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -127,7 +127,9 @@ class TTemplateManager extends TModule * - directive: directive specifies the property values for the template owner.
* It is in the format of <% property name-value pairs %>
* - expressions: They are in the formate of <= PHP expression > and <% PHP statements >
- * - comments: Special template comments enclosed within <!-- comments --!> will be stripped out.
+ * - comments: There are two kinds of comments, regular HTML comments and special template comments.
+ * The former is in the format of <!-- comments -->, which will be treated as text strings.
+ * The latter is in the format of <%* comments %>, which will be stripped out.
*
* Tags other than the above are not required to be well-formed.
*
@@ -145,12 +147,13 @@ class TTemplate extends TApplicationComponent implements ITemplate {
/**
* '<!--.*?--!>' - template comments
+ * '<!--.*?-->' - HTML comments
* '<\/?com:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/?>' - component tags
* '<\/?prop:([\w\.]+)\s*>' - property tags
* '<%@\s*((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?")*)\s*%>' - directives
* '<%[%#~\\$=\\[](.*?)%>' - expressions
*/
- const REGEX_RULES='/<!--.*?--!>|<\/?com:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?")*)\s*%>|<%[%#~\\$=\\[](.*?)%>/msS';
+ const REGEX_RULES='/<!--.*?--!>|<!--.*?-->|<\/?com:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?")*)\s*%>|<%[%#~\\$=\\[](.*?)%>/msS';
/**
* Different configurations of component property/event/attribute
@@ -640,11 +643,15 @@ class TTemplate extends TApplicationComponent implements ITemplate }
else if(strpos($str,'<!--')===0) // comments
{
- if($expectPropEnd)
- throw new TConfigurationException('template_comments_forbidden');
- if($matchStart>$textStart)
- $tpl[$c++]=array($container,substr($input,$textStart,$matchStart-$textStart));
- $textStart=$matchEnd+1;
+ if(strrpos($str,'--!>')===strlen($str)-4) // template comments
+ {
+ if($expectPropEnd)
+ throw new TConfigurationException('template_comments_forbidden');
+ if($matchStart>$textStart)
+ $tpl[$c++]=array($container,substr($input,$textStart,$matchStart-$textStart));
+ $textStart=$matchEnd+1;
+ }
+ // else, HTML comments and we do nothing
}
else
throw new TConfigurationException('template_matching_unexpected',$match);
|