X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=Pman.register.js;h=05d44bbcbbbcbbd0d37582e16a6fa0ad1e1d8e0d;hp=9facedfa15092ee3b062783aea1ae7046e077796;hb=586e4eb470252d837ba18b67e4c3c1702131fd1d;hpb=7824635d37d66abe218d06ae26d52aa4b8e8edca 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