From 91b45bfed3750c098ffe0d9aa0a34c5dc5c8d31d Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Sun, 20 Jun 2021 11:25:43 +0200 Subject: [PATCH] Fix icons, fix toolbar, fix addSelectFromCollection --- public/main/admin/skill.php | 2 +- .../pear/HTML/QuickForm/advmultiselect.php | 8 +-- public/main/survey/surveyUtil.class.php | 59 +++++++++---------- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/public/main/admin/skill.php b/public/main/admin/skill.php index 4c470dc47a..1f0b26ce28 100644 --- a/public/main/admin/skill.php +++ b/public/main/admin/skill.php @@ -34,7 +34,7 @@ if (!empty($id)) { } $form = new FormValidator('Skill', 'GET', api_get_self().'?action='.$action.'&id='.$id); -$form->addSelectFromCollection('profile_id', get_lang('Profile'), $profiles, null, true); +$form->addSelectFromCollection('profile_id', get_lang('Profile'), $profiles, [], true); $form->addHidden('action', $action); $form->addHidden('id', $id); $form->addButtonSave(get_lang('Update')); diff --git a/public/main/inc/lib/pear/HTML/QuickForm/advmultiselect.php b/public/main/inc/lib/pear/HTML/QuickForm/advmultiselect.php index d3c774f217..00400f2134 100644 --- a/public/main/inc/lib/pear/HTML/QuickForm/advmultiselect.php +++ b/public/main/inc/lib/pear/HTML/QuickForm/advmultiselect.php @@ -728,24 +728,24 @@ class HTML_QuickForm_advmultiselect extends HTML_QuickForm_select $this->_removeButtonAttributes = array_merge($this->_removeButtonAttributes, $attributes); $attrStrRemove = $this->_getAttrString($this->_removeButtonAttributes); - $strHtmlRemove = ""; + $strHtmlRemove = ""; // build the add button with all its attributes $attributes = array('id' => $selectId.'_rightSelected'); $this->_addButtonAttributes = array_merge($this->_addButtonAttributes, $attributes); $attrStrAdd = $this->_getAttrString($this->_addButtonAttributes); - $strHtmlAdd = "

"; + $strHtmlAdd = "

"; if ($this->selectAllCheckBox) { $attributes = array('id' => $selectId.'_rightAll'); $this->_addButtonAttributes = array_merge($this->_addButtonAttributes, $attributes); $attrStrAdd = $this->_getAttrString($this->_addButtonAttributes); - $rightAll = "

"; + $rightAll = "

"; $attributes = array('id' => $selectId.'_leftAll'); $this->_addButtonAttributes = array_merge($this->_addButtonAttributes, $attributes); $attrStrAdd = $this->_getAttrString($this->_addButtonAttributes); - $leftAll = "

"; + $leftAll = "

"; } // build the select all button with all its attributes diff --git a/public/main/survey/surveyUtil.class.php b/public/main/survey/surveyUtil.class.php index d34af327e1..f87cf0a6d4 100644 --- a/public/main/survey/surveyUtil.class.php +++ b/public/main/survey/surveyUtil.class.php @@ -437,8 +437,7 @@ class SurveyUtil // Actions bar if ($addActionBar) { - echo '
'; - echo ''. + $actions = ''. Display::return_icon( 'back.png', get_lang('Back to').' '.get_lang('Reporting overview'), @@ -449,32 +448,32 @@ class SurveyUtil if (isset($_GET['user'])) { if (api_is_allowed_to_edit()) { // The delete link - echo ''. Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_MEDIUM).''; } // Export the user report - echo '' + $actions .= '' .Display::return_icon('export_csv.png', get_lang('CSV export'), '', ICON_SIZE_MEDIUM).' '; - echo '' + $actions .= '' .Display::return_icon('export_excel.png', get_lang('Excel export'), '', ICON_SIZE_MEDIUM).' '; - echo '
'; - echo ''; - echo ''; - echo '
'; - echo '
'; + $actions .= ''; + $actions .= '
'; + $actions .= '
'; - echo ''; - echo ''; - echo '
'; - echo '
'; + $actions .= ''; + $actions .= '
'; + $actions .= '
'; } - echo '
'; + echo Display::toolbarAction('survey', [$actions]); } echo self::displayUserReportForm($survey, $people_filled); @@ -515,8 +514,7 @@ class SurveyUtil $table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION); $table_survey_answer = Database::get_course_table(TABLE_SURVEY_ANSWER); - echo '
'; - echo ''. Display::return_icon( 'back.png', @@ -524,7 +522,7 @@ class SurveyUtil '', ICON_SIZE_MEDIUM ).''; - echo Display::url( + $actions .= Display::url( Display::return_icon( 'pdf.png', get_lang('ExportToPdf'), @@ -534,7 +532,9 @@ class SurveyUtil 'javascript: void(0);', ['onclick' => 'exportToPdf();'] ); - echo '
'; + + echo Display::toolbarAction('survey', [$actions]); + $fromUntil = sprintf( get_lang('FromXUntilY'), api_get_local_time($survey->getAvailFrom()), @@ -957,8 +957,7 @@ class SurveyUtil $action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : ''; $content = ''; if ($addActionBar) { - $content .= '
'; - $content .= '' .Display::return_icon( 'back.png', @@ -967,17 +966,18 @@ class SurveyUtil ICON_SIZE_MEDIUM ) .''; - $content .= '' + $actions .= '' .Display::return_icon('export_csv.png', get_lang('CSV export'), '', ICON_SIZE_MEDIUM).''; - $content .= '' + $actions .= '' .Display::return_icon('export_excel.png', get_lang('Excel export'), '', ICON_SIZE_MEDIUM).''; - $content .= '' + $actions .= '' .Display::return_icon('export_compact_csv.png', get_lang('ExportAsCompactCSV'), '', ICON_SIZE_MEDIUM).''; - $content .= '
'; + + $content .= Display::toolbarAction('survey', [$actions]); // The form - $content .= ''; $content .= ''; $content .= ''; @@ -1990,8 +1990,7 @@ class SurveyUtil $questions = SurveyManager::get_questions($surveyId); // Actions bar - echo '
'; - echo '' .Display::return_icon( 'back.png', @@ -2000,7 +1999,7 @@ class SurveyUtil ICON_SIZE_MEDIUM ) .''; - echo '
'; + echo Display::toolbarAction('survey', [$actions]); // Displaying an information message that only the questions with predefined answers can be used in a comparative report echo Display::return_message(get_lang('Only questions with predefined answers can be used'), 'normal', false);