DataObjects/ProjectDirectory.php
[Pman.Core] / Pman.js
diff --git a/Pman.js b/Pman.js
index 16244b8..4af9993 100644 (file)
--- a/Pman.js
+++ b/Pman.js
@@ -771,7 +771,7 @@ Pman = new Roo.Document(
      * Pman.register({
           modKey : '00-admin-xxxx',
           module : Pman.Tab.projectMgr, << really a components..
-           part : [ 'Admin', 'ProjectManager' ]
+          part : [ 'Admin', 'ProjectManager' ]
           moduleOwner : 
           region : 'center',
           parent : Pman.layout
@@ -803,7 +803,7 @@ Pman = new Roo.Document(
         
         if (typeof(obj.part) != 'undefined')  {
             
-            var permname = part.join('.');
+            var permname = obj.part.join('.');
                 // we now have permission...
                 // obj.moduleOwner '.' lname
                 
@@ -812,15 +812,16 @@ Pman = new Roo.Document(
                 Roo.log(permname + " is Disabled for this user");
                 return;
             }
-            
+            if (appDisabled.indexOf(permname) > -1)  {
+                Roo.log(permname + " is Disabled for this site");
+                return;
+            }
             
             
         }
         
         
         
-        
-        
         if (!obj.parent) {
             if (obj.parent === false) {
                 //console.log('skip module (no parent)' + obj.modkey);
@@ -907,6 +908,10 @@ Pman = new Roo.Document(
             if (typeof(mod) == 'function') {
                 mod();
                 
+            } else  if (typeof(mod.region) == 'undefined') {
+                Roo.log("Module does not have region defined, skipping");
+                Roo.log(mod);
+                
             } else  if (mod.parent.layout && !mod.module.disabled) {
                 // honour permname setings..
                 if (mod.permname && mod.permname.length) {
@@ -915,9 +920,7 @@ Pman = new Roo.Document(
                     }
                 } else {
                     mod.module.add(mod.parent.layout, mod.region);    
-                }
-                    
-                 
+                } 
             }