Announcement

Collapse
No announcement yet.

[ANSWERED] Disable UserID as a button in Portal

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [ANSWERED] Disable UserID as a button in Portal

    Is there a way to turn of the ability for a user to have an options menu when they click their userID in the portal?

  • #2
    What options are you wanting to hide from the user? I would assume you would want to keep the logout option.

    Comment


    • #3
      You can do it in the Hook.js via the method "navtoolbarready"

      Example of hiding all items but the logout button;
      Code:
          navtoolbarready : function(toolbar){
              var userButtonMenu = toolbar.down('#userbutton menu'),
                  about,
                  settings,
                  lock;
              if (!Ext.isEmpty(userButtonMenu)){
                  //remove the separators
                  //
                  var separators = userButtonMenu.query('menuseparator');
                  for (var ii=0; ii<separators.length; ii++){
                      separators[ii].destroy();
                  }
      
                  //hide about menu item
                  //
                  about = userButtonMenu.down('#aboutbutton');
                  if (!Ext.isEmpty(about)){
                      about.hide();
                  }
      
                  //hide settings menu item
                  //
                  settings = userButtonMenu.down('#changesettingsbutton');
                  if (!Ext.isEmpty(settings)){
                      settings.hide();
                  }
      
                  //hide lock menu item
                  //
                  lock = userButtonMenu.down('#lockbutton');
                  if (!Ext.isEmpty(lock)){
                      lock.hide();
                  }
              }
          },

      Comment


      • #4
        Thanks! I will give it a try.

        Comment


        • #5
          If I only wanted to do this for a particular user, could I wrap the above code inside the following:
          Code:
          var currentUser = Valence.util.getUserName();
          if(currentUser.toUpperCase() === "ONLINE"){
           ///do stuff
          }

          Comment


          • #6
            Mike,

            That would work for you.

            Comment

            Working...
            X