Pman.Tab.bjs
[Pman.BAdmin] / Pman.Tab.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman');
6
7 Pman.Tab = new Roo.XComponent({
8
9  _strings : {
10   '7b7bc2512ee1fedcd76bdc68926d4f7b' :"Administrator",
11   '0323de4f66a1700e2173e9bcdce02715' :"Logout",
12   '8f1e77e0d2be21da93cd4d9a939148f7' :"Change Password",
13   '617114bd6ef10884239510062dffa933' :"Your password has been changed",
14   '24efa7ee4511563b16144f39706d594f' :"Notice"
15  },
16
17   part     :  ["BAdmin", "Tab" ],
18   order    : '001-Pman.Tab',
19   region   : 'center',
20   parent   : false,
21   name     : "unnamed module",
22   disabled : false, 
23   permname : '', 
24   _tree : function(_data)
25   {
26    var _this = this;
27    var MODULE = this;
28    return {
29    xtype : 'Border',
30    cls : 'pman-admin',
31    el : document.body,
32    is_root : true,
33    listeners : {
34     render : function (_self)
35      {
36      
37      }
38    },
39    xns : Roo.bootstrap.layout,
40    '|xns' : 'Roo.bootstrap.layout',
41    center : {
42     xtype : 'Region',
43     alwaysShowTabs : true,
44     tabPosition : 'top',
45     xns : Roo.bootstrap.layout,
46     '|xns' : 'Roo.bootstrap.layout'
47    },
48    north : {
49     xtype : 'Region',
50     height : 50,
51     hideTabs : true,
52     overflow : 'visible',
53     xns : Roo.bootstrap.layout,
54     '|xns' : 'Roo.bootstrap.layout'
55    },
56    items  : [
57     {
58      xtype : 'Content',
59      fitContainer : true,
60      region : 'north',
61      xns : Roo.bootstrap.panel,
62      '|xns' : 'Roo.bootstrap.panel',
63      items  : [
64       {
65        xtype : 'NavHeaderbar',
66        autohide : true,
67        brand : '<img   cls="header-logo" src="' +    Roo.BLANK_IMAGE_URL + '">',
68        cls : 'headroom animated slideDown  no-srButton pman-admin-header',
69        desktopCenter : false,
70        inverse : false,
71        position : 'fixed-top',
72        srButton : true,
73        xns : Roo.bootstrap,
74        '|xns' : 'Roo.bootstrap',
75        items  : [
76         {
77          xtype : 'NavGroup',
78          align : 'right',
79          type : 'nav',
80          xns : Roo.bootstrap,
81          '|xns' : 'Roo.bootstrap',
82          items  : [
83           {
84            xtype : 'NavItem',
85            html : Pman.Login.authUser.name + '<span style="margin-left: 5px;" class="badge badge-primary"></span>',
86            icon : 'fa fa-user',
87            preventDefault : true,
88            updateBadge : function() { },
89            listeners : {
90             render : function (_self)
91              {
92                  _this.user_box = this;
93                  
94                  this.el.setVisibilityMode(Roo.Element.DISPLAY);
95                  
96                  this.el.show();
97              }
98            },
99            xns : Roo.bootstrap,
100            '|xns' : 'Roo.bootstrap',
101            menu : {
102             xtype : 'Menu',
103             allowDomMove : false,
104             cls : 'user-menu',
105             listeners : {
106              show : function (_self)
107               {
108                   var width = Roo.lib.Dom.getViewWidth();
109                   
110                   var xy = this.el.getXY();
111                   this.el.setStyle('position', 'absolute');
112                   
113                   if(width < 480){
114                       xy[0] = 0;
115                       this.el.setXY(xy);
116                       this.el.setStyle('width', width + 'px');
117                   }
118               }
119             },
120             xns : Roo.bootstrap,
121             '|xns' : 'Roo.bootstrap',
122             items  : [
123              {
124               xtype : 'MenuItem',
125               cls : 'user-body',
126               isContainer : true,
127               preventDefault : true,
128               xns : Roo.bootstrap,
129               '|xns' : 'Roo.bootstrap',
130               items  : [
131                {
132                 xtype : 'Row',
133                 xns : Roo.bootstrap,
134                 '|xns' : 'Roo.bootstrap',
135                 items  : [
136                  {
137                   xtype : 'Column',
138                   md : 12,
139                   xns : Roo.bootstrap,
140                   '|xns' : 'Roo.bootstrap',
141                   items  : [
142                    {
143                     xtype : 'Row',
144                     xns : Roo.bootstrap,
145                     '|xns' : 'Roo.bootstrap',
146                     items  : [
147                      {
148                       xtype : 'Column',
149                       cls : 'text-primary',
150                       md : 12,
151                       listeners : {
152                        render : function (_self)
153                         {
154                             this.el.dom.innerHTML = '<b>' + Pman.Login.authUser.name + '</b>';
155                             
156                         }
157                       },
158                       xns : Roo.bootstrap,
159                       '|xns' : 'Roo.bootstrap'
160                      },
161                      {
162                       xtype : 'Column',
163                       md : 12,
164                       style : 'color:#777;',
165                       listeners : {
166                        render : function (_self)
167                         {
168                            
169                             this.el.dom.innerHTML = Pman.Login.authUser.email;
170                             
171                         }
172                       },
173                       xns : Roo.bootstrap,
174                       '|xns' : 'Roo.bootstrap'
175                      },
176                      {
177                       xtype : 'Column',
178                       md : 12,
179                       xns : Roo.bootstrap,
180                       '|xns' : 'Roo.bootstrap',
181                       items  : [
182                        {
183                         xtype : 'Button',
184                         html : _this._strings['7b7bc2512ee1fedcd76bdc68926d4f7b'] /* Administrator */,
185                         style : 'padding: 0px;text-decoration: none; color:#777;',
186                         weight : 'link',
187                         listeners : {
188                          click : function (_self, e)
189                           {
190                               if(window.location.href.indexOf('_super_admin=1') * 1 != -1) {
191                                   window.open(baseURL,'_self');
192                                   return;
193                               }
194                               
195                               window.open(baseURL + '?_super_admin=1','_self');
196                           },
197                          render : function (_self)
198                           {
199                               _this.super_admin_btn = this;
200                               
201                           }
202                         },
203                         xns : Roo.bootstrap,
204                         '|xns' : 'Roo.bootstrap'
205                        }
206                       ]
207                      }
208                     ]
209                    }
210                   ]
211                  }
212                 ]
213                }
214               ]
215              },
216              {
217               xtype : 'MenuItem',
218               cls : 'user-footer',
219               isContainer : true,
220               preventDefault : true,
221               listeners : {
222                childrenrendered : function (_self)
223                 {
224                     _this.super_admin_btn.hide();
225                 
226                     if(Pman.Login.authUser.groups.indexOf('Administrators') * 1 != -1) {
227                         _this.super_admin_btn.show();
228                     }
229                 }
230               },
231               xns : Roo.bootstrap,
232               '|xns' : 'Roo.bootstrap',
233               items  : [
234                {
235                 xtype : 'Row',
236                 xns : Roo.bootstrap,
237                 '|xns' : 'Roo.bootstrap',
238                 items  : [
239                  {
240                   xtype : 'Column',
241                   md : 6,
242                   sm : 6,
243                   xs : 6,
244                   xns : Roo.bootstrap,
245                   '|xns' : 'Roo.bootstrap',
246                   items  : [
247                    {
248                     xtype : 'Button',
249                     _change_passwd_success_body : _this._strings['617114bd6ef10884239510062dffa933'] /* Your password has been changed */,
250                     _change_passwd_success_title : _this._strings['24efa7ee4511563b16144f39706d594f'] /* Notice */,
251                     html : _this._strings['8f1e77e0d2be21da93cd4d9a939148f7'] /* Change Password */,
252                     style : 'text-transform:none;',
253                     listeners : {
254                      click : function (e)
255                       {
256                       
257                           var _self = this;
258                           
259                           Pman.Dialog.BAdminPassword.show({ id : Pman.Login.authUser.id }, function(res) {
260                               Roo.bootstrap.MessageBox.alert(_self._change_passwd_success_title, _self._change_passwd_success_body);
261                           });
262                           
263                       }
264                     },
265                     xns : Roo.bootstrap,
266                     '|xns' : 'Roo.bootstrap'
267                    }
268                   ]
269                  },
270                  {
271                   xtype : 'Column',
272                   md : 6,
273                   sm : 6,
274                   style : 'text-align: right;',
275                   xs : 6,
276                   xns : Roo.bootstrap,
277                   '|xns' : 'Roo.bootstrap',
278                   items  : [
279                    {
280                     xtype : 'Button',
281                     html : _this._strings['0323de4f66a1700e2173e9bcdce02715'] /* Logout */,
282                     style : 'text-transform:none;',
283                     listeners : {
284                      click : function (e)
285                       {
286                           window.onbeforeunload = false;
287                           
288                           
289                           Roo.Ajax.request({
290                                   url : baseURL + '/Login',
291                                   method: 'POST',
292                                   params : { 
293                                       logout : 1
294                                   },
295                                   success : function()
296                                   {
297                                       location.href = baseURL;
298                                   }
299                               });
300                       
301                       }
302                     },
303                     xns : Roo.bootstrap,
304                     '|xns' : 'Roo.bootstrap'
305                    }
306                   ]
307                  }
308                 ]
309                }
310               ]
311              }
312             ]
313            }
314           }
315          ]
316         }
317        ]
318       }
319      ]
320     }
321    ]
322   };  }
323 });