Clean code
This commit is contained in:
parent
8a93c6215e
commit
df2672c2d3
3 changed files with 17 additions and 11 deletions
|
|
@ -3351,10 +3351,10 @@ if (/* is_array($listofmodules) && */ count($listofmodules) > 0) {
|
|||
// Define $linktoenabledisable to show after module title
|
||||
if (isModEnabled($modulelowercase)) { // If module is already activated
|
||||
$linktoenabledisable .= '<a class="reposition asetresetmodule valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$moduleobj->numero.'&action=reset&token='.newToken().'&value=mod'.$module.$param.'">';
|
||||
$linktoenabledisable .= img_picto($langs->trans("Activated"), 'switch_on', '', 0, 0, 0, '', '', 1);
|
||||
$linktoenabledisable .= img_picto($langs->trans("Warning").' : '.$langs->trans("ModuleIsLive"), 'switch_on', '', 0, 0, 0, '', 'warning valignmiddle', 1);
|
||||
$linktoenabledisable .= '</a>';
|
||||
|
||||
$linktoenabledisable .= $form->textwithpicto('', $langs->trans("Warning").' : '.$langs->trans("ModuleIsLive"), -1, 'warning');
|
||||
//$linktoenabledisable .= $form->textwithpicto('', $langs->trans("Warning").' : '.$langs->trans("ModuleIsLive"), -1, 'warning');
|
||||
|
||||
$objMod = $moduleobj;
|
||||
$backtourlparam = '';
|
||||
|
|
@ -3368,27 +3368,27 @@ if (/* is_array($listofmodules) && */ count($listofmodules) > 0) {
|
|||
foreach ($objMod->config_page_url as $page) {
|
||||
$urlpage = $page;
|
||||
if ($i++) {
|
||||
$linktoenabledisable .= ' <a href="'.$urlpage.'" title="'.$langs->trans($page).'">'.img_picto(ucfirst($page), "setup").'</a>';
|
||||
$linktoenabledisable .= ' <a class="valignmiddle" href="'.$urlpage.'" title="'.$langs->trans($page).'">'.img_picto(ucfirst($page), "setup").'</a>';
|
||||
// print '<a href="'.$page.'">'.ucfirst($page).'</a> ';
|
||||
} else {
|
||||
if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) {
|
||||
$urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1);
|
||||
$linktoenabledisable .= ' <a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 8px"').'</a>';
|
||||
$linktoenabledisable .= ' <a class="valignmiddle" href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 8px"', 0, 0, 0, '', '').'</a>';
|
||||
} else {
|
||||
// Case standard admin page (not a page provided by the
|
||||
// module but a page provided by dolibarr)
|
||||
$urltouse = DOL_URL_ROOT.'/admin/'.$urlpage;
|
||||
$linktoenabledisable .= ' <a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 8px"').'</a>';
|
||||
$linktoenabledisable .= ' <a class="valignmiddle" href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 8px"', 0, 0, 0, '', '').'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs)) {
|
||||
$linktoenabledisable .= ' <a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 8px"').'</a>';
|
||||
$linktoenabledisable .= ' <a class="valignmiddle" href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 8px"', 0, 0, 0, '', '').'</a>';
|
||||
}
|
||||
} else {
|
||||
if (is_object($moduleobj)) {
|
||||
$linktoenabledisable .= '<a class="reposition asetresetmodule valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$moduleobj->numero.'&action=set&token='.newToken().'&value=mod'.$module.$param.'">';
|
||||
$linktoenabledisable .= img_picto($langs->trans("ModuleIsNotActive", $urltomodulesetup), 'switch_off', 'style="padding-right: 8px"', 0, 0, 0, '', 'classfortooltip', 1);
|
||||
$linktoenabledisable .= img_picto($langs->trans("ModuleIsNotActive", $urltomodulesetup), 'switch_off', 'style="padding-right: 8px"', 0, 0, 0, '', 'classfortooltip valignmiddle', 1);
|
||||
$linktoenabledisable .= "</a>\n";
|
||||
}
|
||||
}
|
||||
|
|
@ -3400,7 +3400,7 @@ if (/* is_array($listofmodules) && */ count($listofmodules) > 0) {
|
|||
$head[$h][2] = $tmpmodulearray['modulenamewithcase'];
|
||||
|
||||
if ($tmpmodulearray['modulenamewithcase'] == $module) {
|
||||
$head[$h][4] = '<span class="inline-block">'.$linktoenabledisable.'</span>';
|
||||
$head[$h][4] = '<span class="inline-block valignmiddle">'.$linktoenabledisable.'</span>';
|
||||
}
|
||||
|
||||
$h++;
|
||||
|
|
@ -4280,7 +4280,7 @@ if ($module == 'initmodule') {
|
|||
|
||||
print $langs->trans("EnterNameOfObjectToDeleteDesc").'<br><br>';
|
||||
|
||||
print '<input type="text" name="objectname" value="" placeholder="'.dol_escape_htmltag($langs->trans("ObjectKey")).'" autofocus>';
|
||||
print '<input type="text" class="valignmiddle" name="objectname" value="" placeholder="'.dol_escape_htmltag($langs->trans("ObjectKey")).'" autofocus>';
|
||||
print '<input type="submit" class="button smallpaddingimp" name="delete" value="'.dol_escape_htmltag($langs->trans("Delete")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
|
||||
print '</form>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1492,9 +1492,11 @@ span.fa.fa-plus-circle.paddingleft {
|
|||
.asetresetmodule .fa-toggle-on, .asetresetmodule .fa-toggle-off,
|
||||
.tdwebsitesearchresult .fa-toggle-on, .tdwebsitesearchresult .fa-toggle-off {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.websiteselectionsection .fa-toggle-on, .websiteselectionsection .fa-toggle-off,
|
||||
.tdwebsitesearchresult .fa-toggle-on, .tdwebsitesearchresult .fa-toggle-off {
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
.divoverflow {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
|
|
|
|||
|
|
@ -1612,7 +1612,11 @@ span.fa.fa-plus-circle.paddingleft {
|
|||
.websiteselectionsection .fa-toggle-on, .websiteselectionsection .fa-toggle-off,
|
||||
.asetresetmodule .fa-toggle-on, .asetresetmodule .fa-toggle-off,
|
||||
.tdwebsitesearchresult .fa-toggle-on, .tdwebsitesearchresult .fa-toggle-off {
|
||||
font-size: 1.5em; vertical-align: text-bottom;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.websiteselectionsection .fa-toggle-on, .websiteselectionsection .fa-toggle-off,
|
||||
.tdwebsitesearchresult .fa-toggle-on, .tdwebsitesearchresult .fa-toggle-off {
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
.divoverflow {
|
||||
|
|
|
|||
Loading…
Reference in a new issue