DataObjects/core.sql
[Pman.Core] / Pman.js
diff --git a/Pman.js b/Pman.js
index 5c62830..a444578 100644 (file)
--- a/Pman.js
+++ b/Pman.js
@@ -19,7 +19,7 @@ if (typeof(_T) == 'undefined') { _T={};}
  
 
 
-Roo.XComponent.on('register', function(e) { return Pman.xregister(e); });
+Roo.XComponent.on('register', function(e) { if (typeof(Pman) != 'undefined') { return Pman.xregister(e); } });
 Roo.XComponent.on('buildComplete',  
      function() {
                     
@@ -116,7 +116,7 @@ Pman = new Roo.Document(
         
     },
    
-    fakeRoot :  {
+    fakeRoot :  new Roo.XComponent( {
         modKey : '000',
         module : 'Pman',
         region : 'center',
@@ -124,8 +124,9 @@ Pman = new Roo.Document(
         isTop : true,
         name : "Pman Base",
         disabled : false, 
-        permname: '' 
-    },
+        permname: '' ,
+        render : function (el) { this.el = this.layout; }
+    }),
     
     layout: false,
     
@@ -173,13 +174,14 @@ Pman = new Roo.Document(
             }
             
         });
-        
-        
+        this.fakeRoot.layout = this.layout;
+        /*
         Pman.register( Roo.apply(this.fakeRoot, {
             layout : this.layout      
                 
                                  
         } ) );
+        */
         
         // creates all the modules ready to load..
         
@@ -837,7 +839,8 @@ Pman = new Roo.Document(
         }
         
         
-        if (obj.parent === Pman) {
+        if (obj.parent === Pman || obj.parent  == 'Pman') {
+            Roo.log("PARENT OF : " + obj.name + " replacing with fake");
             obj.parent = Pman.fakeRoot;
         }
         
@@ -918,12 +921,15 @@ Pman = new Roo.Document(
            // honour DEPRICATED permname setings..
            // new code should use PART name, and matching permissions.
             if (this.permname && this.permname.length) {
-                if (Pman.hasPerm(this.permname, 'S')) {
-                   this.add(this.parent.layout, this.region);    
+                if (!Pman.hasPerm(this.permname, 'S')) {
+                    return;
                 }
-                return;
+                
             }
-            this.add(this.parent.layout, this.region);    
+            this.add(this.parent.layout, this.region);
+            this.el = this.layout;
+            
+            
               
         };
         // map some of the standard properties..