From 72fafbe9b7e8d2d6da77c1b5d9c7a300bc8ca05a Mon Sep 17 00:00:00 2001 From: edward Date: Thu, 13 Jul 2017 16:57:28 +0800 Subject: [PATCH] Pman.register.js --- Pman.register.js | 80 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 76 insertions(+), 4 deletions(-) diff --git a/Pman.register.js b/Pman.register.js index 9facedfa..05d44bbc 100644 --- a/Pman.register.js +++ b/Pman.register.js @@ -1,7 +1,79 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. +/** + * DEPRICATED : use Roo.XComponents now.. + * + * Pman.register({ + modKey : '00-admin-xxxx', + module : Pman.Tab.projectMgr, << really a components.. + part : [ 'Admin', 'ProjectManager' ] + moduleOwner : + region : 'center', + parent : Pman.layout + }) + * */ +Pman.register = function (obj) +{ + //this.xregister(obj); + + // old style calls go in here.. + // we need to convert the object so that it looks a bit like an XCompoenent.. + + obj.render = function () + { + if (!this.parent) { + Roo.log("Skip module, as parent does not exist"); + Roo.log(this); + return; + } + //if (typeof(mod) == 'function') { + // mod(); + + if (typeof (this.region) == 'undefined') { + Roo.log("Module does not have region defined, skipping"); + Roo.log(this); + return; + } + if (this.module.disabled) { + Roo.log("Module disabled, should not rendering"); + Roo.log(this); + return; + } + + if (!this.parent.layout) { + Roo.log("Module parent does not have property layout."); + Roo.log(this); + return; + } + + // 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')) { + return; + } + + } + this.add(this.parent.layout, this.region); + this.el = this.layout; + + + + }; + // map some of the standard properties.. + obj.order = obj.modKey; + + // a bit risky... + + + + // the other issue we have is that + + + // Roo.log("CALLING XComponent register with : " + obj.name); + Roo.log(obj); + // this will call xregister as it's the on.register handler.. + Roo.XComponent.register(obj.isTop ? obj : Roo.apply(obj.module, obj)); + +} \ No newline at end of file -- 2.39.2