git-svn-id: https://svn.salfter.gotdns.org/svn/compmgmt/trunk@168 1b90f75b-8b96-4784-87c0-14078182fce6
This commit is contained in:
@@ -27,7 +27,9 @@
|
|||||||
|
|
||||||
<!-- configuration for available services -->
|
<!-- configuration for available services -->
|
||||||
<services>
|
<services>
|
||||||
<service id="page" class="TPageService" DefaultPage="Home" />
|
<service id="page" class="TPageService" DefaultPage="Home">
|
||||||
|
<pages MasterClass="Application.layouts.MainLayout" />
|
||||||
|
</service>
|
||||||
</services>
|
</services>
|
||||||
|
|
||||||
<!-- application parameters
|
<!-- application parameters
|
||||||
|
|||||||
5
protected/layouts/MainLayout.php
Normal file
5
protected/layouts/MainLayout.php
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
class MainLayout extends TTemplateControl
|
||||||
|
{
|
||||||
|
}
|
||||||
|
?>
|
||||||
22
protected/layouts/MainLayout.tpl
Normal file
22
protected/layouts/MainLayout.tpl
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<html>
|
||||||
|
<com:THead />
|
||||||
|
<body>
|
||||||
|
<com:TForm>
|
||||||
|
<div id="page">
|
||||||
|
|
||||||
|
<div id="header">
|
||||||
|
<h1>My PRADO Blog</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="main">
|
||||||
|
<com:TContentPlaceHolder ID="Main" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="footer">
|
||||||
|
<%= PRADO::poweredByPrado() %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</com:TForm>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
37
protected/pages/Contact.page
Normal file
37
protected/pages/Contact.page
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<com:TContent ID="Main">
|
||||||
|
|
||||||
|
<h1>Contact</h1>
|
||||||
|
<p>Please fill out the following form to let me know your feedback on my blog. Thanks!</p>
|
||||||
|
|
||||||
|
<span>Your Name:</span>
|
||||||
|
<com:TRequiredFieldValidator ControlToValidate="Name"
|
||||||
|
ErrorMessage="Please provide your name."
|
||||||
|
Display="Dynamic" />
|
||||||
|
<br/>
|
||||||
|
<com:TTextBox ID="Name" />
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<span>Your Email:</span>
|
||||||
|
<com:TRequiredFieldValidator ControlToValidate="Email"
|
||||||
|
ErrorMessage="Please provide your email address."
|
||||||
|
Display="Dynamic" />
|
||||||
|
<!--<com:TEmailAddressValidator ControlToValidate="Email"-->
|
||||||
|
<!-- ErrorMessage="You entered an invalid email address." -->
|
||||||
|
<!-- Display="Dynamic" />-->
|
||||||
|
<br/>
|
||||||
|
<com:TTextBox ID="Email" />
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<span>Feedback:</span>
|
||||||
|
<com:TRequiredFieldValidator ControlToValidate="Feedback"
|
||||||
|
ErrorMessage="Please provide your feedback."
|
||||||
|
Display="Dynamic" />
|
||||||
|
<br/>
|
||||||
|
<com:TTextBox ID="Feedback"
|
||||||
|
TextMode="MultiLine"
|
||||||
|
Rows="10"
|
||||||
|
Columns="40" />
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<com:TButton Text="Submit" OnClick="submitButtonClicked" />
|
||||||
|
</com:TContent>
|
||||||
28
protected/pages/Contact.php
Normal file
28
protected/pages/Contact.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
class Contact extends TPage
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Event handler for the OnClick event of the submit button.
|
||||||
|
* @param TButton the button triggering the event
|
||||||
|
* @param TEventParameter event parameter (null here)
|
||||||
|
*/
|
||||||
|
public function submitButtonClicked($sender, $param)
|
||||||
|
{
|
||||||
|
if ($this->IsValid) // check if input validation is successful
|
||||||
|
{
|
||||||
|
// obtain the user name, email, feedback from the textboxes
|
||||||
|
$name = $this->Name->Text;
|
||||||
|
$email = $this->Email->Text;
|
||||||
|
$feedback = $this->Feedback->Text;
|
||||||
|
|
||||||
|
// send an email to administrator with the above information
|
||||||
|
$this->mailFeedback($name, $email, $feedback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function mailFeedback($name, $email, $feedback)
|
||||||
|
{
|
||||||
|
// implementation of sending the feedback email
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -1,8 +1,3 @@
|
|||||||
<html>
|
<com:TContent ID="Main">
|
||||||
<head>
|
|
||||||
<title>Welcome to PRADO</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Welcome to PRADO!</h1>
|
<h1>Welcome to PRADO!</h1>
|
||||||
</body>
|
</com:TContent>
|
||||||
</html>
|
|
||||||
Reference in New Issue
Block a user