Ignore:
Timestamp:
06/06/08 13:54:09 (16 years ago)
Author:
niltonneto
Message:

Correçoes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/instant_messenger/inc/im_acl.inc.php

    r287 r305  
    33$size_of_acl = sizeof($GLOBALS['phpgw_info']['user']['acl']); 
    44 
    5 # percorre a ACL até o fim ou até encontrar a entrada para o módulo de mensagem instantânea 
     5# percorre a ACL até o fim ou até encontrar a entrada para o módulo de mensagem instantânea 
    66for ( $i = 0; $i < $size_of_acl && $GLOBALS['phpgw_info']['user']['acl'][$i]['appname'] != 'instant_messenger'; $i++ ); 
    77 
    8 # verifica se foi encontrada a permissão para o módulo de mensagem instantânea 
     8# verifica se foi encontrada a permissão para o módulo de mensagem instantânea 
    99if ( $GLOBALS['phpgw_info']['user']['acl'][$i]['appname'] == 'instant_messenger' ) 
    1010{ 
    11         $webserver_url_im = $GLOBALS['phpgw_info']['server']['webserver_url']; 
    12         $webserver_url_im = ( !empty($webserver_url_im) ) ? $webserver_url_im : '/'; 
     11        $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url']; 
     12        $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/'; 
    1313 
    14         if ( strrpos($webserver_url_im, '/') === false || strrpos($webserver_url_im, '/') != (strlen($webserver_url_im) - 1) ) 
    15                 $webserver_url_im .= '/'; 
     14        if ( strrpos($webserver_url, '/') === false || strrpos($webserver_url, '/') != (strlen($webserver_url) - 1) ) 
     15                $webserver_url .= '/'; 
    1616 
    17         $webserver_url_im = $webserver_url_im . 'instant_messenger/'; 
     17        $webserver_url = $webserver_url . 'instant_messenger/'; 
    1818 
    1919        require_once PHPGW_SERVER_ROOT . '/instant_messenger/inc/im_sessions.inc.php'; 
    20         require_once PHPGW_SERVER_ROOT . '/instant_messenger/inc/load_lang.php'; 
     20        //require_once PHPGW_SERVER_ROOT . '/instant_messenger/inc/load_lang.php'; 
    2121 
    2222        $js = array( 
    2323                'connector', 
     24                'xtools', 
     25                'windows', 
    2426                'jabber', 
    25                 'xtools', 
    2627                'client', 
    27                 'images', 
     28                /*'images', 
    2829                'dragdrop', 
    29                 'build_win', 
    30                 'templates', 
    31                 'fcommon', 
    32                 'menu_action', 
     30                'templates',*/ 
     31                #'fcommon', 
     32                /*'menu_action', 
    3333                'functions', 
    3434                'images', 
    3535                'cookies_im', 
    36                 'load', 
     36                'load',*/ 
    3737        ); 
    3838 
    39         print '<script type="text/javascript">var path_im = "'.$webserver_url_im.'";</script>'; 
     39        print '<script type="text/javascript">var path_im = "'.$webserver_url.'";</script>'; 
    4040 
     41        #require_once dirname(__FILE__) . '/Controller.class.php'; 
    4142 
    42         require_once dirname(__FILE__) . '/Controller.class.php'; 
     43        #$controller = new Controller; 
     44        #$script = ''; 
     45        #foreach ( $js as $key => $val ) 
     46        #{ 
     47        #       $val = array('act' => 'j.' . $val); 
     48        #       $script .= $controller->exec($val); 
     49        #} 
    4350 
    44         $controller = new Controller; 
    45         $script = ''; 
    46         foreach ( $js as $key => $val ) 
    47         { 
    48                 $val = array('act' => 'j.' . $val); 
    49                 $script .= $controller->exec($val); 
    50         } 
     51        //printf("<script type=\"text/javascript\">%s</script>", $script); 
    5152 
    52         printf("<script type=\"text/javascript\">%s</script>", $script); 
     53        print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/window.css">'; 
     54        print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/chat.css">'; 
     55        print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/common.css">'; 
    5356 
    54         print '<link rel="stylesheet" type="text/css" href="' . $webserver_url_im . 'templates/default/css/window.css">'; 
    55         print '<link rel="stylesheet" type="text/css" href="' . $webserver_url_im . 'templates/default/css/chat.css">'; 
    56         print '<link rel="stylesheet" type="text/css" href="' . $webserver_url_im . 'templates/default/css/common.css">'; 
    57  
    58         # trecho de código javascript utilizado para 
    59         # controle de possí­vel erro no load do script 
    60         # feito acima e está sendo inserido via PHP 
    61         # pois é um complemento do procedimento acima 
    62         $init_client  = '<script type="text/javascript">'; 
    63         $init_client .= '       function im_init(pTimes)'; 
    64         $init_client .= '       {'; 
    65         $init_client .= '               if ( !pTimes )'; 
    66         $init_client .= '                       pTimes = 0;'; 
    67         $init_client .= '               if ( pTimes == 5 )'; 
    68         $init_client .= '                       return false;'; 
    69         $init_client .= '               if ( window.client )'; 
    70         $init_client .= '                       client();'; 
    71         $init_client .= '               else'; 
    72         $init_client .= '                       setTimeout("im_init("+(++pTimes)+")", (pTimes + 1) * 2000);'; 
    73         $init_client .= '       }'; 
    74         $init_client .= '       im_init();'; 
    75         $init_client .= '</script>'; 
    76         printf("%s", $init_client); 
     57        # trecho de código javascript utilizado para 
     58        # controle de possível erro no load do script 
     59        # feito acima e está sendo inserido via PHP 
     60        # pois é um complemento do procedimento acima 
     61        #$init_client  = '<script type="text/javascript">'; 
     62        #$init_client .= '      function im_init(pTimes)'; 
     63        #$init_client .= '      {'; 
     64        #$init_client .= '              if ( !pTimes )'; 
     65        #$init_client .= '                      pTimes = 0;'; 
     66        #$init_client .= '              if ( pTimes == 5 )'; 
     67        #$init_client .= '                      return false;'; 
     68        #$init_client .= '              if ( window.InstantMessengerClient )'; 
     69        #$init_client .= '                      InstantMessengerClient();'; 
     70        #$init_client .= '              else'; 
     71        #$init_client .= '                      setTimeout("im_init("+(++pTimes)+")", (pTimes + 1) * 2000);'; 
     72        #$init_client .= '      }'; 
     73        #$init_client .= '      var bkp_onload = window.onload;'; 
     74        #$init_client .= '      window.onload = function(){if (typeof bkp_onload == "function") bkp_onload();setTimeout("im_init()",10000);};'; 
     75        #$init_client .= '</script>'; 
     76        //printf("%s", $init_client); 
     77        echo '<iframe style="display:none" height="100%" !width="100%" src="'.$webserver_url.'client.php"></iframe>'; 
    7778} 
    7879?> 
Note: See TracChangeset for help on using the changeset viewer.