diff options
Diffstat (limited to 'framework/Wsat/pages')
-rw-r--r-- | framework/Wsat/pages/TWsatGenerateAR.page | 2 | ||||
-rw-r--r-- | framework/Wsat/pages/TWsatGenerateAR.php | 2 | ||||
-rw-r--r-- | framework/Wsat/pages/TWsatScaffolding.page | 11 | ||||
-rw-r--r-- | framework/Wsat/pages/TWsatScaffolding.php | 34 |
4 files changed, 45 insertions, 4 deletions
diff --git a/framework/Wsat/pages/TWsatGenerateAR.page b/framework/Wsat/pages/TWsatGenerateAR.page index 926d6b0f..c41d03a5 100644 --- a/framework/Wsat/pages/TWsatGenerateAR.page +++ b/framework/Wsat/pages/TWsatGenerateAR.page @@ -1,5 +1,5 @@ <com:TContent ID="Content"> - <div style="margin: 10px; font-size: 16px; font-weight: bold">Active Record Classes Generator</div> + <div class="section_title">Active Record Classes Generator</div> <div class="green_panel" style="text-align: left; font-size: 14px; margin: 15px 5px"> <label>This generator generates an AR class for the specified database table.</label><br/> <label>Fields with <b style="color: red">*</b> are required.</label> diff --git a/framework/Wsat/pages/TWsatGenerateAR.php b/framework/Wsat/pages/TWsatGenerateAR.php index 4a3714de..2e7bab06 100644 --- a/framework/Wsat/pages/TWsatGenerateAR.php +++ b/framework/Wsat/pages/TWsatGenerateAR.php @@ -51,7 +51,7 @@ class TWsatGenerateAR extends TPage public function preview($sender) { -// throw new THttpException(500, "Not implemented yet."); + throw new THttpException(500, "Not implemented yet."); } }
\ No newline at end of file diff --git a/framework/Wsat/pages/TWsatScaffolding.page b/framework/Wsat/pages/TWsatScaffolding.page index 42f78d09..bcf4d276 100644 --- a/framework/Wsat/pages/TWsatScaffolding.page +++ b/framework/Wsat/pages/TWsatScaffolding.page @@ -1,3 +1,12 @@ <com:TContent ID="Content"> - Scaffolding will be avaliable in Prado 3.4 + <div class="section_title">Scaffolding Generator</div> + + <div> + <com:TPanel ID="tableNames"/> + </div> + + <div style="text-align: center; width: 400px"> + <com:TButton Text="Preview" OnClick="preview" Visible="false" /> + <com:TButton Text="Generate" OnClick="generate" /> + </div> </com:TContent> diff --git a/framework/Wsat/pages/TWsatScaffolding.php b/framework/Wsat/pages/TWsatScaffolding.php index fe691dd9..7352b2ae 100644 --- a/framework/Wsat/pages/TWsatScaffolding.php +++ b/framework/Wsat/pages/TWsatScaffolding.php @@ -9,9 +9,41 @@ * @since 3.3 * @package Wsat.pages */ -Prado::using("System.Wsat.TWsatARGenerator"); +Prado::using("System.Wsat.TWsatScaffoldingGenerator"); class TWsatScaffolding extends TPage { + public function onInit($param) + { + parent::onInit($param); + if (!$this->IsPostBack) + { + $this->startVisual(); + } + } + + private function startVisual() + { + $scf_generator = new TWsatScaffoldingGenerator(); + foreach ($scf_generator->getAllTableNames() as $tableName) + { + $dynChb = new TCheckBox(); + $dynChb->ID = $tableName; + $dynChb->Text = ucfirst($tableName); + $dynChb->Checked = true; + $this->tableNames->getControls()->add($dynChb); + + } + } + + public function generate($sender) + { + if ($this->IsValid) + { + $scf_generator = new TWsatScaffoldingGenerator(); + $scf_generator->renderAllTablesInformation(); + } + } + }
\ No newline at end of file |