summaryrefslogtreecommitdiff
path: root/framework/Wsat/pages/TWsatScaffolding.php
blob: 7352b2ae6143cb2a755c0fdaa5b8c3e8420492c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php

/**
 * @author Daniel Sampedro Bello <darthdaniel85@gmail.com>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2014 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @version $Id$
 * @since 3.3
 * @package Wsat.pages
 */
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();
                }
        }

}