summaryrefslogtreecommitdiff
path: root/demos/personal
diff options
context:
space:
mode:
authorxue <>2005-12-24 23:12:57 +0000
committerxue <>2005-12-24 23:12:57 +0000
commit2e3ff4ed70c3f06feb06b66dafd9b9ba7e47a191 (patch)
tree59b152b9e362f9ea633b3029d5cab7500bf4ea8e /demos/personal
parentc968872380db2d7641c0cd9d07edd845b10f43a4 (diff)
Diffstat (limited to 'demos/personal')
-rw-r--r--demos/personal/protected/Pages/Home.page3
-rw-r--r--demos/personal/protected/Pages/Home.php21
-rw-r--r--demos/personal/protected/Pages/Layout.tpl10
-rw-r--r--demos/personal/protected/Pages/UserLogin.page7
-rw-r--r--demos/personal/protected/Pages/UserLogin.php15
-rw-r--r--demos/personal/protected/Pages/config.xml5
6 files changed, 52 insertions, 9 deletions
diff --git a/demos/personal/protected/Pages/Home.page b/demos/personal/protected/Pages/Home.page
new file mode 100644
index 00000000..9471a9b9
--- /dev/null
+++ b/demos/personal/protected/Pages/Home.page
@@ -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/Home.php b/demos/personal/protected/Pages/Home.php
new file mode 100644
index 00000000..cca7d57b
--- /dev/null
+++ b/demos/personal/protected/Pages/Home.php
@@ -0,0 +1,21 @@
+<?php
+
+class Home 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/Layout.tpl b/demos/personal/protected/Pages/Layout.tpl
index bf3cd7ac..db6dd242 100644
--- a/demos/personal/protected/Pages/Layout.tpl
+++ b/demos/personal/protected/Pages/Layout.tpl
@@ -10,11 +10,11 @@
<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>
+ <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('UserLogin') %> >LOGIN</a>
</div>
</div>
<div class="main">
diff --git a/demos/personal/protected/Pages/UserLogin.page b/demos/personal/protected/Pages/UserLogin.page
new file mode 100644
index 00000000..588b8f6a
--- /dev/null
+++ b/demos/personal/protected/Pages/UserLogin.page
@@ -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/UserLogin.php b/demos/personal/protected/Pages/UserLogin.php
new file mode 100644
index 00000000..70cbc986
--- /dev/null
+++ b/demos/personal/protected/Pages/UserLogin.php
@@ -0,0 +1,15 @@
+<?php
+
+class UserLogin extends TPage
+{
+ public function login($sender,$param)
+ {
+ $manager=$this->Application->getModule('auth');
+ 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/config.xml b/demos/personal/protected/Pages/config.xml
index 2a0108c0..ca63c17b 100644
--- a/demos/personal/protected/Pages/config.xml
+++ b/demos/personal/protected/Pages/config.xml
@@ -1,8 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
- <pages MasterClass="Application.Pages.Layout">
- <page id="home" class="HomePage" />
- <page id="login" class="LoginPage" />
- </pages>
+ <pages MasterClass="Application.Pages.Layout" />
</configuration> \ No newline at end of file