diff options
Diffstat (limited to 'demos/personal/protected/Pages')
-rw-r--r-- | demos/personal/protected/Pages/HomePage.php | 21 | ||||
-rw-r--r-- | demos/personal/protected/Pages/HomePage.tpl | 3 | ||||
-rw-r--r-- | demos/personal/protected/Pages/Layout.php | 7 | ||||
-rw-r--r-- | demos/personal/protected/Pages/Layout.tpl | 29 | ||||
-rw-r--r-- | demos/personal/protected/Pages/LoginPage.php | 15 | ||||
-rw-r--r-- | demos/personal/protected/Pages/LoginPage.tpl | 7 | ||||
-rw-r--r-- | demos/personal/protected/Pages/config.xml | 8 |
7 files changed, 90 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..bf3cd7ac --- /dev/null +++ b/demos/personal/protected/Pages/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/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 |