Replace table with div

This commit is contained in:
Laurent Destailleur 2017-10-02 01:23:07 +02:00
parent 3f3a5e0921
commit 989f285d32

View File

@ -249,7 +249,7 @@ else
} }
print '<br />'; print '<br>';
// Show logo for weather // Show logo for weather
print $langs->trans("DescWeather").'<br>'; print $langs->trans("DescWeather").'<br>';
@ -263,12 +263,12 @@ if($action == 'edit') {
print '<a href="#" onclick="return false;" id="change_mode">'.$str_mode_enabled.'</a>'; print '<a href="#" onclick="return false;" id="change_mode">'.$str_mode_enabled.'</a>';
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;
@ -279,7 +279,7 @@ $level0=$offset; if (! empty($conf->global->MAIN_METEO_LEVEL0)) $level
$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='height="60px"'; $text=''; $options='class="valignmiddle" height="60px"';
if ($action == 'edit') { if ($action == 'edit') {
@ -287,66 +287,41 @@ 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 '<table>'; print '<div>';
print '<tr>'; print '<div class="inline-block" style="padding-right: 20px">';
print '<td>';
print img_weather($text,'weather-clear.png', $options); print img_weather($text,'weather-clear.png', $options);
print '</td><td>= <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 '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div><div class="inline-block" style="padding-right: 20px">';
print '<td>';
print img_weather($text,'weather-few-clouds.png',$options); print img_weather($text,'weather-few-clouds.png',$options);
print '</td><td>&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 '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div><div class="inline-block" style="padding-right: 20px">';
print '<td>';
print img_weather($text,'weather-clouds.png',$options); print img_weather($text,'weather-clouds.png',$options);
print '</td><td>&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 '</tr>'; print '</div><div class="inline-block" style="padding-right: 20px">';
print '<tr><td>';
print img_weather($text,'weather-many-clouds.png',$options); print img_weather($text,'weather-many-clouds.png',$options);
print '</td><td>&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 '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div>';
/*print '<td>'; print '</div>';
print img_weather($text,'weather-storm.png',$options);
print '</td><td>&gt; '.$level3.'</td>';*/
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>';
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>';
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>';
print '</tr>';
print '</table>';
print '</div>'; print '</div>';
print '<div id="percentage" '.(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? 'style="display:none;"' : '').'>'; print '<div id="percentage" '.(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? 'style="display:none;"' : '').'>';
print '<table>'; print '<div>';
print '<tr>'; print '<div class="inline-block" style="padding-right: 20px">';
print '<td>';
print img_weather($text,'weather-clear.png',$options); print img_weather($text,'weather-clear.png',$options);
print '</td><td>= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL0" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.'"/>&nbsp;%</td>'; print '= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL0" value="'.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.'"/>&nbsp;%</td>';
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div><div class="inline-block" style="padding-right: 20px">';
print '<td>';
print img_weather($text,'weather-few-clouds.png',$options); print img_weather($text,'weather-few-clouds.png',$options);
print '</td><td>&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 '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div><div class="inline-block" style="padding-right: 20px">';
print '<td>';
print img_weather($text,'weather-clouds.png',$options); print img_weather($text,'weather-clouds.png',$options);
print '</td><td>&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 '</tr>'; print '</div><div class="inline-block" style="padding-right: 20px">';
print '<tr><td>';
print img_weather($text,'weather-many-clouds.png',$options); print img_weather($text,'weather-many-clouds.png',$options);
print '</td><td>&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 '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div>';
/*print '<td>'; print '</div>';
print img_weather($text,'weather-storm.png',$options);
print '</td><td>&gt; '.$level3.'</td>';*/
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>';
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>';
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>';
print '</tr>';
print '</table>';
print '</div>'; print '</div>';
@ -384,65 +359,45 @@ if($action == 'edit') {
if(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) { if(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) {
print '<table>'; print '<div>';
print '<tr>'; print '<div class="inline-block" style="padding-right: 20px">';
print '<td>';
print img_weather($text,'weather-clear.png',$options); print img_weather($text,'weather-clear.png',$options);
print '</td><td>= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.'&nbsp;%</td>'; print '= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.'&nbsp;%</td>';
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div><div class="inline-block" style="padding-right: 20px">';
print '<td>';
print img_weather($text,'weather-few-clouds.png',$options); print img_weather($text,'weather-few-clouds.png',$options);
print '</td><td>&lt;= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.'&nbsp;%</td>'; print '&lt;= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.'&nbsp;%</td>';
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div><div class="inline-block" style="padding-right: 20px">';
print '<td>';
print img_weather($text,'weather-clouds.png',$options); print img_weather($text,'weather-clouds.png',$options);
print '</td><td>&lt;= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.'&nbsp;%</td>'; print '&lt;= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.'&nbsp;%</td>';
print '</tr>'; print '</div><div class="inline-block" style="padding-right: 20px">';
print '<tr><td>';
print img_weather($text,'weather-many-clouds.png',$options); print img_weather($text,'weather-many-clouds.png',$options);
print '</td><td>&lt;= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.'&nbsp;%</td>'; print '&lt;= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.'&nbsp;%</td>';
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div><div class="inline-block" style="padding-right: 20px">';
print '<td>';
print img_weather($text,'weather-storm.png',$options); print img_weather($text,'weather-storm.png',$options);
print '</td><td>&gt; '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.'&nbsp;%</td>'; print '&gt; '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.'&nbsp;%</td>';
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div>';
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div>';
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>';
print '</tr>';
print '</table>';
} else { } else {
print '<table>'; print '<div>';
print '<tr>'; print '<div class="inline-block" style="padding-right: 20px">';
print '<td>';
print img_weather($text,'weather-clear.png',$options); print img_weather($text,'weather-clear.png',$options);
print '</td><td>= '.$level0.'</td>'; print '= '.$level0;
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div><div class="inline-block" style="padding-right: 20px">';
print '<td>';
print img_weather($text,'weather-few-clouds.png',$options); print img_weather($text,'weather-few-clouds.png',$options);
print '</td><td>&lt;= '.$level1.'</td>'; print '&lt;= '.$level1;
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div><div class="inline-block" style="padding-right: 20px">';
print '<td>';
print img_weather($text,'weather-clouds.png',$options); print img_weather($text,'weather-clouds.png',$options);
print '</td><td>&lt;= '.$level2.'</td>'; print '&lt;= '.$level2;
print '</tr>'; print '</div><div class="inline-block" style="padding-right: 20px">';
print '<tr><td>';
print img_weather($text,'weather-many-clouds.png',$options); print img_weather($text,'weather-many-clouds.png',$options);
print '</td><td>&lt;= '.$level3.'</td>'; print '&lt;= '.$level3;
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div><div class="inline-block" style="padding-right: 20px">';
print '<td>';
print img_weather($text,'weather-storm.png',$options); print img_weather($text,'weather-storm.png',$options);
print '</td><td>&gt; '.$level3.'</td>'; print '&gt; '.$level3;
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div>';
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>'; print '</div>';
print '<td> &nbsp; &nbsp; &nbsp; &nbsp; </td>';
print '</tr>';
print '</table>';
} }
} }