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