forked from Wavyzz/dolibarr
Fix: uniform code
replace all $html by $form with exceptions "$htmlname, $htmltooltip"
This commit is contained in:
@@ -55,11 +55,11 @@ function dol_print_file($langs,$filename,$searchalt=0)
|
||||
// Test if file is in lang directory
|
||||
foreach($langs->dir as $searchdir)
|
||||
{
|
||||
$htmlfile=($searchdir."/langs/".$langs->defaultlang."/".$filename);
|
||||
dol_syslog('functions2::dol_print_file search file '.$htmlfile, LOG_DEBUG);
|
||||
if (is_readable($htmlfile))
|
||||
$formfile=($searchdir."/langs/".$langs->defaultlang."/".$filename);
|
||||
dol_syslog('functions2::dol_print_file search file '.$formfile, LOG_DEBUG);
|
||||
if (is_readable($formfile))
|
||||
{
|
||||
$content=file_get_contents($htmlfile);
|
||||
$content=file_get_contents($formfile);
|
||||
$isutf8=utf8_check($content);
|
||||
if (! $isutf8 && $conf->file->character_set_client == 'UTF-8') print utf8_encode($content);
|
||||
elseif ($isutf8 && $conf->file->character_set_client == 'ISO-8859-1') print utf8_decode($content);
|
||||
@@ -70,13 +70,13 @@ function dol_print_file($langs,$filename,$searchalt=0)
|
||||
|
||||
if ($searchalt) {
|
||||
// Test si fichier dans repertoire de la langue alternative
|
||||
if ($langs->defaultlang != "en_US") $htmlfilealt = $searchdir."/langs/en_US/".$filename;
|
||||
else $htmlfilealt = $searchdir."/langs/fr_FR/".$filename;
|
||||
dol_syslog('functions2::dol_print_file search alt file '.$htmlfilealt, LOG_DEBUG);
|
||||
//print 'getcwd='.getcwd().' htmlfilealt='.$htmlfilealt.' X '.file_exists(getcwd().'/'.$htmlfilealt);
|
||||
if (is_readable($htmlfilealt))
|
||||
if ($langs->defaultlang != "en_US") $formfilealt = $searchdir."/langs/en_US/".$filename;
|
||||
else $formfilealt = $searchdir."/langs/fr_FR/".$filename;
|
||||
dol_syslog('functions2::dol_print_file search alt file '.$formfilealt, LOG_DEBUG);
|
||||
//print 'getcwd='.getcwd().' htmlfilealt='.$formfilealt.' X '.file_exists(getcwd().'/'.$formfilealt);
|
||||
if (is_readable($formfilealt))
|
||||
{
|
||||
$content=file_get_contents($htmlfilealt);
|
||||
$content=file_get_contents($formfilealt);
|
||||
$isutf8=utf8_check($content);
|
||||
if (! $isutf8 && $conf->file->character_set_client == 'UTF-8') print utf8_encode($content);
|
||||
elseif ($isutf8 && $conf->file->character_set_client == 'ISO-8859-1') print utf8_decode($content);
|
||||
|
||||
Reference in New Issue
Block a user