summaryrefslogtreecommitdiff
path: root/framework/Wsat/pages
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Wsat/pages')
-rw-r--r--framework/Wsat/pages/TWsatGenerateAR.page23
-rw-r--r--framework/Wsat/pages/TWsatGenerateAR.php33
-rw-r--r--framework/Wsat/pages/TWsatHome.page5
-rw-r--r--framework/Wsat/pages/TWsatHome.php15
-rw-r--r--framework/Wsat/pages/TWsatLogin.page9
-rw-r--r--framework/Wsat/pages/TWsatLogin.php30
-rw-r--r--framework/Wsat/pages/TWsatScaffolding.page3
-rw-r--r--framework/Wsat/pages/TWsatScaffolding.php15
-rw-r--r--framework/Wsat/pages/config.xml9
-rw-r--r--framework/Wsat/pages/layout/TWsatLayout.php32
-rw-r--r--framework/Wsat/pages/layout/TWsatLayout.tpl53
11 files changed, 227 insertions, 0 deletions
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 @@
+<com:TContent ID="Content">
+ <div style="margin-left: 220px">
+ <div class="form_row">
+ <com:TLabel Text="Table Name:" ForControl="table_name" style="margin-right: 14px" />
+ <com:TTextBox ID="table_name" Text="*" CssClass="in_text" />
+ </div>
+ <div class="form_row">
+ <com:TLabel Text="Class Prefix:" ForControl="class_prefix" style="margin-right: 16px"/>
+ <com:TTextBox ID="class_prefix" Text="AR_" CssClass="in_text" />
+ </div>
+ <div class="form_row">
+ <com:TLabel Text="Output Folder:" ForControl="output_folder"/>
+ <com:TTextBox ID="output_folder" Text="Application.App_Data.AR_Classes" CssClass="in_text" />
+ </div>
+
+ <br/>
+ <div style="text-align: center">
+ <com:TButton Text="Preview" OnClick="preview" />
+ <com:TButton Text="Generate" OnClick="generate" />
+ </div>
+ </div>
+
+</com:TContent>
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 @@
+<?php
+
+/**
+ * Description of Inicio
+ *
+ * @author daniels
+ */
+Prado::using("System.Wsat.TWsatARGenerator");
+
+class TWsatGenerateAR extends TPage {
+
+ public function onInit($param) {
+ parent::onInit($param);
+ }
+
+ public function generate($sender) {
+ $table_name = $this->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 @@
+<com:TContent ID="Content">
+ <label style="font-size: 18px; font-weight: bold">Welcome to Web Site Administration Tool</label>
+
+ <div style="margin-top: 25px"><b>Application Dir:</b> <%= Prado::getPathOfNamespace('Application') %></div>
+</com:TContent>
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 @@
+<?php
+
+/**
+ * Description of Inicio
+ *
+ * @author daniels
+ */
+Prado::using("System.Wsat.TWsatARGenerator");
+
+class TWsatHome extends TPage {
+
+
+}
+
+?> \ 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 @@
+<com:TContent ID="Content">
+ <div>
+ <com:TLabel Text="Password:" ForControl="password"/>
+ <com:TTextBox ID="password" />
+ </div>
+
+ <br/>
+ <com:TButton Text="Login" OnClick="login" />
+</com:TContent>
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 @@
+<?php
+
+/**
+ * Description of Inicio
+ *
+ * @author daniels
+ */
+class TWsatLogin extends TPage {
+
+ public function login() {
+ $config_pass = $this->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 @@
+<com:TContent ID="Content">
+ Scaffolding will be avaliable in Prado 3.4
+</com:TContent>
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 @@
+<?php
+
+/**
+ * Description of Inicio
+ *
+ * @author daniels
+ */
+Prado::using("System.Wsat.TWsatARGenerator");
+
+class TWsatScaffolding extends TPage {
+
+
+}
+
+?> \ 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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration>
+ <modules>
+ <module id="wsat_theme" class="System.Web.UI.TThemeManager" BasePath="System.Wsat.themes" />
+ </modules>
+
+ <pages Theme="PradoSoft" MasterClass="System.Wsat.pages.layout.TWsatLayout" />
+</configuration> \ 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 @@
+<?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
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 @@
+<!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">
+ <com:THead Title="PRADO - WSAT">
+ <com:TMetaTag HttpEquiv="Content-Type" Content="text/html; charset=utf-8" />
+ <com:TMetaTag HttpEquiv="Content-Language" Content="en" />
+ </com:THead>
+
+ <body>
+ <com:TForm>
+
+ <div id="header">
+ <a href="<%= $this->Service->DefaultPageUrl %>">
+ <div class="logo"></div>
+ <div style="float: left; margin-top: 17px">PRADO <br /> Web Site Administration Tool</div>
+ </a>
+ <div class="mantisbg"></div>
+ <div style="clear: both"></div>
+ </div>
+
+ <div class="mainmenu">
+ <div style="float: right"><com:TLinkButton Text="Logout" OnClick="logout" /></div>
+ <div style="float: right"><com:THyperLink NavigateUrl="http://www.pradosoft.com/" Text="PradoSoft.com" Target="_blank" />&nbsp;|&nbsp;</div>
+ <div style="float: right"><com:THyperLink NavigateUrl="<%= $this->Service->DefaultPageUrl %>" Text="Web App" Target="_blank" />&nbsp;|&nbsp;</div>
+ <div style="float: right"><com:THyperLink NavigateUrl="http://www.pradosoft.com/forum/" Text="Help" Target="_blank" />&nbsp;|&nbsp;</div>
+ <div style="clear: both"></div>
+ </div>
+
+ <div id="central_div">
+ <div id="toc">
+ <div class="topic">
+ <div>Code Generation</div>
+ <ul>
+ <li><com:THyperLink NavigateUrl="<%= $this->Service->constructUrl('TWsatGenerateAR') %>" Text="AR Classes" /></li>
+ <li><com:THyperLink NavigateUrl="<%= $this->Service->constructUrl('TWsatScaffolding') %>" Text="Scaffolding" /></li>
+ </ul>
+ </div>
+ </div>
+
+ <div id="content">
+ <com:TContentPlaceHolder ID="Content" />
+ </div>
+
+ <div style="clear: both"></div>
+ </div>
+
+ <div id="footer">
+ Copyright &copy; 2005-<%= date('Y') %> <a href="http://www.pradosoft.com">PradoSoft</a>.
+ <br/><br/>
+ <%= Prado::poweredByPrado() %>
+ </div>
+ </com:TForm>
+ </body>
+</html> \ No newline at end of file