summaryrefslogtreecommitdiff
path: root/demos/blog-tutorial/protected/pages/Day3
diff options
context:
space:
mode:
authorxue <>2007-05-28 00:58:40 +0000
committerxue <>2007-05-28 00:58:40 +0000
commit82a351192f38cc73268ea7de7a48e2e0425d5cbf (patch)
tree2d91629f8e5c48bb1e26aef8f420d0e95b4f2bb9 /demos/blog-tutorial/protected/pages/Day3
parent87b0b5735f95afb8a59124e3007bd6e6d95d3e48 (diff)
Fixed a bug when using renderer in TWizard's sidebar.
Diffstat (limited to 'demos/blog-tutorial/protected/pages/Day3')
-rw-r--r--demos/blog-tutorial/protected/pages/Day3/CreateAdminUser.page13
-rw-r--r--demos/blog-tutorial/protected/pages/Day3/CreateEditUser.page6
-rw-r--r--demos/blog-tutorial/protected/pages/Day3/CreateLoginUser.page16
-rw-r--r--demos/blog-tutorial/protected/pages/Day3/CreateNewUser.page14
4 files changed, 32 insertions, 17 deletions
diff --git a/demos/blog-tutorial/protected/pages/Day3/CreateAdminUser.page b/demos/blog-tutorial/protected/pages/Day3/CreateAdminUser.page
index 95d7dac5..a91895a9 100644
--- a/demos/blog-tutorial/protected/pages/Day3/CreateAdminUser.page
+++ b/demos/blog-tutorial/protected/pages/Day3/CreateAdminUser.page
@@ -16,6 +16,9 @@ We will display the user list in a table. Each row of the table represents a sin
<li>Command - displays a column of "Delete" buttons. Clicking on any of them will lead to deletion of the corresponding user account.</li>
</ul>
+<p>
+We create two files <tt>protected/pages/users/AdminUser.page</tt> and <tt>protected/pages/users/AdminUser.php</tt> to save the page template and page class, respectively.
+</p>
<h2>Creating Page Template</h2>
<p>
@@ -28,13 +31,13 @@ We use <a href="http://www.pradosoft.com/demos/quickstart/?page=Controls.DataGri
<li><a href="http://www.pradosoft.com/docs/classdoc/TButtonColumn">TButtonColumn</a> displays a column of "Delete" buttons.</li>
</ul>
-<p>Complete page template is shown as follows:</p>
+<p>The complete page template is shown as follows:</p>
<com:TTextHighlighter CssClass="source" Language="prado">
&lt;%@ Title="My Blog - Manage User Accounts" %>
&lt;com:TContent ID="Main">
-
+
<h1>Manage User Accounts</h1>
<a href="&lt;%= $this->Service->constructUrl('users.NewUser')%>">Create New User</a>
@@ -57,14 +60,14 @@ We use <a href="http://www.pradosoft.com/demos/quickstart/?page=Controls.DataGri
&lt;com:TBoundColumn
HeaderText="Email"
DataField="email" />
-
+
&lt;com:TCheckBoxColumn
HeaderText="Administrator"
DataField="role" />
-
+
&lt;com:TButtonColumn
HeaderText="Command"
- Text="Delete"
+ Text="Delete"
ButtonType="PushButton"
CommandName="delete" />
diff --git a/demos/blog-tutorial/protected/pages/Day3/CreateEditUser.page b/demos/blog-tutorial/protected/pages/Day3/CreateEditUser.page
index 055ea62b..c2e2db86 100644
--- a/demos/blog-tutorial/protected/pages/Day3/CreateEditUser.page
+++ b/demos/blog-tutorial/protected/pages/Day3/CreateEditUser.page
@@ -15,6 +15,10 @@ To determine which user account is to be editted, we use the following policy:
<li>If the current user is a normal user, he can only edit his own account information, and he cannot modify his role data.</li>
</ul>
+<p>
+We create two files <tt>protected/pages/users/EditUser.page</tt> and <tt>protected/pages/users/EditUser.php</tt> to save the page template and page class, respectively.
+</p>
+
<h2>Creating Page Template</h2>
<p>
As you may have guessed, the page template <tt>EditUser</tt> is largely the same as that of <tt>NewUser</tt>. Besides the difference in page title and the caption of the submit button, there are three main differences.
@@ -30,7 +34,7 @@ As you may have guessed, the page template <tt>EditUser</tt> is largely the same
&lt;%@ Title="My Blog - Edit User" %>
&lt;com:TContent ID="Main">
-
+
<h1>Edit User</h1>
<span>Username:</span>
diff --git a/demos/blog-tutorial/protected/pages/Day3/CreateLoginUser.page b/demos/blog-tutorial/protected/pages/Day3/CreateLoginUser.page
index d54fc967..6d7967d4 100644
--- a/demos/blog-tutorial/protected/pages/Day3/CreateLoginUser.page
+++ b/demos/blog-tutorial/protected/pages/Day3/CreateLoginUser.page
@@ -16,23 +16,27 @@ The workflow of <tt>LoginUser</tt> is very similar to the <a href="?page=Day1.Cr
<li>If the user enters correct username and password, the system assigns him a valid identity and redirects his browser to the desired privileged page; If not, a "password invalid" message is displayed.
</ol>
+<p>
+We create two files <tt>protected/pages/users/LoginUser.page</tt> and <tt>protected/pages/users/LoginUser.php</tt> to save the page template and page class, respectively.
+</p>
+
<h2>Creating Page Template</h2>
<p>
-Below we show the template for <tt>LoginPage</tt>. As we see, the page mainly contains a text box for collecting username and a text box for password. The username input is required, which is ensured by the <tt>TRequiredFieldValidator</tt>. The correctness of the password input is ensured by the <a href="http://www.pradosoft.com/demos/quickstart/index.php?page=Controls.Validation">TCustomValidator</a> which invokes the page's <tt>validateUser()</tt> method when validation is performed. The page also has "login" button which invokes the page's <tt>loginButtonClicked()</tt> when it is clicked.
+Below we show the template for <tt>LoginUser</tt>. As we see, the page mainly contains a text box for collecting username and a text box for password. The username input is required, which is ensured by the <tt>TRequiredFieldValidator</tt>. The correctness of the password input is ensured by the <a href="http://www.pradosoft.com/demos/quickstart/index.php?page=Controls.Validation">TCustomValidator</a> which invokes the page's <tt>validateUser()</tt> method when validation is performed. The page also has "login" button which invokes the page's <tt>loginButtonClicked()</tt> when it is clicked.
</p>
<com:TTextHighlighter CssClass="source" Language="prado">
&lt;%@ Title="My Blog - Login" %>
&lt;com:TContent ID="Main">
-
+
<h1>Login</h1>
<span>Username:</span>
-&lt;com:TRequiredFieldValidator
+&lt;com:TRequiredFieldValidator
ControlToValidate="Username"
- ErrorMessage="Please provide your username."
+ ErrorMessage="Please provide your username."
Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Username" />
@@ -116,11 +120,11 @@ We modify the footer section of the <tt>MainLayout</tt>'s template as follows. T
<com:TTextHighlighter CssClass="source" Language="prado">
<div id="footer">
-&lt;com:THyperLink Text="Login"
+&lt;com:THyperLink Text="Login"
NavigateUrl="&lt;%= $this->Service->constructUrl('users.LoginUser') %>"
Visible="&lt;%= $this->User->IsGuest %>" />
-&lt;com:TLinkButton Text="Logout"
+&lt;com:TLinkButton Text="Logout"
OnClick="logoutButtonClicked"
Visible="&lt;%= !$this->User->IsGuest %>" />
diff --git a/demos/blog-tutorial/protected/pages/Day3/CreateNewUser.page b/demos/blog-tutorial/protected/pages/Day3/CreateNewUser.page
index 77b97f7d..86da70d1 100644
--- a/demos/blog-tutorial/protected/pages/Day3/CreateNewUser.page
+++ b/demos/blog-tutorial/protected/pages/Day3/CreateNewUser.page
@@ -15,6 +15,10 @@ The <tt>NewUser</tt> page is provided to the administrator user to create new a
<li><tt>last_name</tt> - string, optional</li>
</ul>
+<p>
+We create two files <tt>protected/pages/users/NewUser.page</tt> and <tt>protected/pages/users/NewUser.php</tt> to save the page template and page class, respectively.
+</p>
+
<h2>Creating Page Template</h2>
<p>
Based on the above analysis, we write the page template as follows:
@@ -24,13 +28,13 @@ Based on the above analysis, we write the page template as follows:
&lt;%@ Title="My Blog - New User" %>
&lt;com:TContent ID="Main">
-
+
<h1>Create New User</h1>
<span>Username:</span>
-&lt;com:TRequiredFieldValidator
+&lt;com:TRequiredFieldValidator
ControlToValidate="Username"
- ErrorMessage="Please provide a username."
+ ErrorMessage="Please provide a username."
Display="Dynamic" />
&lt;com:TCustomValidator
ControlToValidate="Username"
@@ -42,9 +46,9 @@ Based on the above analysis, we write the page template as follows:
<br/>
<span>Password:</span>
-&lt;com:TRequiredFieldValidator
+&lt;com:TRequiredFieldValidator
ControlToValidate="Password"
- ErrorMessage="Please provide a password."
+ ErrorMessage="Please provide a password."
Display="Dynamic" />
<br/>
&lt;com:TTextBox ID="Password" TextMode="Password" />