Changeset 2608


Ignore:
Timestamp:
04/20/10 16:39:19 (14 years ago)
Author:
rodsouza
Message:

Ticket #1009 - Garantindo que a variável URL_SERVER esteja populada.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/load_lang.php

    r2573 r2608  
    1818                $lang = $_SESSION[ 'phpgw_info' ][ 'expressomail' ][ 'user' ][ 'preferences' ][ 'common' ][ 'lang' ]; 
    1919} 
    20 session_write_close(); 
    2120 
    2221$array_keys = array(); 
  • trunk/filemanager/inc/class.uifilemanager.inc.php

    r2490 r2608  
    325325                        //$GLOBALS['phpgw']->common->phpgw_header(); 
    326326 
    327                         echo "<script src='{$GLOBALS['phpgw'] -> link( '/filemanager/js/global.js' )}'></script>"; 
    328                         echo "<script src='{$GLOBALS['phpgw'] -> link( '/filemanager/js/main.js' )}'></script>"; 
    329                         echo "<script src='{$GLOBALS['phpgw'] -> link( '/filemanager/js/common_functions.js' )}'></script>"; 
    330                         echo "<script src='{$GLOBALS['phpgw'] -> link( '/filemanager/js/connector.js' )}'></script>"; 
    331                         echo "<script src='{$GLOBALS['phpgw'] -> link( '/filemanager/js/draw_api.js' )}'></script>"; 
    332                         echo "<script src='{$GLOBALS['phpgw'] -> link( '/filemanager/js/drag_area.js' )}'></script>"; 
    333                         echo "<script src='{$GLOBALS['phpgw'] -> link( '/filemanager/js/handler.js' )}'></script>"; 
    334                         echo "<script src='{$GLOBALS['phpgw'] -> link( '/phpgwapi/js/dftree/dftree.js' )}'></script>"; 
    335  
    336                         include('load_lang.php'); 
     327                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'dftree', 'dftree' ); 
     328 
     329                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'jscode', 'global', 'filemanager' ); 
     330                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'jscode', 'load_lang', 'filemanager' ); 
     331                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'jscode', 'main', 'filemanager' ); 
     332                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'jscode', 'common_functions', 'filemanager' ); 
     333                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'jscode', 'connector', 'filemanager' ); 
     334                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'jscode', 'draw_api', 'filemanager' ); 
     335                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'jscode', 'drag_area', 'filemanager' ); 
     336                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'jscode', 'handler', 'filemanager' ); 
     337 
     338                        //include('load_lang.php'); 
    337339 
    338340                        # Page to process users 
     
    603605                                $_SESSION['phpgw_info']['filemanager']['user']['sec_key'] = $key; 
    604606                                $vars['sec_key']='<input type="hidden" id="userKey" value=\''.$key.'\'>'; 
    605                                 $vars['script']='<script>initDrawApi();</script>'; 
    606                                  
     607 
     608                                $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script' ] .=  '<script>' 
     609                                        . ( ( array_key_exists( 'HTTP_BACKGROUNDREQUEST', $_SERVER ) || array_key_exists( 'BackgroundRequest', $_GET ) ) ? 'initDrawApi( )' : 'XEvents.add( window, "onload", initDrawApi )' ) 
     610                                        . ';</script>'; 
     611 
    607612                                $vars['new_button']=$this->toolButton('new','createfile',lang('New...')); 
    608613                                $vars['new_button'].='<input type="hidden" id="newfile_or_dir" name="newfile_or_dir" value="" />'; 
    609                                  
     614 
    610615                                // reload button with this url 
    611616                                $vars['refresh_button']=$this->toolButton('reload','reload',lang('reload')); 
  • trunk/filemanager/inc/load_lang.php

    r2362 r2608  
    11<?php 
    22 
    3         /*************************************************************************** 
    4         * Expresso Livre                                                           * 
    5         * http://www.expressolivre.org                                             * 
    6         * --------------------------------------------                             * 
    7         *  This program is free software; you can redistribute it and/or modify it * 
    8         *  under the terms of the GNU General Public License as published by the   * 
    9         *  Free Software Foundation; either version 2 of the License, or (at your  * 
    10         *  option) any later version.                                              * 
    11         \**************************************************************************/ 
    12         $array_keys = array(); 
    13         $fn = $GLOBALS['phpgw_info']['flags']['currentapp'].'/setup/phpgw_'.$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'].'.lang'; 
    14         if (file_exists($fn)){ 
    15                         $fp = fopen($fn,'r'); 
    16                 while ($data = fgets($fp,16000)){ 
    17                         list($message_id,$app_name,$null,$content) = explode("\t",substr($data,0,-1)); 
    18                         $script .= "array_lang['".str_replace("'","\'",strtolower($message_id))."'] = '".str_replace("'","\'",$content)."';\n"; 
    19                 } 
    20                 fclose($fp); 
     3/**************************************************************************\ 
     4* Expresso Livre                                                           * 
     5* http://www.expressolivre.org                                             * 
     6* --------------------------------------------                             * 
     7*  This program is free software; you can redistribute it and/or modify it * 
     8*  under the terms of the GNU General Public License as published by the   * 
     9*  Free Software Foundation; either version 2 of the License, or (at your  * 
     10*  option) any later version.                                              * 
     11\**************************************************************************/ 
     12 
     13if ( array_key_exists( 'lang', $_GET ) ) 
     14        $lang = $_GET[ 'lang' ]; 
     15else 
     16{ 
     17        if ( isset( $_SESSION[ 'phpgw_info' ][ 'expressomail' ][ 'user' ][ 'preferences' ][ 'common' ][ 'lang' ] ) ) 
     18                $lang = $_SESSION[ 'phpgw_info' ][ 'expressomail' ][ 'user' ][ 'preferences' ][ 'common' ][ 'lang' ]; 
     19} 
     20 
     21$array_keys = array(); 
     22$fn = dirname( __FILE__ ) . "/../setup/phpgw_{$lang}.lang"; 
     23$lang = array( ); 
     24 
     25if ( file_exists( $fn ) ) 
     26{ 
     27        $fp = fopen( $fn, 'r' ); 
     28        while ( $data = fgets( $fp, 16000 ) ) 
     29        { 
     30                list( $message_id, $app_name, $null, $content ) = explode( "\t", substr( $data, 0, -1 ) ); 
     31                $lang[ ] = '"' . str_replace( '"', '\"', strtolower( $message_id ) ) . '" : "' . str_replace( '"', '\"', $content ) . '"'; 
    2132        } 
    22         echo "<script type='text/javascript'>var array_lang = new Array(); $script</script>"; 
     33        fclose($fp); 
     34} 
     35 
     36echo '{' . implode( ",\n", $lang ) . '}' 
     37 
    2338?> 
  • trunk/filemanager/js/draw_api.js

    r2490 r2608  
    149149 
    150150function initDrawApi(){ 
     151        alert(''); 
    151152        SecEl = document.getElementById('userKey'); 
    152153        crypt = new crypt(SecEl.value); 
  • trunk/filemanager/setup/phpgw_pt-br.lang

    r2204 r2608  
    7272file name       filemanager     pt-br   Nome do Arquivo 
    7373file names cannot contain "%1"  filemanager     pt-br   Nomes de arquivos não podem conter "%1" 
    74 file names cannot contain \ or /        filemanager     pt-br   Nomes de arquivos não podem conter \ ou / 
     74file names cannot contain \\ or /       filemanager     pt-br   Nomes de arquivos não podem conter \\ ou / 
    7575filemanager     common  pt-br   Gerenciador de Arquivos 
    7676filemanager preferences filemanager     pt-br   Preferências para Gerenciador de Arquivos 
  • trunk/filemanager/templates/default/main.tpl

    r2490 r2608  
    6666{preferences} 
    6767{sec_key} 
    68 {script} 
    6968<!-- END filemanager_footer --> 
  • trunk/phpgwapi/inc/class.common.inc.php

    r2561 r2608  
    388388                                        $GLOBALS['phpgw_info']['flags']['java_script_thirst'] .= '<script type="text/javascript">var URL_SERVER = "' 
    389389                                                . $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ] . '";' 
    390                                                 . 'var template = "' . $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ] . '";</script>'; 
     390                                                . 'var template = "' . ( ( ! empty( $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ] ) ) ? $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ] : '/' ) 
     391                                                . '";</script>'; 
    391392 
    392393                                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'wz_dragdrop', 'wz_dragdrop', NULL, true ); 
  • trunk/phpgwapi/inc/class.javascript.inc.php

    r2595 r2608  
    33  * eGroupWare API - JavaScript                                              * 
    44  * Written by Dave Hall skwashd at phpgroupware.org                         * 
    5   * Copyright (C) 2003 Free Software Foundation Inc                          *           
     5  * Copyright (C) 2003 Free Software Foundation Inc                          * 
    66  * -------------------------------------------------------------------------* 
    77  * This library is part of the eGroupWare API                               * 
    8   * http://www.egroupware.org/api                                            *  
     8  * http://www.egroupware.org/api                                            * 
    99  * ------------------------------------------------------------------------ * 
    1010  *  This program is Free Software; you can redistribute it and/or modify it * 
Note: See TracChangeset for help on using the changeset viewer.