Fix: optimize code, use json
This commit is contained in:
parent
46057271f2
commit
afc6f28a03
@ -989,12 +989,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
$langs->trans("December")
|
$langs->trans("December")
|
||||||
);
|
);
|
||||||
print '<script type="text/javascript">';
|
print '<script type="text/javascript">';
|
||||||
print 'var tradMonths = [';
|
print 'var tradMonths = '.json_encode($tradMonths).';';
|
||||||
foreach($tradMonths as $month)
|
|
||||||
{
|
|
||||||
print '"'.addslashes($month).'",';
|
|
||||||
}
|
|
||||||
print '""];';
|
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
|
|
||||||
// Define tradMonthsMin javascript array (we define this in datapicker AND in parent page to avoid errors with IE8)
|
// Define tradMonthsMin javascript array (we define this in datapicker AND in parent page to avoid errors with IE8)
|
||||||
@ -1012,12 +1007,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
$langs->trans("DecemberMin")
|
$langs->trans("DecemberMin")
|
||||||
);
|
);
|
||||||
print '<script type="text/javascript">';
|
print '<script type="text/javascript">';
|
||||||
print 'var tradMonthsMin = [';
|
print 'var tradMonthsMin = '.json_encode($tradMonthsMin).';';
|
||||||
foreach($tradMonthsMin as $monthmin)
|
|
||||||
{
|
|
||||||
print '"'.addslashes($monthmin).'",';
|
|
||||||
}
|
|
||||||
print '""];';
|
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
|
|
||||||
// Define tradDays javascript array (we define this in datapicker AND in parent page to avoid errors with IE8)
|
// Define tradDays javascript array (we define this in datapicker AND in parent page to avoid errors with IE8)
|
||||||
@ -1030,12 +1020,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
$langs->trans("Sunday")
|
$langs->trans("Sunday")
|
||||||
);
|
);
|
||||||
print '<script type="text/javascript">';
|
print '<script type="text/javascript">';
|
||||||
print 'var tradDays = [';
|
print 'var tradDays = '.json_encode($tradDays).';';
|
||||||
foreach($tradDays as $day)
|
|
||||||
{
|
|
||||||
print '"'.addslashes($day).'",';
|
|
||||||
}
|
|
||||||
print '""];';
|
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
|
|
||||||
// Define tradDaysMin javascript array (we define this in datapicker AND in parent page to avoid errors with IE8)
|
// Define tradDaysMin javascript array (we define this in datapicker AND in parent page to avoid errors with IE8)
|
||||||
@ -1048,12 +1033,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
$langs->trans("SundayMin")
|
$langs->trans("SundayMin")
|
||||||
);
|
);
|
||||||
print '<script type="text/javascript">';
|
print '<script type="text/javascript">';
|
||||||
print 'var tradDaysMin = [';
|
print 'var tradDaysMin = '.json_encode($tradDaysMin).';';
|
||||||
foreach($tradDaysMin as $daymin)
|
|
||||||
{
|
|
||||||
print '"'.addslashes($daymin).'",';
|
|
||||||
}
|
|
||||||
print '""];';
|
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
|
|
||||||
if (! empty($head)) print $head."\n";
|
if (! empty($head)) print $head."\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user