2
0
forked from Wavyzz/dolibarr

clean code

This commit is contained in:
Laurent Destailleur
2022-02-06 15:21:49 +01:00
parent 3e6d922cc0
commit 3fa3cd28cd
3 changed files with 10 additions and 8 deletions

View File

@@ -906,8 +906,7 @@ class FormOther
</script>'; </script>';
} }
$out .= '<input id="colorpicker'.$prefix.'" name="'.$prefix.'" size="6" maxlength="7" class="flat'.($morecss ? ' '.$morecss : '').'" type="text" value="'.dol_escape_htmltag($set_color).'" />'; $out .= '<input id="colorpicker'.$prefix.'" name="'.$prefix.'" size="6" maxlength="7" class="flat'.($morecss ? ' '.$morecss : '').'" type="text" value="'.dol_escape_htmltag($set_color).'" />';
} else // In most cases, this is not used. We used instead function with no specific list of colors } else { // In most cases, this is not used. We used instead function with no specific list of colors
{
if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax)) { if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax)) {
$out .= '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/colorpicker/jquery.colorpicker.css" type="text/css" media="screen" />'; $out .= '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/colorpicker/jquery.colorpicker.css" type="text/css" media="screen" />';
$out .= '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/colorpicker/jquery.colorpicker.js" type="text/javascript"></script>'; $out .= '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/colorpicker/jquery.colorpicker.js" type="text/javascript"></script>';

View File

@@ -562,7 +562,7 @@ function setConstant(url, code, input, entity, strict, forcereload, userid, toke
value: value value: value
}, },
function() { /* handler for success of post */ function() { /* handler for success of post */
console.log("url request success forcereload="+forcereload+" value="+value); console.log("Ajax url request to set constant is a success. forcereload="+forcereload+" value="+value);
if (value == 0) { if (value == 0) {
$("#set_" + code).show(); $("#set_" + code).show();
$("#del_" + code).hide(); $("#del_" + code).hide();
@@ -642,7 +642,7 @@ function delConstant(url, code, input, entity, strict, forcereload, userid, toke
token: token token: token
}, },
function() { function() {
console.log("url request success forcereload="+forcereload); console.log("Ajax url request to delete constant is success forcereload="+forcereload);
$("#del_" + code).hide(); $("#del_" + code).hide();
$("#set_" + code).show(); $("#set_" + code).show();
$.each(input, function(type, data) { $.each(input, function(type, data) {

View File

@@ -407,7 +407,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
} else { } else {
$title = $langs->trans("ShowPreview"); $title = $langs->trans("ShowPreview");
} }
print '<img class="img-skinthumb shadow" src="'.$url.'" alt="'.$title.'" title="'.$title.'" style="border: none; margin-bottom: 5px;">'; print '<img class="img-skinthumb shadow" src="'.$url.'" alt="'.dol_escape_htmltag($title).'" title="'.dol_escape_htmltag($title).'" style="border: none; margin-bottom: 5px;">';
print '</a><br>'; print '</a><br>';
if ($subdir == $selected_theme) { if ($subdir == $selected_theme) {
print '<input '.($edit ? '' : 'disabled').' type="radio" class="themethumbs" style="border: 0px;" id="main_theme'.$subdir.'" checked name="main_theme" value="'.$subdir.'"><label for="main_theme'.$subdir.'"> <b>'.$subdir.'</b></label>'; print '<input '.($edit ? '' : 'disabled').' type="radio" class="themethumbs" style="border: 0px;" id="main_theme'.$subdir.'" checked name="main_theme" value="'.$subdir.'"><label for="main_theme'.$subdir.'"> <b>'.$subdir.'</b></label>';
@@ -440,6 +440,9 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
$colorbacklinepairhover = ''; $colorbacklinepairhover = '';
$colorbacklinepairhover = ''; $colorbacklinepairhover = '';
$colorbacklinepairchecked = ''; $colorbacklinepairchecked = '';
$butactionbg = '';
$textbutaction = '';
// Set the variables with the default value
if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php')) { if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php')) {
include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
} }
@@ -954,7 +957,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print '<td>'.$langs->trans("BtnActionColor").'</td>'; print '<td>'.$langs->trans("BtnActionColor").'</td>';
print '<td colspan="'.($colspan - 1).'">'; print '<td colspan="'.($colspan - 1).'">';
if ($edit) { if ($edit) {
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_BTNACTION) ? $conf->global->THEME_ELDY_BTNACTION : ''), array()), ''), 'THEME_ELDY_BTNACTION', '', 1, '', '', 'colorbtnaction').' '; print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_BTNACTION) ? $conf->global->THEME_ELDY_BTNACTION : ''), array()), ''), 'THEME_ELDY_BTNACTION', '', 1, '', '', 'butactionbg').' ';
} else { } else {
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BTNACTION, array()), ''); $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BTNACTION, array()), '');
if ($color) { if ($color) {
@@ -971,7 +974,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print '</tr>'; print '</tr>';
} }
// Text btn action // Text btn action
if ($foruserprofile) { if ($foruserprofile) {
/* /*
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@@ -1000,7 +1003,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print '<td>'.$langs->trans("TextBtnActionColor").'</td>'; print '<td>'.$langs->trans("TextBtnActionColor").'</td>';
print '<td colspan="'.($colspan - 1).'">'; print '<td colspan="'.($colspan - 1).'">';
if ($edit) { if ($edit) {
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_TEXTBTNACTION) ? $conf->global->THEME_ELDY_TEXTBTNACTION : ''), array()), ''), 'THEME_ELDY_TEXTBTNACTION', '', 1, '', '', 'colortextbtnaction').' '; print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_TEXTBTNACTION) ? $conf->global->THEME_ELDY_TEXTBTNACTION : ''), array()), ''), 'THEME_ELDY_TEXTBTNACTION', '', 1, '', '', 'textbutaction').' ';
} else { } else {
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTBTNACTION, array()), ''); $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTBTNACTION, array()), '');
if ($color) { if ($color) {