diff options
author | xue <> | 2005-11-16 18:41:59 +0000 |
---|---|---|
committer | xue <> | 2005-11-16 18:41:59 +0000 |
commit | fdd0a3ad7b2f9f942b94fde84277529ecae2a3b3 (patch) | |
tree | fe4126c804bab2a96a85990c218ec4dd7384c59e /demos/personal/protected/a | |
parent | e27780e23d0df3e0a08fd3ae4e60fc81a51d42cc (diff) |
Diffstat (limited to 'demos/personal/protected/a')
-rw-r--r-- | demos/personal/protected/a/HomePage.php | 21 | ||||
-rw-r--r-- | demos/personal/protected/a/HomePage.tpl | 3 | ||||
-rw-r--r-- | demos/personal/protected/a/Layout.php | 7 | ||||
-rw-r--r-- | demos/personal/protected/a/Layout.tpl | 29 | ||||
-rw-r--r-- | demos/personal/protected/a/LoginPage.php | 15 | ||||
-rw-r--r-- | demos/personal/protected/a/LoginPage.tpl | 7 | ||||
-rw-r--r-- | demos/personal/protected/a/config.xml | 8 |
7 files changed, 90 insertions, 0 deletions
diff --git a/demos/personal/protected/a/HomePage.php b/demos/personal/protected/a/HomePage.php new file mode 100644 index 00000000..6c69e44b --- /dev/null +++ b/demos/personal/protected/a/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/a/HomePage.tpl b/demos/personal/protected/a/HomePage.tpl new file mode 100644 index 00000000..9471a9b9 --- /dev/null +++ b/demos/personal/protected/a/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/a/Layout.php b/demos/personal/protected/a/Layout.php new file mode 100644 index 00000000..ba96038b --- /dev/null +++ b/demos/personal/protected/a/Layout.php @@ -0,0 +1,7 @@ +<?php
+
+class Layout extends TTemplateControl
+{
+}
+
+?>
\ No newline at end of file diff --git a/demos/personal/protected/a/Layout.tpl b/demos/personal/protected/a/Layout.tpl new file mode 100644 index 00000000..bf3cd7ac --- /dev/null +++ b/demos/personal/protected/a/Layout.tpl @@ -0,0 +1,29 @@ +<!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=<%=$this->Service->constructUrl('home') %> >HOME</a> |
+ <a href=<%=$this->Service->constructUrl('resume') %> >RESUME</a> |
+ <a href=<%=$this->Service->constructUrl('links') %> >LINKS</a> |
+ <a href=<%=$this->Service->constructUrl('albums') %> >ALBUMS</a> |
+ <a href=<%=$this->Service->constructUrl('login') %> >LOGIN</a>
+ </div>
+</div>
+<div class="main">
+<com:TContentPlaceHolder ID="main" />
+</div>
+<div class="footer">
+ Copyright © 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/a/LoginPage.php b/demos/personal/protected/a/LoginPage.php new file mode 100644 index 00000000..3a3b8432 --- /dev/null +++ b/demos/personal/protected/a/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/a/LoginPage.tpl b/demos/personal/protected/a/LoginPage.tpl new file mode 100644 index 00000000..588b8f6a --- /dev/null +++ b/demos/personal/protected/a/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/a/config.xml b/demos/personal/protected/a/config.xml new file mode 100644 index 00000000..b3d6b036 --- /dev/null +++ b/demos/personal/protected/a/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 |