PHP8
[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     cls : 'pman-admin-center',
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             hideTrigger : true,
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                       xtype : 'Column',
179                       md : 12,
180                       xns : Roo.bootstrap,
181                       '|xns' : 'Roo.bootstrap',
182                       items  : [
183                        {
184                         xtype : 'Button',
185                         html : _this._strings['7b7bc2512ee1fedcd76bdc68926d4f7b'] /* Administrator */,
186                         style : 'padding: 0px;text-decoration: none; color:#777;',
187                         weight : 'link',
188                         listeners : {
189                          click : function (_self, e)
190                           {
191                               if(window.location.href.indexOf('_super_admin=1') * 1 != -1) {
192                                   window.open(baseURL,'_self');
193                                   return;
194                               }
195                               
196                               window.open(baseURL + '?_super_admin=1','_self');
197                           },
198                          render : function (_self)
199                           {
200                               _this.super_admin_btn = this;
201                               
202                           }
203                         },
204                         xns : Roo.bootstrap,
205                         '|xns' : 'Roo.bootstrap'
206                        }
207                       ]
208                      }
209                     ]
210                    }
211                   ]
212                  }
213                 ]
214                }
215               ]
216              },
217              {
218               xtype : 'MenuItem',
219               cls : 'user-footer',
220               isContainer : true,
221               preventDefault : true,
222               listeners : {
223                childrenrendered : function (_self)
224                 {
225                     _this.super_admin_btn.hide();
226                 
227                     if(Pman.Login.authUser.groups.indexOf('Administrators') * 1 != -1) {
228                         _this.super_admin_btn.show();
229                     }
230                 }
231               },
232               xns : Roo.bootstrap,
233               '|xns' : 'Roo.bootstrap',
234               items  : [
235                {
236                 xtype : 'Row',
237                 xns : Roo.bootstrap,
238                 '|xns' : 'Roo.bootstrap',
239                 items  : [
240                  {
241                   xtype : 'Column',
242                   md : 6,
243                   sm : 6,
244                   xs : 6,
245                   xns : Roo.bootstrap,
246                   '|xns' : 'Roo.bootstrap',
247                   items  : [
248                    {
249                     xtype : 'Button',
250                     _change_passwd_success_body : _this._strings['617114bd6ef10884239510062dffa933'] /* Your password has been changed */,
251                     _change_passwd_success_title : _this._strings['24efa7ee4511563b16144f39706d594f'] /* Notice */,
252                     html : _this._strings['8f1e77e0d2be21da93cd4d9a939148f7'] /* Change Password */,
253                     style : 'text-transform:none;',
254                     listeners : {
255                      click : function (e)
256                       {
257                           var _self = this;
258                           
259                           Pman.Dialog.BAdminPassword.show(
260                               {},
261                               function(res) {
262                                   Roo.bootstrap.MessageBox.alert(_self._change_passwd_success_title, _self._change_passwd_success_body);
263                               }
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 });