From b0c2fecd42bd8b95f2535a525b035f27aebde287 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 17 Nov 2013 10:17:44 -0800 Subject: WSAT, similar to Microsoft - Web Site Administration Tool and Yii's Gii, will allow as to generate a lot code such as AR classes with the proper relationships... scaffolding... as well as to admin the app configuration and pages configurations in a GUI fashion. --- framework/Wsat/pages/TWsatGenerateAR.page | 23 +++++++++++++ framework/Wsat/pages/TWsatGenerateAR.php | 33 ++++++++++++++++++ framework/Wsat/pages/TWsatHome.page | 5 +++ framework/Wsat/pages/TWsatHome.php | 15 ++++++++ framework/Wsat/pages/TWsatLogin.page | 9 +++++ framework/Wsat/pages/TWsatLogin.php | 30 ++++++++++++++++ framework/Wsat/pages/TWsatScaffolding.page | 3 ++ framework/Wsat/pages/TWsatScaffolding.php | 15 ++++++++ framework/Wsat/pages/config.xml | 9 +++++ framework/Wsat/pages/layout/TWsatLayout.php | 32 +++++++++++++++++ framework/Wsat/pages/layout/TWsatLayout.tpl | 53 +++++++++++++++++++++++++++++ 11 files changed, 227 insertions(+) create mode 100644 framework/Wsat/pages/TWsatGenerateAR.page create mode 100644 framework/Wsat/pages/TWsatGenerateAR.php create mode 100644 framework/Wsat/pages/TWsatHome.page create mode 100644 framework/Wsat/pages/TWsatHome.php create mode 100644 framework/Wsat/pages/TWsatLogin.page create mode 100644 framework/Wsat/pages/TWsatLogin.php create mode 100644 framework/Wsat/pages/TWsatScaffolding.page create mode 100644 framework/Wsat/pages/TWsatScaffolding.php create mode 100644 framework/Wsat/pages/config.xml create mode 100644 framework/Wsat/pages/layout/TWsatLayout.php create mode 100644 framework/Wsat/pages/layout/TWsatLayout.tpl (limited to 'framework/Wsat/pages') diff --git a/framework/Wsat/pages/TWsatGenerateAR.page b/framework/Wsat/pages/TWsatGenerateAR.page new file mode 100644 index 00000000..3905d023 --- /dev/null +++ b/framework/Wsat/pages/TWsatGenerateAR.page @@ -0,0 +1,23 @@ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+ + +
+
+ +
diff --git a/framework/Wsat/pages/TWsatGenerateAR.php b/framework/Wsat/pages/TWsatGenerateAR.php new file mode 100644 index 00000000..754cac5c --- /dev/null +++ b/framework/Wsat/pages/TWsatGenerateAR.php @@ -0,0 +1,33 @@ +table_name->Text; + + $ar_generator = new TWsatARGenerator(); + if ($table_name != "*") { + $ar_generator->generate($table_name); + } else { + $ar_generator->generateAll(); + } + } + + public function preview($sender) { + + } + +} + +?> \ No newline at end of file diff --git a/framework/Wsat/pages/TWsatHome.page b/framework/Wsat/pages/TWsatHome.page new file mode 100644 index 00000000..16aa3669 --- /dev/null +++ b/framework/Wsat/pages/TWsatHome.page @@ -0,0 +1,5 @@ + + + +
Application Dir: <%= Prado::getPathOfNamespace('Application') %>
+
diff --git a/framework/Wsat/pages/TWsatHome.php b/framework/Wsat/pages/TWsatHome.php new file mode 100644 index 00000000..3c1358e1 --- /dev/null +++ b/framework/Wsat/pages/TWsatHome.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/framework/Wsat/pages/TWsatLogin.page b/framework/Wsat/pages/TWsatLogin.page new file mode 100644 index 00000000..dada4248 --- /dev/null +++ b/framework/Wsat/pages/TWsatLogin.page @@ -0,0 +1,9 @@ + +
+ + +
+ +
+ +
diff --git a/framework/Wsat/pages/TWsatLogin.php b/framework/Wsat/pages/TWsatLogin.php new file mode 100644 index 00000000..7435d75d --- /dev/null +++ b/framework/Wsat/pages/TWsatLogin.php @@ -0,0 +1,30 @@ +getService()->getPassword(); + $user_pass = $this->password->Text; + + if ($user_pass === $config_pass) { + $this->Session["wsat_password"] = $config_pass; + + $authManager = $this->Application->getModule('auth'); + $url = $authManager->ReturnUrl; + if (empty($url)) { + $url = $this->Service->constructUrl('TWsatHome'); + } + $this->Response->redirect($url); + } else { + echo "user or pass wrong"; + } + } + +} + +?> \ No newline at end of file diff --git a/framework/Wsat/pages/TWsatScaffolding.page b/framework/Wsat/pages/TWsatScaffolding.page new file mode 100644 index 00000000..42f78d09 --- /dev/null +++ b/framework/Wsat/pages/TWsatScaffolding.page @@ -0,0 +1,3 @@ + + Scaffolding will be avaliable in Prado 3.4 + diff --git a/framework/Wsat/pages/TWsatScaffolding.php b/framework/Wsat/pages/TWsatScaffolding.php new file mode 100644 index 00000000..afa00273 --- /dev/null +++ b/framework/Wsat/pages/TWsatScaffolding.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/framework/Wsat/pages/config.xml b/framework/Wsat/pages/config.xml new file mode 100644 index 00000000..832b6cc3 --- /dev/null +++ b/framework/Wsat/pages/config.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/framework/Wsat/pages/layout/TWsatLayout.php b/framework/Wsat/pages/layout/TWsatLayout.php new file mode 100644 index 00000000..30e52f44 --- /dev/null +++ b/framework/Wsat/pages/layout/TWsatLayout.php @@ -0,0 +1,32 @@ +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 diff --git a/framework/Wsat/pages/layout/TWsatLayout.tpl b/framework/Wsat/pages/layout/TWsatLayout.tpl new file mode 100644 index 00000000..47068a3f --- /dev/null +++ b/framework/Wsat/pages/layout/TWsatLayout.tpl @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + +
+
+
+
Code Generation
+
    +
  • +
  • +
+
+
+ +
+ +
+ +
+
+ + +
+ + \ No newline at end of file -- cgit v1.2.3