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