From 2c4e4a57a85047d69cee7cccdbbff4fc860a8255 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Oct 2024 12:35:06 +0200 Subject: [PATCH] Clean code --- htdocs/admin/ihm.php | 35 ++++++++------------------- htdocs/core/class/doleditor.class.php | 8 +++++- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index cb4baa55170..38b0d37fb6c 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -338,9 +338,9 @@ llxHeader( 0, 0, array( - '/includes/ace/src/ace.js', - '/includes/ace/src/ext-statusbar.js', - '/includes/ace/src/ext-language_tools.js', + '/includes/ace/src/ace.js', + '/includes/ace/src/ext-statusbar.js', + '/includes/ace/src/ext-language_tools.js', ), array(), '', @@ -456,36 +456,28 @@ if ($mode == 'other') { print ''; print ''; - // show input border - /* - print ''.$langs->trans("showInputBorder").''; - print $form->selectyesno('main_showInputBorder',isset($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)?$conf->global->THEME_ELDY_SHOW_BORDER_INPUT:0,1); - print ''; - print ''; - */ - // First day for weeks print '' . $langs->trans("WeekStartOnDay") . ''; - print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : '1'), 'MAIN_START_WEEK', 0); + print $formother->select_dayofweek(getDolGlobalString('MAIN_START_WEEK', '1'), 'MAIN_START_WEEK', 0); print ''; print ''; // DefaultWorkingDays print '' . $langs->trans("DefaultWorkingDays") . ''; - print ''; + print ''; print ''; print ''; // DefaultWorkingHours print '' . $langs->trans("DefaultWorkingHours") . ''; - print ''; + print ''; print ''; print ''; // Firstname/Name print '' . $langs->trans("FirstnameNamePosition") . ''; $array = array(0 => $langs->trans("Firstname") . ' ' . $langs->trans("Lastname"), 1 => $langs->trans("Lastname") . ' ' . $langs->trans("Firstname")); - print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION) ? $conf->global->MAIN_FIRSTNAME_NAME_POSITION : 0)); + print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, getDolGlobalInt('MAIN_FIRSTNAME_NAME_POSITION', 0)); print ''; print ''; @@ -523,7 +515,7 @@ if ($mode == 'other') { print ''; print $form->textwithpicto($langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")), $langs->trans("ShowBugTrackLinkDesc")); print ''; - print ''; + print ''; print ''; print ''; @@ -561,17 +553,10 @@ if ($mode == 'dashboard') { print ''; - $doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD) ? $conf->global->MAIN_MOTD : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%'); + $doleditor = new DolEditor('main_motd', getDolGlobalString('MAIN_MOTD'), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%'); $doleditor->Create(); - print '' . "\n"; - - /* no more need for this option. It is now a widget already controlled by end user - print '' . $langs->trans('BoxstatsDisableGlobal') . ''; - print ajax_constantonoff("MAIN_DISABLE_GLOBAL_BOXSTATS", array(), $conf->entity, 0, 0, 1, 0); - print ''; - print ''; - */ + print ''."\n"; print ''; print ''; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 2593cfbb8cb..47874f4516d 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -166,7 +166,12 @@ class DolEditor //$out.= ''; @@ -204,6 +209,7 @@ class DolEditor $htmlencode_force = preg_match('/_encoded$/', $this->toolbarname) ? 'true' : 'false'; $out .= ''."\n"; + //$out .= ''; $out .= '