Changeset 2691


Ignore:
Timestamp:
05/03/10 14:51:33 (14 years ago)
Author:
rodsouza
Message:

Ticket #1058 - Corrigindo com loop infinito no 'redirect'.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/inc/class.uiapplications.inc.php

    r2686 r2691  
    389389                        $GLOBALS['phpgw']->template->pparse('phpgw_body','body'); 
    390390                } 
    391                  
    392                 function register_all_hooks() 
    393                 { 
    394                         if ($GLOBALS['phpgw']->acl->check('applications_access',16,'admin')) 
    395                         { 
    396                                 $GLOBALS['phpgw']->redirect_link('/'); 
    397                         } 
    398                         if (!is_object($GLOBALS['phpgw']->hooks)) 
    399                         { 
    400                                 $GLOBALS['phpgw']->hooks = CreateObject('phpgwapi.hooks'); 
    401                         } 
    402                         $GLOBALS['phpgw']->hooks->register_all_hooks(); 
    403                          
    404                         $GLOBALS['phpgw']->redirect_link('/admin/'); 
     391 
     392                function register_all_hooks( ) 
     393                { 
     394                        if ( ! $GLOBALS[ 'phpgw' ] -> acl -> check( 'applications_access', 16, 'admin' ) ) 
     395                        { 
     396                                if ( ! is_object( $GLOBALS[ 'phpgw' ] -> hooks ) ) 
     397                                        $GLOBALS[ 'phpgw' ] -> hooks = CreateObject( 'phpgwapi.hooks' ); 
     398 
     399                                $GLOBALS[ 'phpgw' ] -> hooks -> register_all_hooks( ); 
     400                        } 
     401 
     402                        $GLOBALS[ 'phpgw' ] -> redirect_link( '/' ); 
    405403                } 
    406404        } 
  • trunk/index.php

    r2687 r2691  
    7070                        $target = $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/index.php'; 
    7171 
    72                 $target = '( function( ){ var target = window.location.hash; target = ( ( ! arguments.length ) && ( target && target.length > 1 ) ? URL_SERVER + target.substr( 1 ) : "' 
    73                         . $GLOBALS[ 'phpgw' ] -> link( $target ). '" ); XLink( target ); } )'; 
     72                $target = '( function( ){ var target = window.location.hash; target = (' 
     73                        . '( arguments.length && ( target && target.length > 1 ) ) ?' 
     74                        . 'URL_SERVER + target.substr( 1 ) : "' . $GLOBALS[ 'phpgw' ] -> link( $target ). '" ); XLink( target ); } )'; 
    7475 
    7576                if ( array_key_exists( 'HTTP_BACKGROUNDREQUEST', $_SERVER ) || array_key_exists( 'BackgroundRequest', $_GET ) ) 
    76                         $target = "{$target}( true );"; 
     77                        $target = "{$target}( );"; 
    7778                else 
    7879                        $target = "XEvents.add( window, 'onload', {$target} );"; 
  • trunk/phpgwapi/js/tools/xlink.js

    r2686 r2691  
    99        _loading.src = URL_SERVER + 'phpgwapi/images/loading.gif'; 
    1010 
     11        var _last_request = null; 
     12 
    1113        function _click( _action, _cache ) 
    1214        { 
     
    1416                        _action = window.location.protocol + '//' + window.location.host + _action; 
    1517 
    16                 _divAppboxHeader.innerHTML = ''; 
     18                if ( _action == _last_request ) 
     19                        return false; 
    1720 
    18                 var _center = document.createElement( 'center' ); 
    19                 _center.appendChild( _loading ); 
     21                if ( _divAppboxHeader ) 
     22                        _divAppboxHeader.innerHTML = ''; 
    2023 
    21                 _container.innerHTML = ''; 
    22                 _container.appendChild( _center ); 
     24                if ( _container ) 
     25                { 
     26                        var _center = document.createElement( 'center' ); 
     27                        _center.appendChild( _loading ); 
     28 
     29                        _container.innerHTML = ''; 
     30                        _container.appendChild( _center ); 
     31                } 
    2332 
    2433                _connector.go( 
     
    2837                        'handler' : _handler 
    2938                } ); 
     39 
     40                _last_request = _action; 
    3041 
    3142                window.location = '#' + ( 
Note: See TracChangeset for help on using the changeset viewer.