Changeset 2687


Ignore:
Timestamp:
05/03/10 10:44:49 (14 years ago)
Author:
rodsouza
Message:

Ticket #1058 - Corrigindo problema criado pelo redirecionamento quando ocorre em background.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r2674 r2687  
    7070                        $target = $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/index.php'; 
    7171 
    72                 echo '<script>XEvents.add( window, "onload", function( ) { var target = window.location.hash; target = ( ( target && target.length > 1 ) ? URL_SERVER + target.substr( 1 ) : "' 
    73                         . $GLOBALS[ 'phpgw' ] -> link( $target ). '" );XLink( target ); } );</script>'; 
     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 ); } )'; 
     74 
     75                if ( array_key_exists( 'HTTP_BACKGROUNDREQUEST', $_SERVER ) || array_key_exists( 'BackgroundRequest', $_GET ) ) 
     76                        $target = "{$target}( true );"; 
     77                else 
     78                        $target = "XEvents.add( window, 'onload', {$target} );"; 
     79 
     80                echo "<script>{$target}</script>"; 
    7481 
    7582                exit; 
Note: See TracChangeset for help on using the changeset viewer.