forked from Wavyzz/dolibarr
Amlioration du support UTF-8 pour la gnration des pages Web.
La variable du charset d'affichage qui est mis dna sle fichier config est stock dans l'objet $conf et non en session.
This commit is contained in:
@@ -137,6 +137,7 @@ class MenuLeft {
|
|||||||
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/dict.php", $langs->trans("DictionnarySetup"));
|
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/dict.php", $langs->trans("DictionnarySetup"));
|
||||||
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/const.php", $langs->trans("OtherSetup"));
|
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/const.php", $langs->trans("OtherSetup"));
|
||||||
|
|
||||||
|
$newmenu->add(DOL_URL_ROOT."/admin/system/index.php?leftmenu=system", $langs->trans("DatabaseConnection"));
|
||||||
$newmenu->add(DOL_URL_ROOT."/admin/system/index.php?leftmenu=system", $langs->trans("SystemInfo"));
|
$newmenu->add(DOL_URL_ROOT."/admin/system/index.php?leftmenu=system", $langs->trans("SystemInfo"));
|
||||||
if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/dolibarr.php", $langs->trans("Dolibarr"),1);
|
if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/dolibarr.php", $langs->trans("Dolibarr"),1);
|
||||||
if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/constall.php", $langs->trans("AllParameters"),2);
|
if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/constall.php", $langs->trans("AllParameters"),2);
|
||||||
|
|||||||
@@ -42,12 +42,14 @@ $conffile = "../conf/conf.php";
|
|||||||
$charset="ISO-8859-1";
|
$charset="ISO-8859-1";
|
||||||
if (file_exists($conffile))
|
if (file_exists($conffile))
|
||||||
{
|
{
|
||||||
include_once($conffile);
|
include_once($conffile); // Fichier conf charg<72>
|
||||||
$charset=$character_set_client;
|
$charset=$character_set_client;
|
||||||
if ($dolibarr_main_document_root)
|
if ($dolibarr_main_document_root)
|
||||||
{
|
{
|
||||||
require_once($dolibarr_main_document_root . "/conf/conf.class.php");
|
require_once($dolibarr_main_document_root . "/conf/conf.class.php");
|
||||||
$conf=new Conf();
|
$conf=new Conf();
|
||||||
|
if (! isset($character_set_client) || ! $character_set_client) $character_set_client='ISO-8859-1';
|
||||||
|
$conf->character_set_client=$character_set_client;
|
||||||
}
|
}
|
||||||
if ($dolibarr_main_document_root && $dolibarr_main_db_type && ! defined('DONOTLOADCONF'))
|
if ($dolibarr_main_document_root && $dolibarr_main_db_type && ! defined('DONOTLOADCONF'))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# Dolibarr language file - fr_FR - main
|
# Dolibarr language file - fr_FR - main
|
||||||
charset=iso-8859-1
|
CHARSET=ISO-8859-1
|
||||||
|
DatabaseConnection=Connexion <20> la base
|
||||||
SeparatorDecimal=,
|
SeparatorDecimal=,
|
||||||
SeparatorThousand=
|
SeparatorThousand=
|
||||||
Error=Erreur
|
Error=Erreur
|
||||||
|
|||||||
@@ -1292,7 +1292,7 @@ function accessforbidden($message='',$printheader=1)
|
|||||||
*/
|
*/
|
||||||
function dolibarr_print_error($db='',$error='')
|
function dolibarr_print_error($db='',$error='')
|
||||||
{
|
{
|
||||||
global $langs,$argv;
|
global $conf,$langs,$argv;
|
||||||
$syslog = '';
|
$syslog = '';
|
||||||
|
|
||||||
// Si erreur intervenue avant chargement langue
|
// Si erreur intervenue avant chargement langue
|
||||||
|
|||||||
@@ -199,8 +199,8 @@ class Translate {
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// On stocke toujours dans le tableau Tab en ISO
|
// On stocke toujours dans le tableau Tab en ISO
|
||||||
if ($this->charset_inputfile == 'ISO-8859-1') $value=$value;
|
|
||||||
if ($this->charset_inputfile == 'UTF-8') $value=utf8_decode($value);
|
if ($this->charset_inputfile == 'UTF-8') $value=utf8_decode($value);
|
||||||
|
//if ($this->charset_inputfile == 'ISO-8859-1') $value=$value;
|
||||||
|
|
||||||
$this->setTransFromTab($key,$value);
|
$this->setTransFromTab($key,$value);
|
||||||
}
|
}
|
||||||
@@ -256,7 +256,18 @@ class Translate {
|
|||||||
$newstr=ereg_replace('>','__gt__',$newstr);
|
$newstr=ereg_replace('>','__gt__',$newstr);
|
||||||
$newstr=ereg_replace('"','__quot__',$newstr);
|
$newstr=ereg_replace('"','__quot__',$newstr);
|
||||||
|
|
||||||
|
/*
|
||||||
|
if ($key=='DatabaseConnection') {
|
||||||
|
print utf8_encode($newstr).'-'.$newstr;
|
||||||
|
print '-'.$this->charset_output;
|
||||||
|
print '-'.htmlentities($newstr,ENT_QUOTES,'UTF-8').'<br>';
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
if ($this->charset_output=='UTF-8') $newstr=utf8_encode($newstr);
|
||||||
|
//if ($this->charset_output=='ISO-8859-1') $newstr=$newstr;
|
||||||
|
|
||||||
// Cryptage en html de la chaine
|
// Cryptage en html de la chaine
|
||||||
|
// $newstr est une chaine stockee en memoire au format $this->charset_output
|
||||||
$newstr=htmlentities($newstr,ENT_QUOTES,$this->charset_output);
|
$newstr=htmlentities($newstr,ENT_QUOTES,$this->charset_output);
|
||||||
|
|
||||||
// On restaure les tags HTML
|
// On restaure les tags HTML
|
||||||
|
|||||||
Reference in New Issue
Block a user