php7 fixes
[Pman.Builder] / App.php
diff --git a/App.php b/App.php
index 8001898..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 $template = "frame.html";
+    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_app');
-        $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()) {