diff options
Diffstat (limited to 'demos/blog-tutorial/protected/pages/Day3')
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">
<%@ Title="My Blog - Manage User Accounts" %>
<com:TContent ID="Main">
-
+
<h1>Manage User Accounts</h1>
<a href="<%= $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 <com:TBoundColumn
HeaderText="Email"
DataField="email" />
-
+
<com:TCheckBoxColumn
HeaderText="Administrator"
DataField="role" />
-
+
<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 <%@ Title="My Blog - Edit User" %>
<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">
<%@ Title="My Blog - Login" %>
<com:TContent ID="Main">
-
+
<h1>Login</h1>
<span>Username:</span>
-<com:TRequiredFieldValidator
+<com:TRequiredFieldValidator
ControlToValidate="Username"
- ErrorMessage="Please provide your username."
+ ErrorMessage="Please provide your username."
Display="Dynamic" />
<br/>
<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">
-<com:THyperLink Text="Login"
+<com:THyperLink Text="Login"
NavigateUrl="<%= $this->Service->constructUrl('users.LoginUser') %>"
Visible="<%= $this->User->IsGuest %>" />
-<com:TLinkButton Text="Logout"
+<com:TLinkButton Text="Logout"
OnClick="logoutButtonClicked"
Visible="<%= !$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: <%@ Title="My Blog - New User" %>
<com:TContent ID="Main">
-
+
<h1>Create New User</h1>
<span>Username:</span>
-<com:TRequiredFieldValidator
+<com:TRequiredFieldValidator
ControlToValidate="Username"
- ErrorMessage="Please provide a username."
+ ErrorMessage="Please provide a username."
Display="Dynamic" />
<com:TCustomValidator
ControlToValidate="Username"
@@ -42,9 +46,9 @@ Based on the above analysis, we write the page template as follows: <br/>
<span>Password:</span>
-<com:TRequiredFieldValidator
+<com:TRequiredFieldValidator
ControlToValidate="Password"
- ErrorMessage="Please provide a password."
+ ErrorMessage="Please provide a password."
Display="Dynamic" />
<br/>
<com:TTextBox ID="Password" TextMode="Password" />
|