diff options
-rw-r--r-- | .gitattributes | 4 | ||||
-rw-r--r-- | demos/personal/protected/Pages/Home.page | 3 | ||||
-rw-r--r-- | demos/personal/protected/Pages/Home.php | 21 | ||||
-rw-r--r-- | demos/personal/protected/Pages/Layout.tpl | 10 | ||||
-rw-r--r-- | demos/personal/protected/Pages/UserLogin.page | 7 | ||||
-rw-r--r-- | demos/personal/protected/Pages/UserLogin.php | 15 | ||||
-rw-r--r-- | demos/personal/protected/Pages/config.xml | 5 |
7 files changed, 56 insertions, 9 deletions
diff --git a/.gitattributes b/.gitattributes index 5b653b41..193ee48d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,8 +2,12 @@ demos/personal/index.php -text demos/personal/protected/Data/application.xml -text demos/personal/protected/Modules/DataModule.php -text +demos/personal/protected/Pages/Home.page -text +demos/personal/protected/Pages/Home.php -text demos/personal/protected/Pages/Layout.php -text demos/personal/protected/Pages/Layout.tpl -text +demos/personal/protected/Pages/UserLogin.page -text +demos/personal/protected/Pages/UserLogin.php -text demos/personal/protected/Pages/config.xml -text demos/personal/themes/BlueTheme/buttons.skin -text demos/personal/themes/BlueTheme/icon_profile.gif -text 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 |