Merge branch '2014.11' into 2015.11
[tine20] / tine20 / Tinebase / js / MainMenu.js
index 92aa1b1..247c686 100644 (file)
@@ -97,6 +97,7 @@ Tine.Tinebase.MainMenu = Ext.extend(Ext.Toolbar, {
     },
     
     getUserActions: function() {
+
         if (! this.userActions) {
             this.userActions = [
                 this.action_editProfile,
@@ -124,6 +125,14 @@ Tine.Tinebase.MainMenu = Ext.extend(Ext.Toolbar, {
                     this.userActions = this.userActions.concat(this.action_changeUserAccount);
                 }
             }
+            
+            var regItems = Ext.ux.ItemRegistry.itemMap['Tine.Tinebase.MainMenu.userActions'] || [];
+            
+            Ext.each(regItems, function(reg) {
+                var addItem = def = reg.item;
+
+                this.userActions.push(addItem);
+            }, this);
         }
         return this.userActions;
     },
@@ -267,7 +276,7 @@ Tine.Tinebase.MainMenu = Ext.extend(Ext.Toolbar, {
             params : {
                 method : Ext.isObject(Tine.Setup) ? 'Setup.logout' : 'Tinebase.logout'
             },
-            callback : function(options, Success, response) {
+            callback : function(options, success, response) {
                 // clear the authenticated mod_ssl session
                 if (document.all == null) {
                     if (window.crypto && Ext.isFunction(window.crypto.logout)) {
@@ -276,13 +285,16 @@ Tine.Tinebase.MainMenu = Ext.extend(Ext.Toolbar, {
                 } else {
                     document.execCommand('ClearAuthenticationCache');
                 }
-                // remove the event handler
-                // the reload() trigers the unload event
+
+                // the reload() triggers the unload event
                 var redirect = (Tine.Tinebase.registry.get('redirectUrl'));
                 if (redirect && redirect != '') {
-                    window.location = Tine.Tinebase.registry.get('redirectUrl');
+                    Tine.Tinebase.common.reload({
+                        redirectUrl: Tine.Tinebase.registry.get('redirectUrl')
+                    });
                 } else {
-                    window.location.reload();
+                    // registry is cleared before reload
+                    Tine.Tinebase.common.reload({});
                 }
             }
         });