summaryrefslogtreecommitdiff
path: root/demos/personal/protected/pages
diff options
context:
space:
mode:
authorxue <>2005-11-16 13:33:17 +0000
committerxue <>2005-11-16 13:33:17 +0000
commit749dec2fcae7b8cdd86ecc923b1af3abfadbcde2 (patch)
treeb31617a60b7884ce6a7292896c5b7b17cdbf9754 /demos/personal/protected/pages
parentf5294995a9324d8e748b2f5520fb43675d1e54fe (diff)
Diffstat (limited to 'demos/personal/protected/pages')
-rw-r--r--demos/personal/protected/pages/HomePage.php21
-rw-r--r--demos/personal/protected/pages/HomePage.tpl3
-rw-r--r--demos/personal/protected/pages/Layout.php7
-rw-r--r--demos/personal/protected/pages/Layout.tpl27
-rw-r--r--demos/personal/protected/pages/LoginPage.php15
-rw-r--r--demos/personal/protected/pages/LoginPage.tpl7
-rw-r--r--demos/personal/protected/pages/config.xml8
7 files changed, 88 insertions, 0 deletions
diff --git a/demos/personal/protected/pages/HomePage.php b/demos/personal/protected/pages/HomePage.php
new file mode 100644
index 00000000..6c69e44b
--- /dev/null
+++ b/demos/personal/protected/pages/HomePage.php
@@ -0,0 +1,21 @@
+<?php
+
+class HomePage extends TPage
+{
+ public function onPreInit($param)
+ {
+ parent::onPreInit($param);
+ if(!$this->getUser()->getIsGuest())
+ $this->setTheme('');
+ }
+
+ public function testClick($sender,$param)
+ {
+ if($sender->BackColor==='')
+ $sender->BackColor='blue';
+ else
+ $sender->BackColor='';
+ }
+}
+
+?> \ No newline at end of file
diff --git a/demos/personal/protected/pages/HomePage.tpl b/demos/personal/protected/pages/HomePage.tpl
new file mode 100644
index 00000000..9471a9b9
--- /dev/null
+++ b/demos/personal/protected/pages/HomePage.tpl
@@ -0,0 +1,3 @@
+<com:TContent ID="main" >
+main content
+</com:TContent> \ No newline at end of file
diff --git a/demos/personal/protected/pages/Layout.php b/demos/personal/protected/pages/Layout.php
new file mode 100644
index 00000000..ba96038b
--- /dev/null
+++ b/demos/personal/protected/pages/Layout.php
@@ -0,0 +1,7 @@
+<?php
+
+class Layout extends TTemplateControl
+{
+}
+
+?> \ No newline at end of file
diff --git a/demos/personal/protected/pages/Layout.tpl b/demos/personal/protected/pages/Layout.tpl
new file mode 100644
index 00000000..500abf3b
--- /dev/null
+++ b/demos/personal/protected/pages/Layout.tpl
@@ -0,0 +1,27 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
+<head>
+<title>My Personal Website</title>
+</head>
+<body>
+<com:TForm>
+<div class="header">
+ <h1>Your Name Here</h1>
+ <h2>My Personal Site</h2>
+ <div class="nav">
+ <a href="?sp=page.home">HOME</a> |
+ <a href="?sp=page.resume">RESUME</a> |
+ <a href="?sp=page.links">LINKS</a> |
+ <a href="?sp=page.albums">ALBUMS</a> |
+ <a href="?sp=page.login">LOGIN</a>
+ </div>
+</div>
+<com:TContentPlaceHolder ID="main" />
+<div class="footer">
+ Copyright &copy; 2005 Your Name here.<br/>
+ Powered by <a href="http://www.pradosoft.com/">PRADO</a>.
+</div>
+</com:TForm>
+</body>
+</html> \ No newline at end of file
diff --git a/demos/personal/protected/pages/LoginPage.php b/demos/personal/protected/pages/LoginPage.php
new file mode 100644
index 00000000..3a3b8432
--- /dev/null
+++ b/demos/personal/protected/pages/LoginPage.php
@@ -0,0 +1,15 @@
+<?php
+
+class LoginPage extends TPage
+{
+ public function login($sender,$param)
+ {
+ $manager=$this->Application->AuthManager;
+ if($manager->login($this->username->Text,$this->password->Text))
+ $this->Application->Response->redirect($this->Application->Request->Items['ReturnUrl']);
+ else
+ $this->error->Text='login failed';
+ }
+}
+
+?> \ No newline at end of file
diff --git a/demos/personal/protected/pages/LoginPage.tpl b/demos/personal/protected/pages/LoginPage.tpl
new file mode 100644
index 00000000..588b8f6a
--- /dev/null
+++ b/demos/personal/protected/pages/LoginPage.tpl
@@ -0,0 +1,7 @@
+<com:TContent ID="main" >
+Username: <com:TTextBox ID="username" /><br/>
+Password: <com:TTextBox ID="password" TextMode="Password" /><br/>
+<com:TButton Text="Login" Click="login" />
+<com:TLabel ID="error" />
+</com:TContent>
+
diff --git a/demos/personal/protected/pages/config.xml b/demos/personal/protected/pages/config.xml
new file mode 100644
index 00000000..b3d6b036
--- /dev/null
+++ b/demos/personal/protected/pages/config.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<configuration>
+ <pages MasterClass="Pages.Layout">
+ <page id="home" type="HomePage" />
+ <page id="login" type="LoginPage" />
+ </pages>
+</configuration> \ No newline at end of file