Pman.js
[Pman.BAdmin] / Pman.js
1 /**
2  * 
3  *  
4  *  This is the main Pman class [for bootstrap]
5  *
6  *  In theory it's lighter than the original, as no BC concerns..
7  */
8  
9 // translation..
10
11 Roo.namespace('_T');
12
13 //??
14     
15
16 Pman = new Roo.Document(
17 {
18     
19     subMenuItems : [],
20     topMenuItems : [],
21     rightNames: { }, /// register right names here - so they can be translated and rendered.
22     /**
23      * @property {Roo.menu.Menu} pulldownMenu - the 'add menu pulldown, you can use it to add items..
24      *
25      */
26     pulldownMenu : false, 
27     
28     
29     buildCompleted : false, // flag to say if we are building interface..
30     events : {
31         'beforeload' : true, // fired after page ready, before module building.
32         'load' : true, // fired after module building
33         'authrefreshed' : true // fire on auth updated?? - should be on Login?!?!?
34     },
35     
36     onBuildComplete : function ()
37     {
38         
39         this.building = false;   
40         //this.layout.getRegion('center').showPanel(0);
41         //this.layout.endUpdate(); 
42         //this.addTopToolbar();  
43         this.finalize();
44         this.fireEvent('load',this);
45         
46         
47     },
48     listeners : {
49         'ready' : function()
50         {
51             
52             Roo.XComponent.on('buildcomplete',  this.onBuildComplete, this);
53
54             // kludge to fix firebug debugger
55             if (typeof(console) == 'undefined') {
56                 console = { log : function() {  } };
57             }
58             
59             // remove loader..
60             if (Roo.get('loading')) {
61                 Roo.get('loading').remove();
62             }
63             
64             Roo.state.Manager.setProvider(new Roo.state.CookieProvider());
65             
66              
67             // reset password!!!!
68             /*
69             if (showNewPass.length) {
70                 Pman.PasswordChange.show(  { passwordReset : showNewPass },
71                     function(data) {
72                         // fail and success we do  a load...
73                         Pman.Login.onLoad();
74                     }
75                 );
76                 return;
77             }
78             */
79             Pman.Login.onLoad();
80             
81         },
82         'load' : function()
83         {
84             if (Roo.get('loading-logo-tile')) {
85                 Roo.get('loading-logo-tile').remove();
86             }
87             if (Roo.get('loading-logo-tile-top')) {
88                 Roo.get('loading-logo-tile-top').remove();
89             }
90             if (Roo.get('loading-logo-bottom')) {
91                 Roo.get('loading-logo-bottom').remove();
92             }
93             if (Roo.get('loading-logo-center')) {
94                 Roo.get('loading-logo-center').remove();
95             }
96         }   
97         
98     },
99     loadUserInterface : function()
100     {
101         // triggers after authentication verified...
102         
103         
104         
105     }