Clean code when there is no setup to do
This commit is contained in:
parent
d9ccc7624b
commit
a4cd96e03c
@ -85,7 +85,7 @@ $head = mymoduleAdminPrepareHead();
|
|||||||
dol_fiche_head($head, 'settings', '', -1, "mymodule@mymodule");
|
dol_fiche_head($head, 'settings', '', -1, "mymodule@mymodule");
|
||||||
|
|
||||||
// Setup page goes here
|
// Setup page goes here
|
||||||
echo $langs->trans("MyModuleSetupPage");
|
echo $langs->trans("MyModuleSetupPage").'<br><br>';
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
@ -99,13 +99,10 @@ if ($action == 'edit')
|
|||||||
|
|
||||||
foreach($arrayofparameters as $key => $val)
|
foreach($arrayofparameters as $key => $val)
|
||||||
{
|
{
|
||||||
if (isset($val['enabled']) && empty($val['enabled'])) continue;
|
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip'));
|
print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip'));
|
||||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css'])?'minwidth200':$val['css']).'" value="' . $conf->global->$key . '"></td></tr>';
|
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css'])?'minwidth200':$val['css']).'" value="' . $conf->global->$key . '"></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print '<br><div class="center">';
|
||||||
@ -117,21 +114,28 @@ if ($action == 'edit')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<table class="noborder" width="100%">';
|
if (! empty($arrayofparameters))
|
||||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
|
||||||
|
|
||||||
foreach($arrayofparameters as $key => $val)
|
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven"><td>';
|
print '<table class="noborder" width="100%">';
|
||||||
print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip'));
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
print '</td><td>' . $conf->global->$key . '</td></tr>';
|
|
||||||
|
foreach($arrayofparameters as $key => $val)
|
||||||
|
{
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip'));
|
||||||
|
print '</td><td>' . $conf->global->$key . '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<br>'.$langs->trans("NothingToSetup");
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
|
||||||
print '</div>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -140,3 +144,4 @@ dol_fiche_end();
|
|||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user