Ver Mensaje Individual
  #8 (permalink)  
Antiguo 11/04/2013, 11:22
marcoecv
 
Fecha de Ingreso: enero-2013
Mensajes: 21
Antigüedad: 11 años, 3 meses
Puntos: 0
Respuesta: Interfaz Multilenguaje PHP

Les voy a poner mi pagina Master completo para ver si me logro explicar de mejor manera.

Código PHP:
<?php 
include("../../MbeFramework/MbeFramework.php");
import("MbeFramework.Html.HtmlControles.HtmlControles");
import("MbeFramework.Configuracion.ConfigurationSettings");

if(!isset(
$_SESSION)){
    
session_start();
}
/*
if (isset($_GET['lang'])) {
    $_SESSION['lang'] = $_GET['lang'];
}*/

$language "";
if (isset(
$_SESSION['lang'])) {
    
$language $_SESSION['lang'];
}else{
    
$language "es";
    
$_SESSION['lang']=$language;
}

$langFileName "lang_".$language.".php";  
if (!
file_exists('Recursos/Idiomas/'.$langFileName)) {  
    
$langFileName "lang_es.php";  


include_once(
'Recursos/Idiomas/'.$langFileName);  

?>
<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/Dtd/xhtml1-strict.dtd">
<html>
    <head>
         
        <html xml:lang="es" xmlns="http://www.w3.org/1999/xhtml">
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title><?php echo $g_tituloPagina?></title>
        <link rel="stylesheet" href="<?php echo path('Recursos/Estilos/base.css');?>" type="text/css" media="all" />
        <link rel="stylesheet" href="<?php echo path('Recursos/Estilos/smoothness/jquery-ui-1.8.24.custom.css');?>" type="text/css" media="all" />
        <link rel="stylesheet" href="<?php echo path('Recursos/Estilos/jQueryValidationEngine/validationEngine.jquery.css');?>" type="text/css" media="all" />
        <link rel="stylesheet" href="<?php echo path('Recursos/Estilos/jQueryValidationEngine/template.css');?>" type="text/css" media="all" />
        <script type="text/javascript" src="<?php echo path('Recursos/Jslibs/jquery-1.8.2.min.js');?>"></script>
        <script type="text/javascript" src="<?php echo path('Recursos/Jslibs/jquery-ui-1.8.24.custom.min.js');?>"></script>
    <script type="text/javascript" src="<?php echo path('Recursos/Jslibs/jQueryValidationEngine/jquery.validationEngine.js');?>"></script>
        <script type="text/javascript" src="<?php echo path('Recursos/Jslibs/jQueryValidationEngine/languages/jquery.validationEngine-es.js');?>"></script>
        <script type="text/javascript" src="<?php echo path('Recursos/Estilos/menu.js');?>"></script>
        
        <script type="text/javascript" src="<?php echo path('Recursos/ajax.js');?>"></script>
        <script type="text/javascript" src="<?php echo path('Recursos/Imagenes');?>"></script>
    </head>
    <body>
        <?php import("RastreoDePaquetes.Web.Controles.MenuHorizontal");?>
        <?php import("RastreoDePaquetes.Web.Controles.MapaDeSitio", array('g_tituloPagina'=> $g_tituloPagina));?>
        <?php if (isset($menuVertical)) import("RastreoDePaquetes.Web.Controles.MenuVertical", array('menuVertical'=>$menuVertical));?>
        
        <script type="text/javascript">
     
    jQuery(document).ready(function(){
        //validar campos       
        jQuery("#ctl00").validationEngine();
        //mostrar mensaje    
        $(".mensajes").show();
        //setTimeout(function(){ $(".mensajes").fadeOut(1000).fadeIn(1000).fadeOut(500).fadeIn(500).fadeOut(500);},10000); 
        });  
        $(function() {
            $(".datepicker" ).datepicker();
            $('.datepicker').datepicker("setDate", new Date());
            $('.datepicker').datepicker('option', {dateFormat: 'dd/mm/yy'});
                     
        });
        </script>
        <div class="BarraDeIdioma">
            <?php //include_once 'Controles/Idiomas.php'; ?>
            <a href="javascript:return(false)" class="LangBar" lang="en"><img src="<?php echo path('Recursos/Imagenes/imagesidiomas/en.png');?>"/></a>
            <a href="javascript:return(false)" class="LangBar" lang="es"><img src="<?php echo path('Recursos/Imagenes/imagesidiomas/es.png');?>" /></a>
            <script type="text/javascript">
                 $(".LangBar").click(function(){
                     var idioma = $(this).attr("lang");
                     $.get("<?php echo path('Controles/CargarIdioma.php?lang=');?>" + idioma,function(data){
                         alert(data);
                         location.reload();
                     })
                 });
            </script>
        </div>
        <table style="height:20px">
            <tr>
                <td>
                    <img src="<?php echo path('Recursos/Imagenes/mbelogoblack.png');?>" width="100px" alt='MBE' />
                </td>
                <td>
                    <span class="nombreSitioMBE"><?php echo ConfigurationSettings::GetApplicationSetting("NombreDeLaEmpresa"); ?></span>
                    <span class="nombreSitioSistema"><?php echo ConfigurationSettings::GetApplicationSetting("NombreDelSistema"); ?></span>
                </td>
            </tr>
        </table>
        <div id="UIAyudaAusuario" style="display: none" title="Ayuda"> </div>
        <form method="post" action="<?php echo $g_formAction?>" id="ctl00" enctype="multipart/form-data" >
            <?php HtmlControles::Iniciar(); ?>
            <div id="wrapper">
                <br/>
                <br/>
                <br/>
                <br/>
                <h1 style="text-align:center"><?php echo $g_tituloPagina?></h1>
                <br/>
                <div id="content">
                    <?php
                    
if ($g_contenido != null) {
                        echo 
$g_contenido;
                    } else {
                        
header("location:Index.php");
                    }
                    
?>
                </div>
            </div>
        </form>
        <br/>
        <br/>
        <br/>
        
        <?php include_once 'Controles/PieDePagina.php'?>
    </body>
</html>
como ven mi pagina master no es mas que un montón de includes solo que de tipo html, estos estilos y validaciones de jquery si son reconocidos por todas las interfaces, y por eso me extrana muchisimo que un include de php no sea reconocido por la interfaces, de hecho intente hacer el include del archivo de idiomas dentro de la interfaz y sorpresivamente si cargo las constantes pero con una montana de errores que decian que las constantes ya habian sidp previamente definidas...