php7 fixes
[Pman.Builder] / App.php
diff --git a/App.php b/App.php
index 91cf1f9..ac03167 100644 (file)
--- a/App.php
+++ b/App.php
@@ -1,21 +1,50 @@
 <?php
 
+
+/*
+ * used to preview a button or item..
+ */
 require_once 'Pman.php';
 
 class Pman_Builder_App extends Pman
 {
-  
+    var $masterTemplate = "frame.html";
+    
+    
     // getAuth - everyone allowed in...
     function getAuth() {
         return true;
     }
   
-    function get($app) {
+    function get($app, $opts = array()) {
+        
+         
+        
         if (empty($app)) {
             die("Invalid Application");
         }
-        $p = DB_DataObject::factory('Builder');
-        $p->app = $app;
+        
+        
+        $mod = DB_DataObject::factory('builder_modules');
+        if (!$mod->get('app', $app)) {
+            die("invalid module");
+        }
+        
+        if (!empty($_REQUEST['no_parts'])) {
+            // used to do the previewer
+            
+            $this->builderJs = array();
+            //should it try and load the core???
+            $o  = HTML_FlexyFramework::get();
+            $o->enable = '';
+            $o->enableArray = array('');
+            $o->disable  = 'Core';
+            $this->disable_jstemplate = true;
+            return;
+        }
+        
+        $p = DB_DataObject::factory('builder_part');
+        $p->module_id = $mod->id;
         $p->selectAdd();
         $p->selectAdd('module');
         if (!$p->find()) {
@@ -30,9 +59,9 @@ class Pman_Builder_App extends Pman
             // this is a bit questionable..  - we may need to check if the
             // db version is more recent.
             $fl = $ff->rootDir.'/Pman/'. $app .'/'.$p->module.'.js';
-            if (file_exists($fl) && filesize($fl)) {
-                continue;
-            }
+            //if (file_exists($fl) && filesize($fl)) {
+            //    continue;
+            //}
             $this->builderJs[] = $p->module;
         }
         $o  = HTML_FlexyFramework::get();