This commit is contained in:
Laurent Destailleur 2020-09-15 12:07:15 +02:00
parent 522676d745
commit 9a9b7ecb95
3 changed files with 136 additions and 133 deletions

View File

@ -229,7 +229,7 @@ if ($action == 'edit')
$value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']}:0); $value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']}:0);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td width="20px">'.img_object('', $delay['img']).'</td>'; print '<td width="20px">'.img_object('', $delay['img']).'</td>';
print '<td>'.$langs->trans('Delays_'.$delay['code']).'</td><td>'; print '<td>'.$langs->trans('Delays_'.$delay['code']).'</td><td class="nowraponall">';
print '<input class="right maxwidth75" type="number" name="'.$delay['code'].'" value="'.$value.'"> '.$langs->trans("days").'</td></tr>'; print '<input class="right maxwidth75" type="number" name="'.$delay['code'].'" value="'.$value.'"> '.$langs->trans("days").'</td></tr>';
} }
} }
@ -290,10 +290,12 @@ if ($action == 'edit')
print '<br>'; print '<br>';
// Show logo for weather
print '<span class="opacitymedium">'.$langs->trans("DescWeather").'</span> ';
if ($action == 'edit') { if ($conf->global->MAIN_DISABLE_METEO != 1) {
// Show logo for weather
print '<span class="opacitymedium">'.$langs->trans("DescWeather").'</span> ';
if ($action == 'edit') {
$str_mode_std = $langs->trans('MeteoStdModEnabled').' : '.$langs->trans('MeteoUseMod', $langs->transnoentitiesnoconv('MeteoPercentageMod')); $str_mode_std = $langs->trans('MeteoStdModEnabled').' : '.$langs->trans('MeteoUseMod', $langs->transnoentitiesnoconv('MeteoPercentageMod'));
$str_mode_percentage = $langs->trans('MeteoPercentageModEnabled').' : '.$langs->trans('MeteoUseMod', $langs->transnoentitiesnoconv('MeteoStdMod')); $str_mode_percentage = $langs->trans('MeteoPercentageModEnabled').' : '.$langs->trans('MeteoUseMod', $langs->transnoentitiesnoconv('MeteoStdMod'));
if (empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $str_mode_enabled = $str_mode_std; if (empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $str_mode_enabled = $str_mode_std;
@ -302,39 +304,39 @@ if ($action == 'edit') {
print '<input type="hidden" id="MAIN_USE_METEO_WITH_PERCENTAGE" name="MAIN_USE_METEO_WITH_PERCENTAGE" value="'.$conf->global->MAIN_USE_METEO_WITH_PERCENTAGE.'" />'; print '<input type="hidden" id="MAIN_USE_METEO_WITH_PERCENTAGE" name="MAIN_USE_METEO_WITH_PERCENTAGE" value="'.$conf->global->MAIN_USE_METEO_WITH_PERCENTAGE.'" />';
print '<br><br>'; print '<br><br>';
} else { } else {
if (empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) print $langs->trans('MeteoStdModEnabled'); if (empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) print $langs->trans('MeteoStdModEnabled');
else print $langs->trans('MeteoPercentageModEnabled'); else print $langs->trans('MeteoPercentageModEnabled');
print '<br><br>'; print '<br><br>';
} }
$offset = 0; $offset = 0;
$cursor = 10; // By default $cursor = 10; // By default
//if (! empty($conf->global->MAIN_METEO_OFFSET)) $offset=$conf->global->MAIN_METEO_OFFSET; //if (! empty($conf->global->MAIN_METEO_OFFSET)) $offset=$conf->global->MAIN_METEO_OFFSET;
//if (! empty($conf->global->MAIN_METEO_GAP)) $cursor=$conf->global->MAIN_METEO_GAP; //if (! empty($conf->global->MAIN_METEO_GAP)) $cursor=$conf->global->MAIN_METEO_GAP;
$level0 = $offset; if (!empty($conf->global->MAIN_METEO_LEVEL0)) $level0 = $conf->global->MAIN_METEO_LEVEL0; $level0 = $offset; if (!empty($conf->global->MAIN_METEO_LEVEL0)) $level0 = $conf->global->MAIN_METEO_LEVEL0;
$level1 = $offset + 1 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL1)) $level1 = $conf->global->MAIN_METEO_LEVEL1; $level1 = $offset + 1 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL1)) $level1 = $conf->global->MAIN_METEO_LEVEL1;
$level2 = $offset + 2 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL2)) $level2 = $conf->global->MAIN_METEO_LEVEL2; $level2 = $offset + 2 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL2)) $level2 = $conf->global->MAIN_METEO_LEVEL2;
$level3 = $offset + 3 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL3)) $level3 = $conf->global->MAIN_METEO_LEVEL3; $level3 = $offset + 3 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL3)) $level3 = $conf->global->MAIN_METEO_LEVEL3;
$text = ''; $options = 'class="valignmiddle" height="60px"'; $text = ''; $options = 'class="valignmiddle" height="60px"';
if ($action == 'edit') { if ($action == 'edit') {
print '<div id="standard" '.(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '' : 'style="display:none;"').'>'; print '<div id="standard" '.(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '' : 'style="display:none;"').'>';
print '<div>'; print '<div>';
print '<div class="inline-block" style="padding-right: 20px">'; print '<div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 0, $options); print img_weather($text, 0, $options);
print '= <input type="text" size="2" name="MAIN_METEO_LEVEL0" value="'.$level0.'"/></td>'; print ' = <input type="text" size="2" name="MAIN_METEO_LEVEL0" value="'.$level0.'"/></td>';
print '</div><div class="inline-block" style="padding-right: 20px">'; print '</div><div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 1, $options); print img_weather($text, 1, $options);
print '&lt;= <input type="text" size="2" name="MAIN_METEO_LEVEL1" value="'.$level1.'"/></td>'; print ' &lt;= <input type="text" size="2" name="MAIN_METEO_LEVEL1" value="'.$level1.'"/></td>';
print '</div><div class="inline-block" style="padding-right: 20px">'; print '</div><div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 2, $options); print img_weather($text, 2, $options);
print '&lt;= <input type="text" size="2" name="MAIN_METEO_LEVEL2" value="'.$level2.'"/></td>'; print ' &lt;= <input type="text" size="2" name="MAIN_METEO_LEVEL2" value="'.$level2.'"/></td>';
print '</div><div class="inline-block" style="padding-right: 20px">'; print '</div><div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 3, $options); print img_weather($text, 3, $options);
print '&lt;= <input type="text" size="2" name="MAIN_METEO_LEVEL3" value="'.$level3.'"/></td>'; print ' &lt;= <input type="text" size="2" name="MAIN_METEO_LEVEL3" value="'.$level3.'"/></td>';
print '</div>'; print '</div>';
print '</div>'; print '</div>';
@ -345,16 +347,16 @@ if ($action == 'edit') {
print '<div>'; print '<div>';
print '<div class="inline-block" style="padding-right: 20px">'; print '<div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 0, $options); print img_weather($text, 0, $options);
print '&lt;= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL0" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.'"/>&nbsp;%</td>'; print ' &lt;= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL0" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.'"/>&nbsp;%</td>';
print '</div><div class="inline-block" style="padding-right: 20px">'; print '</div><div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 1, $options); print img_weather($text, 1, $options);
print '&lt;= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL1" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.'"/>&nbsp;%</td>'; print ' &lt;= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL1" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.'"/>&nbsp;%</td>';
print '</div><div class="inline-block" style="padding-right: 20px">'; print '</div><div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 2, $options); print img_weather($text, 2, $options);
print '&lt;= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL2" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.'"/>&nbsp;%</td>'; print ' &lt;= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL2" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.'"/>&nbsp;%</td>';
print '</div><div class="inline-block" style="padding-right: 20px">'; print '</div><div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 3, $options); print img_weather($text, 3, $options);
print '&lt;= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL3" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.'"/>&nbsp;%</td>'; print ' &lt;= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL3" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.'"/>&nbsp;%</td>';
print '</div>'; print '</div>';
print '</div>'; print '</div>';
@ -389,49 +391,49 @@ if ($action == 'edit') {
</script> </script>
<?php <?php
} else { } else {
if (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) { if (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) {
print '<div>'; print '<div>';
print '<div class="inline-block" style="padding-right: 20px">'; print '<div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 0, $options); print img_weather($text, 0, $options);
print '= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.'&nbsp;%</td>'; print ' = '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.'&nbsp;%</td>';
print '</div><div class="inline-block" style="padding-right: 20px">'; print '</div><div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 1, $options); print img_weather($text, 1, $options);
print '&lt;= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.'&nbsp;%</td>'; print ' &lt;= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.'&nbsp;%</td>';
print '</div><div class="inline-block" style="padding-right: 20px">'; print '</div><div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 2, $options); print img_weather($text, 2, $options);
print '&lt;= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.'&nbsp;%</td>'; print ' &lt;= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.'&nbsp;%</td>';
print '</div><div class="inline-block" style="padding-right: 20px">'; print '</div><div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 3, $options); print img_weather($text, 3, $options);
print '&lt;= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.'&nbsp;%</td>'; print ' &lt;= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.'&nbsp;%</td>';
print '</div><div class="inline-block" style="padding-right: 20px">'; print '</div><div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 4, $options); print img_weather($text, 4, $options);
print '&gt; '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.'&nbsp;%</td>'; print ' &gt; '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.'&nbsp;%</td>';
print '</div>'; print '</div>';
print '</div>'; print '</div>';
} else { } else {
print '<div>'; print '<div>';
print '<div class="inline-block" style="padding-right: 20px">'; print '<div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 0, $options); print img_weather($text, 0, $options);
print '= '.$level0; print ' = '.$level0;
print '</div><div class="inline-block" style="padding-right: 20px">'; print '</div><div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 1, $options); print img_weather($text, 1, $options);
print '&lt;= '.$level1; print ' &lt;= '.$level1;
print '</div><div class="inline-block" style="padding-right: 20px">'; print '</div><div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 2, $options); print img_weather($text, 2, $options);
print '&lt;= '.$level2; print ' &lt;= '.$level2;
print '</div><div class="inline-block" style="padding-right: 20px">'; print '</div><div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 3, $options); print img_weather($text, 3, $options);
print '&lt;= '.$level3; print ' &lt;= '.$level3;
print '</div><div class="inline-block" style="padding-right: 20px">'; print '</div><div class="inline-block" style="padding-right: 20px">';
print img_weather($text, 4, $options); print img_weather($text, 4, $options);
print '&gt; '.$level3; print ' &gt; '.$level3;
print '</div>'; print '</div>';
print '</div>'; print '</div>';
} }
}
} }
print '</div>';
if ($action == 'edit') { if ($action == 'edit') {
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>'; print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';

View File

@ -379,23 +379,23 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
} }
.fa-weather-level0:before{ .fa-weather-level0:before{
content: "\f185"; content: "\f185";
color : #ffbf00; color : #cfbf00;
} }
.fa-weather-level1:before{ .fa-weather-level1:before{
content: "\f6c4"; content: "\f6c4";
color : #b0b0b0; color : #bc9526;
} }
.fa-weather-level2:before{ .fa-weather-level2:before{
content: "\f0c2"; content: "\f743";
color : #9b9b9b; color : #b16000;
} }
.fa-weather-level3:before{ .fa-weather-level3:before{
content: "\f740"; content: "\f740";
color : #888888; color : #b04000;
} }
.fa-weather-level4:before{ .fa-weather-level4:before{
content: "\f0e7"; content: "\f0e7";
color : #b91f1f; color : #b01000;
} }

View File

@ -388,25 +388,26 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
} }
.fa-weather-level0:before{ .fa-weather-level0:before{
content: "\f185"; content: "\f185";
color : #000000; color : #cfbf00;
} }
.fa-weather-level1:before{ .fa-weather-level1:before{
content: "\f6c4"; content: "\f6c4";
color : #000000; color : #bc9526;
} }
.fa-weather-level2:before{ .fa-weather-level2:before{
content: "\f0c2"; content: "\f743";
color : #000000; color : #b16000;
} }
.fa-weather-level3:before{ .fa-weather-level3:before{
content: "\f740"; content: "\f740";
color : #000000; color : #b04000;
} }
.fa-weather-level4:before{ .fa-weather-level4:before{
content: "\f0e7"; content: "\f0e7";
color : #000000; color : #b01000;
} }
/* USING IMAGES FOR WEATHER INTEAD OF FONT AWESOME */ /* USING IMAGES FOR WEATHER INTEAD OF FONT AWESOME */
/* For other themes just uncomment this part */ /* For other themes just uncomment this part */
/*.info-box-weather-level0, /*.info-box-weather-level0,