App.php
[Pman.Builder] / App.php
1 <?php
2
3
4 /*
5  * used to preview a button or item..
6  */
7 require_once 'Pman.php';
8
9 class Pman_Builder_App extends Pman
10 {
11     var $template = "frame.html";
12     // getAuth - everyone allowed in...
13     function getAuth() {
14         return true;
15     }
16   
17     function get($app) {
18         
19          
20         
21         if (empty($app)) {
22             die("Invalid Application");
23         }
24         
25         
26         $mod = DB_DataObject::factory('builder_modules');
27         if (!$mod->get('app', $app)) {
28             die("invalid module");
29         }
30         
31         if (!empty($_REQUEST['no_parts'])) {
32             // used to do the previewer
33             
34             $this->builderJs = array();
35             //should it try and load the core???
36             $o  = HTML_FlexyFramework::get();
37             $o->enable = 'Core';
38             $o->enableArray = array('Core');
39             return;
40         }
41         
42         $p = DB_DataObject::factory('builder_part');
43         $p->module_id = $mod->id;
44         $p->selectAdd();
45         $p->selectAdd('module');
46         if (!$p->find()) {
47             die("Invalid Application (2)");
48         }
49         $this->builderJs = array();
50         
51         $ff = HTML_FlexyFramework::get();
52         
53         while ($p->fetch()) {
54             // file exists in file system - dont add it twice!
55             // this is a bit questionable..  - we may need to check if the
56             // db version is more recent.
57             $fl = $ff->rootDir.'/Pman/'. $app .'/'.$p->module.'.js';
58             //if (file_exists($fl) && filesize($fl)) {
59             //    continue;
60             //}
61             $this->builderJs[] = $p->module;
62         }
63         $o  = HTML_FlexyFramework::get();
64         //echo '<PRE>';print_r($o);exit;
65         $o->enable = 'Core';
66         $o->enableArray = array('Core');
67         //$o->options = 'Core,'.$o->options;
68              
69         return parent::get('');
70         
71         
72     }
73     
74 }