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