summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/php/components/LoginBox.php (renamed from app/php/pages/Login.php)2
-rw-r--r--app/php/components/LoginBox.tpl29
-rw-r--r--app/php/pages/Login.page30
3 files changed, 31 insertions, 30 deletions
diff --git a/app/php/pages/Login.php b/app/php/components/LoginBox.php
index c4d33c2..33bbcc1 100644
--- a/app/php/pages/Login.php
+++ b/app/php/components/LoginBox.php
@@ -1,6 +1,6 @@
<?php
-class Login extends TPage {
+class LoginBox extends TTemplateControl {
public function loginUser($sender, $param) {
if ($this->Page->IsValid) {
diff --git a/app/php/components/LoginBox.tpl b/app/php/components/LoginBox.tpl
new file mode 100644
index 0000000..c602b88
--- /dev/null
+++ b/app/php/components/LoginBox.tpl
@@ -0,0 +1,29 @@
+Username:
+<com:TTextBox ID="Login"
+ ValidationGroup="LoginGroup" />
+<com:TRequiredFieldValidator
+ ControlToValidate="Login"
+ Display="Dynamic"
+ ErrorMessage="Username cannot be empty"
+ ValidationGroup="LoginGroup" />
+<br />
+Password:
+<com:TTextBox ID="Password"
+ TextMode="Password"
+ ValidationGroup="LoginGroup" />
+<com:TRequiredFieldValidator
+ ControlToValidate="Password"
+ Display="Dynamic"
+ ErrorMessage="Password cannot be empty"
+ ValidationGroup="LoginGroup" />
+<com:TCustomValidator
+ ControlToValidate="Password"
+ OnServerValidate="validatePassword"
+ Display="Dynamic"
+ ErrorMessage="Username and password don't match"
+ ValidationGroup="LoginGroup" />
+<br />
+<com:TButton
+ Text="Login"
+ OnCommand="loginUser"
+ ValidationGroup="LoginGroup" />
diff --git a/app/php/pages/Login.page b/app/php/pages/Login.page
index 5f02a5f..15bc93e 100644
--- a/app/php/pages/Login.page
+++ b/app/php/pages/Login.page
@@ -1,31 +1,3 @@
<com:TContent ID="Content">
- Username:
- <com:TTextBox ID="Login"
- ValidationGroup="LoginGroup" />
- <com:TRequiredFieldValidator
- ControlToValidate="Login"
- Display="Dynamic"
- ErrorMessage="Username cannot be empty"
- ValidationGroup="LoginGroup" />
- <br />
- Password:
- <com:TTextBox ID="Password"
- TextMode="Password"
- ValidationGroup="LoginGroup" />
- <com:TRequiredFieldValidator
- ControlToValidate="Password"
- Display="Dynamic"
- ErrorMessage="Password cannot be empty"
- ValidationGroup="LoginGroup" />
- <com:TCustomValidator
- ControlToValidate="Password"
- OnServerValidate="validatePassword"
- Display="Dynamic"
- ErrorMessage="Username and password don't match"
- ValidationGroup="LoginGroup" />
- <br />
- <com:TButton
- Text="Login"
- OnCommand="loginUser"
- ValidationGroup="LoginGroup" />
+ <com:LoginBox />
</com:TContent>