From 7fa7f25806e92fe0c4f9c647d413a4fa58680e59 Mon Sep 17 00:00:00 2001
From: xue <>
Date: Mon, 24 Sep 2007 16:03:13 +0000
Subject: added TConditional.
---
.gitattributes | 4 +
HISTORY | 1 +
.../protected/pages/Controls/Conditional.page | 39 ++++++
.../pages/Controls/Samples/TConditional/Home.page | 14 ++
.../pages/Controls/Samples/TConditional/Home.php | 7 +
.../protected/pages/Controls/Standard.page | 6 +-
.../pages/GettingStarted/NewFeatures.page | 1 +
framework/Exceptions/messages/messages.txt | 4 +-
framework/Web/UI/WebControls/TConditional.php | 142 +++++++++++++++++++++
9 files changed, 216 insertions(+), 2 deletions(-)
create mode 100644 demos/quickstart/protected/pages/Controls/Conditional.page
create mode 100644 demos/quickstart/protected/pages/Controls/Samples/TConditional/Home.page
create mode 100644 demos/quickstart/protected/pages/Controls/Samples/TConditional/Home.php
create mode 100644 framework/Web/UI/WebControls/TConditional.php
diff --git a/.gitattributes b/.gitattributes
index d8bbf559..38b0147b 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1334,6 +1334,7 @@ demos/quickstart/protected/pages/Controls/CheckBox.page -text
demos/quickstart/protected/pages/Controls/ClientScript.page -text
demos/quickstart/protected/pages/Controls/ClientScriptLoader.page -text
demos/quickstart/protected/pages/Controls/ColorPicker.page -text
+demos/quickstart/protected/pages/Controls/Conditional.page -text
demos/quickstart/protected/pages/Controls/Data.page -text
demos/quickstart/protected/pages/Controls/DataGrid.page -text
demos/quickstart/protected/pages/Controls/DataList.page -text
@@ -1387,6 +1388,8 @@ demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page
demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.php -text
demos/quickstart/protected/pages/Controls/Samples/TCompareValidator/Home.page -text
demos/quickstart/protected/pages/Controls/Samples/TCompareValidator/Home.php -text
+demos/quickstart/protected/pages/Controls/Samples/TConditional/Home.page -text
+demos/quickstart/protected/pages/Controls/Samples/TConditional/Home.php -text
demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.page -text
demos/quickstart/protected/pages/Controls/Samples/TCustomValidator/Home.php -text
demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample1.page -text
@@ -2526,6 +2529,7 @@ framework/Web/UI/WebControls/TClientScript.php -text
framework/Web/UI/WebControls/TClientScriptLoader.php -text
framework/Web/UI/WebControls/TColorPicker.php -text
framework/Web/UI/WebControls/TCompareValidator.php -text
+framework/Web/UI/WebControls/TConditional.php -text
framework/Web/UI/WebControls/TContent.php -text
framework/Web/UI/WebControls/TContentPlaceHolder.php -text
framework/Web/UI/WebControls/TCustomValidator.php -text
diff --git a/HISTORY b/HISTORY
index 647c6dbb..c2dd9b6a 100644
--- a/HISTORY
+++ b/HISTORY
@@ -32,6 +32,7 @@ NEW: Added TKeyboard (Qiang)
NEW: Added TCaptcha and TCaptchaValidator (Qiang)
NEW: Added TCachePageStatePersister (Qiang)
NEW: Added TSlider (Christophe)
+NEW: Added TConditional (Qiang)
NEW: Added Indonesian translation to QuickStart, requirements and error messages (Zaenal Mutaqin)
NEW: Added French translation to the blog tutorial (Eric Marchetti)
diff --git a/demos/quickstart/protected/pages/Controls/Conditional.page b/demos/quickstart/protected/pages/Controls/Conditional.page
new file mode 100644
index 00000000..e8ea4a65
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Conditional.page
@@ -0,0 +1,39 @@
+
+TConditional displays appropriate content based on the evaluation result
+of a PHP expression specified via Condition.
+If the result is true, it instantiates the template TrueTemplate;
+otherwise, the template FalseTemplate is instantiated.
+The PHP expression is evaluated right before the onInit stage of the control lifecycle.
+
+Since TConditional evaluates Condition at a very early stage, it is recommended
+you set Condition in template only and the expression should not refer to
+objects that are available on or after the onInit lifecycle.
+
+TConditional is very light. It instantiates either TrueTemplate
+FalseTemplate, but never both. And the condition is evaluated only once.
+A typical usage of TConditional is shown as following:
+TConditional
+TConditional Samples
+
+
+ *
+ *
+ * Login
+ *
+ *
+ * Logout
+ *
+ *
+ *
+ *
+ * TConditional is very light. It instantiates either {@link getTrueTemplate TrueTemplate}
+ * or {@link getFalseTemplate FalseTemplate}, but never both. And the condition is evaluated only once.
+ *
+ * @author Qiang Xue