summaryrefslogtreecommitdiff
path: root/framework/Wsat/pages
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Wsat/pages')
-rw-r--r--framework/Wsat/pages/TWsatGenerateAR.php77
-rw-r--r--framework/Wsat/pages/TWsatHome.php2
-rw-r--r--framework/Wsat/pages/TWsatLogin.php36
-rw-r--r--framework/Wsat/pages/layout/TWsatLayout.php68
4 files changed, 93 insertions, 90 deletions
diff --git a/framework/Wsat/pages/TWsatGenerateAR.php b/framework/Wsat/pages/TWsatGenerateAR.php
index 14e14983..c9584038 100644
--- a/framework/Wsat/pages/TWsatGenerateAR.php
+++ b/framework/Wsat/pages/TWsatGenerateAR.php
@@ -14,49 +14,46 @@ Prado::using("System.Wsat.TWsatARGenerator");
class TWsatGenerateAR extends TPage
{
- public function generate($sender)
- {
- if ($this->IsValid)
+ public function generate($sender)
{
- $table_name = $this->table_name->Text;
- $output_folder_ns = $this->output_folder->Text;
- $class_prefix = $this->class_prefix->Text;
- $class_sufix = $this->class_sufix->Text;
-
- try
- {
- $ar_generator = new TWsatARGenerator();
- $ar_generator->setOpFile($output_folder_ns);
- $ar_generator->setClasPrefix($class_prefix);
- $ar_generator->setClassSufix($class_sufix);
-
- if ($this->build_rel->Checked)
+ if ($this->IsValid)
{
- $ar_generator->buildRelations();
- }
- if ($table_name != "*")
- {
- $ar_generator->generate($table_name);
- } else
- {
- $ar_generator->generateAll();
+ $table_name = $this->table_name->Text;
+ $output_folder_ns = $this->output_folder->Text;
+ $class_prefix = $this->class_prefix->Text;
+ $class_sufix = $this->class_sufix->Text;
+
+ try
+ {
+ $ar_generator = new TWsatARGenerator();
+ $ar_generator->setOpFile($output_folder_ns);
+ $ar_generator->setClasPrefix($class_prefix);
+ $ar_generator->setClassSufix($class_sufix);
+
+ if ($this->build_rel->Checked)
+ $ar_generator->buildRelations();
+
+ if ($table_name != "*")
+ $ar_generator->generate($table_name);
+ else
+ $ar_generator->generateAll();
+
+ $this->feedback_panel->CssClass = "green_panel";
+ $this->generation_msg->Text = "The code has been generated successfully.";
+ } catch (Exception $ex)
+ {
+ $this->feedback_panel->CssClass = "red_panel";
+ $this->generation_msg->Text = $ex->getMessage();
+ }
+ $this->feedback_panel->Visible = true;
}
- $this->feedback_panel->CssClass = "green_panel";
- $this->generation_msg->Text = "The code has been generated successfully.";
- } catch (Exception $ex)
- {
- $this->feedback_panel->CssClass = "red_panel";
- $this->generation_msg->Text = $ex->getMessage();
- }
- $this->feedback_panel->Visible = true;
}
- }
-
- public function preview($sender)
- {
-// $ar_generator = new TWsatARGenerator();
-// $ar_generator->renderAllTablesInformation();
- throw new THttpException(500, "Not implemented yet.");
- }
+
+ public function preview($sender)
+ {
+// $ar_generator = new TWsatARGenerator();
+// $ar_generator->renderAllTablesInformation();
+ throw new THttpException(500, "Not implemented yet.");
+ }
} \ No newline at end of file
diff --git a/framework/Wsat/pages/TWsatHome.php b/framework/Wsat/pages/TWsatHome.php
index c5291ed7..b5ae1bb4 100644
--- a/framework/Wsat/pages/TWsatHome.php
+++ b/framework/Wsat/pages/TWsatHome.php
@@ -13,5 +13,5 @@ Prado::using("System.Wsat.TWsatARGenerator");
class TWsatHome extends TPage
{
-
+
} \ No newline at end of file
diff --git a/framework/Wsat/pages/TWsatLogin.php b/framework/Wsat/pages/TWsatLogin.php
index 4b3ba0c1..02d5c9fd 100644
--- a/framework/Wsat/pages/TWsatLogin.php
+++ b/framework/Wsat/pages/TWsatLogin.php
@@ -12,27 +12,27 @@
class TWsatLogin extends TPage
{
- public function login()
- {
- if ($this->IsValid)
+ public function login()
{
- $this->Session["wsat_password"] = $this->getService()->getPassword();
+ if ($this->IsValid)
+ {
+ $this->Session["wsat_password"] = $this->getService()->getPassword();
- $authManager = $this->Application->getModule('auth');
- $url = $authManager->ReturnUrl;
- if (empty($url))
- {
- $url = $this->Service->constructUrl('TWsatHome');
- }
- $this->Response->redirect($url);
+ $authManager = $this->Application->getModule('auth');
+ $url = $authManager->ReturnUrl;
+ if (empty($url))
+ {
+ $url = $this->Service->constructUrl('TWsatHome');
+ }
+ $this->Response->redirect($url);
+ }
}
- }
- public function validatePassword($sender, $param)
- {
- $config_pass = $this->getService()->getPassword();
- $user_pass = $this->password->Text;
- $param->IsValid = $user_pass === $config_pass;
- }
+ public function validatePassword($sender, $param)
+ {
+ $config_pass = $this->getService()->getPassword();
+ $user_pass = $this->password->Text;
+ $param->IsValid = $user_pass === $config_pass;
+ }
} \ No newline at end of file
diff --git a/framework/Wsat/pages/layout/TWsatLayout.php b/framework/Wsat/pages/layout/TWsatLayout.php
index e799125b..4a7c578c 100644
--- a/framework/Wsat/pages/layout/TWsatLayout.php
+++ b/framework/Wsat/pages/layout/TWsatLayout.php
@@ -1,32 +1,38 @@
-<?php
-
-/**
- * Description of MainLayout
- *
- * @author daniels
- */
-class TWsatLayout extends TTemplateControl {
-
- public function onLoad($param) {
- parent::onLoad($param);
- $this->validateSecurity();
- }
-
- private function validateSecurity() {
- if ($this->Session["wsat_password"] !== $this->getService()->getPassword()) {
- if (!$this->getPage() instanceof TWsatLogin) {
- $url = $this->Service->constructUrl('TWsatLogin');
- $this->Response->redirect($url);
- }
- }
- }
-
- public function logout() {
- $this->Session["wsat_password"] = "";
- $url = $this->Service->constructUrl('TWsatLogin');
- $this->Response->redirect($url);
- }
-
-}
-
+<?php
+
+/**
+ * Description of MainLayout
+ *
+ * @author daniels
+ */
+class TWsatLayout extends TTemplateControl
+{
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ $this->validateSecurity();
+ }
+
+ private function validateSecurity()
+ {
+ if ($this->Session["wsat_password"] !== $this->getService()->getPassword())
+ {
+ if (!$this->getPage() instanceof TWsatLogin)
+ {
+ $url = $this->Service->constructUrl('TWsatLogin');
+ $this->Response->redirect($url);
+ }
+ }
+ }
+
+ public function logout()
+ {
+ $this->Session["wsat_password"] = "";
+ $url = $this->Service->constructUrl('TWsatLogin');
+ $this->Response->redirect($url);
+ }
+
+}
+
?> \ No newline at end of file