PHP8
[Pman.BAdmin] / Pman.Tab.js
index 857e62e..82c428d 100644 (file)
@@ -40,6 +40,7 @@ Pman.Tab = new Roo.XComponent({
    center : {
     xtype : 'Region',
     alwaysShowTabs : true,
+    cls : 'pman-admin-center',
     tabPosition : 'top',
     xns : Roo.bootstrap.layout,
     '|xns' : 'Roo.bootstrap.layout'
@@ -64,19 +65,17 @@ Pman.Tab = new Roo.XComponent({
        xtype : 'NavHeaderbar',
        autohide : true,
        brand : '<img   cls="header-logo" src="' +    Roo.BLANK_IMAGE_URL + '">',
-       cls : 'headroom animated slideDown  no-srButton',
+       cls : 'headroom animated slideDown  no-srButton pman-admin-header',
        desktopCenter : false,
        inverse : false,
        position : 'fixed-top',
        srButton : true,
-       style : 'padding-bottom:0px;',
        xns : Roo.bootstrap,
        '|xns' : 'Roo.bootstrap',
        items  : [
         {
          xtype : 'NavGroup',
          align : 'right',
-         style : 'margin-top:0px;margin-bottom:0px;margin-right:17px;',
          type : 'nav',
          xns : Roo.bootstrap,
          '|xns' : 'Roo.bootstrap',
@@ -103,6 +102,7 @@ Pman.Tab = new Roo.XComponent({
             xtype : 'Menu',
             allowDomMove : false,
             cls : 'user-menu',
+            hideTrigger : true,
             listeners : {
              show : function (_self)
               {
@@ -173,6 +173,38 @@ Pman.Tab = new Roo.XComponent({
                       },
                       xns : Roo.bootstrap,
                       '|xns' : 'Roo.bootstrap'
+                     },
+                     {
+                      xtype : 'Column',
+                      md : 12,
+                      xns : Roo.bootstrap,
+                      '|xns' : 'Roo.bootstrap',
+                      items  : [
+                       {
+                        xtype : 'Button',
+                        html : _this._strings['7b7bc2512ee1fedcd76bdc68926d4f7b'] /* Administrator */,
+                        style : 'padding: 0px;text-decoration: none; color:#777;',
+                        weight : 'link',
+                        listeners : {
+                         click : function (_self, e)
+                          {
+                              if(window.location.href.indexOf('_super_admin=1') * 1 != -1) {
+                                  window.open(baseURL,'_self');
+                                  return;
+                              }
+                              
+                              window.open(baseURL + '?_super_admin=1','_self');
+                          },
+                         render : function (_self)
+                          {
+                              _this.super_admin_btn = this;
+                              
+                          }
+                        },
+                        xns : Roo.bootstrap,
+                        '|xns' : 'Roo.bootstrap'
+                       }
+                      ]
                      }
                     ]
                    }
@@ -192,7 +224,7 @@ Pman.Tab = new Roo.XComponent({
                 {
                     _this.super_admin_btn.hide();
                 
-                    if(!Pman.Login.authUser.role.length && Pman.Login.authUser.groups.indexOf('Administrators') * 1 != -1) {
+                    if(Pman.Login.authUser.groups.indexOf('Administrators') * 1 != -1) {
                         _this.super_admin_btn.show();
                     }
                 }
@@ -200,40 +232,6 @@ Pman.Tab = new Roo.XComponent({
               xns : Roo.bootstrap,
               '|xns' : 'Roo.bootstrap',
               items  : [
-               {
-                xtype : 'Row',
-                xns : Roo.bootstrap,
-                '|xns' : 'Roo.bootstrap',
-                items  : [
-                 {
-                  xtype : 'Column',
-                  md : 12,
-                  xns : Roo.bootstrap,
-                  '|xns' : 'Roo.bootstrap',
-                  items  : [
-                   {
-                    xtype : 'Button',
-                    html : _this._strings['7b7bc2512ee1fedcd76bdc68926d4f7b'] /* Administrator */,
-                    style : 'padding: 0px; margin-bottom: 10px; text-decoration: none; color:#777;',
-                    weight : 'link',
-                    listeners : {
-                     click : function (_self, e)
-                      {
-                          window.open(baseURL + '?_super_admin=1','_self');
-                      },
-                     render : function (_self)
-                      {
-                          _this.super_admin_btn = this;
-                          
-                      }
-                    },
-                    xns : Roo.bootstrap,
-                    '|xns' : 'Roo.bootstrap'
-                   }
-                  ]
-                 }
-                ]
-               },
                {
                 xtype : 'Row',
                 xns : Roo.bootstrap,
@@ -256,12 +254,14 @@ Pman.Tab = new Roo.XComponent({
                     listeners : {
                      click : function (e)
                       {
-                      
                           var _self = this;
                           
-                          Pman.Dialog.BAdminPassword.show({ id : Pman.Login.authUser.id }, function(res) {
-                              Roo.bootstrap.MessageBox.alert(_self._change_passwd_success_title, _self._change_passwd_success_body);
-                          });
+                          Pman.Dialog.BAdminPassword.show(
+                              {},
+                              function(res) {
+                                  Roo.bootstrap.MessageBox.alert(_self._change_passwd_success_title, _self._change_passwd_success_body);
+                              }
+                          );
                           
                       }
                     },