diff --git a/assets/css/app.scss b/assets/css/app.scss
index 58f6a63f7d..3d35acb5b8 100644
--- a/assets/css/app.scss
+++ b/assets/css/app.scss
@@ -134,6 +134,14 @@
border: 0;
}
+ .list-group {
+ @apply flex flex-col mr-4;
+ }
+
+ .list-group-item {
+ @apply flex flex-row justify-start gap-2 border rounded-sm px-3 py-3;
+ }
+
@import "scss/index.scss";
}
diff --git a/public/main/dropbox/index.php b/public/main/dropbox/index.php
index e087bdadf4..fb8a74efc8 100644
--- a/public/main/dropbox/index.php
+++ b/public/main/dropbox/index.php
@@ -231,47 +231,47 @@ if ('add' != $action) {
}
// ACTIONS
- if ('received' == $view || !$showSentReceivedTabs) {
+ if ('received' === $view || !$showSentReceivedTabs) {
// This is for the categories
if (isset($viewReceivedCategory) && '' != $viewReceivedCategory) {
$view_dropbox_category_received = $viewReceivedCategory;
} else {
$view_dropbox_category_received = 0;
}
- /* Menu Received */
+ /* Menu Received */
+ $actions = '';
if (0 == api_get_session_id()) {
- echo '
".
feedback($dropbox_file->feedback2, $url).
@@ -628,10 +626,10 @@ if ('add' != $action) {
$action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').'
'.
Display::return_icon('discuss.png', get_lang('Comment'), '', ICON_SIZE_SMALL).
- '
+ '
'.
Display::return_icon('upload_file.png', get_lang('Update'), '', ICON_SIZE_SMALL).
- '
+ '
'.
Display::return_icon('move.png', get_lang('Move'), '', ICON_SIZE_SMALL).'
diff --git a/public/main/gradebook/lib/be/category.class.php b/public/main/gradebook/lib/be/category.class.php
index 2f7b7964d8..980a07d98c 100644
--- a/public/main/gradebook/lib/be/category.class.php
+++ b/public/main/gradebook/lib/be/category.class.php
@@ -559,7 +559,7 @@ class Category implements GradebookItem
$category->setUser(api_get_user_entity($this->user_id));
$category->setCourse($course);
$category->setParent($parent);
- $category->setWeight($this->weight);
+ $category->setWeight(api_float_val($this->weight));
$category->setVisible($this->visible ? true : false);
$category->setCertifMinScore($this->certificate_min_score);
$category->setSession(api_get_session_entity($this->session_id));
diff --git a/public/main/group/group.php b/public/main/group/group.php
index 109b8e9249..1da6e9fbd5 100644
--- a/public/main/group/group.php
+++ b/public/main/group/group.php
@@ -286,13 +286,14 @@ if ('true' === api_get_setting('allow_group_categories')) {
}
}
- echo Display::page_header(
- Security::remove_XSS($category['title'].' '.$label.' ').$actions,
+ $header = Display::page_header(
+ Security::remove_XSS($category['title'].' '.$label.' '),
null,
'h4',
false
);
+ echo Display::toolbarAction('category_'.$categoryId, [$header.$actions]);
echo $category['description'];
echo $groupToShow;
}
diff --git a/public/main/group/group_category.php b/public/main/group/group_category.php
index 14e8c2228a..0a32178201 100644
--- a/public/main/group/group_category.php
+++ b/public/main/group/group_category.php
@@ -166,9 +166,13 @@ $group = [
'self_reg_allowed',
get_lang('Registration'),
get_lang('Learners are allowed to self-register in groups'),
- 1
),
- $form->createElement('checkbox', 'self_unreg_allowed', null, get_lang('Learners are allowed to unregister themselves from groups'), 1),
+ $form->createElement(
+ 'checkbox',
+ 'self_unreg_allowed',
+ null,
+ get_lang('Learners are allowed to unregister themselves from groups')
+ ),
];
$form->addGroup(
$group,
diff --git a/public/main/group/settings.php b/public/main/group/settings.php
index 20a1e3ef81..1680b28cf8 100644
--- a/public/main/group/settings.php
+++ b/public/main/group/settings.php
@@ -111,15 +111,13 @@ $group = [
'checkbox',
'self_registration_allowed',
get_lang('Registration'),
- get_lang('Learners are allowed to self-register in groups'),
- 1
+ get_lang('Learners are allowed to self-register in groups')
),
$form->createElement(
'checkbox',
'self_unregistration_allowed',
null,
get_lang('Learners are allowed to unregister themselves from groups'),
- 1
),
];
$form->addGroup(
diff --git a/public/main/inc/lib/display.lib.php b/public/main/inc/lib/display.lib.php
index def75d9583..93fd7c9e98 100644
--- a/public/main/inc/lib/display.lib.php
+++ b/public/main/inc/lib/display.lib.php
@@ -1150,14 +1150,12 @@ class Display
$attributes['id'] = $id;
$attributes['class'] = 'tab_wrapper';
- $html = self::tag(
+ return self::tag(
'div',
$ul.
self::tag('div', $divs, ['class' => 'tab-content']),
$attributes
);
-
- return $html;
}
/**
@@ -1170,7 +1168,7 @@ class Display
{
$id = uniqid('tabs_');
$i = 1;
- $lis = null;
+ $list = '';
foreach ($headers as $item) {
$class = null;
if ($i == $selected) {
@@ -1185,15 +1183,11 @@ class Display
'class' => 'nav-link '.$class,
]
);
- $lis .= self::tag('li', $item, ['class' => 'nav-item']);
+ $list .= $item;
$i++;
}
- return self::tag(
- 'ul',
- $lis,
- ['class' => 'nav nav-tabs']
- );
+ return self::toolbarAction($id, [$list]);
}
/**
diff --git a/public/main/inc/lib/formvalidator/Element/DateTimeRangePicker.php b/public/main/inc/lib/formvalidator/Element/DateTimeRangePicker.php
index 3847478fa1..430df7ad8c 100644
--- a/public/main/inc/lib/formvalidator/Element/DateTimeRangePicker.php
+++ b/public/main/inc/lib/formvalidator/Element/DateTimeRangePicker.php
@@ -1,4 +1,5 @@
'.sprintf(get_lang('Reset %s'), $this->_label).'
-
-
+
+
'.$this->getElementJS();
}
- /**
- * @param string $layout
- *
- * @return string
- */
- public function getTemplate($layout)
+ public function getTemplate(string $layout): string
{
$size = $this->calculateSize();
$id = $this->getAttribute('id');
@@ -91,31 +87,31 @@ class DateTimeRangePicker extends DateRangePicker
{label_3}
-
-
+
+
+
';
break;
case FormValidator::LAYOUT_BOX_NO_LABEL:
return '
-
+
{icon}
{element}
';
@@ -182,13 +178,13 @@ class DateTimeRangePicker extends DateRangePicker
$endTime = $dates['end_time'];
}
- $js .= "";
diff --git a/public/main/inc/lib/groupmanager.lib.php b/public/main/inc/lib/groupmanager.lib.php
index 80c6f3ebf3..fb461a98b3 100644
--- a/public/main/inc/lib/groupmanager.lib.php
+++ b/public/main/inc/lib/groupmanager.lib.php
@@ -2755,27 +2755,22 @@ class GroupManager
}
$url = api_get_path(WEB_CODE_PATH).'group/%s?'.api_get_cidreq();
-
- echo '
- ';
+ ',
+ ];
+
+ echo Display::toolbarAction('group', $items);
}
public static function groupOverview($group, $url)
diff --git a/public/main/inc/lib/pear/HTML/QuickForm/checkbox.php b/public/main/inc/lib/pear/HTML/QuickForm/checkbox.php
index 4fcb7654b9..1f10ab1e9d 100644
--- a/public/main/inc/lib/pear/HTML/QuickForm/checkbox.php
+++ b/public/main/inc/lib/pear/HTML/QuickForm/checkbox.php
@@ -33,7 +33,7 @@ class HTML_QuickForm_checkbox extends HTML_QuickForm_input
/**
* Class constructor.
*
- * @param string $elementName (optional)Input field name attribute
+ * @param string $elementName Input field name attribute
* @param string $elementLabel (optional)Input field value
* @param string $text (optional)Checkbox display text
* @param mixed $attributes (optional)Either a typical HTML attribute string
@@ -47,7 +47,7 @@ class HTML_QuickForm_checkbox extends HTML_QuickForm_input
$elementName = null,
$elementLabel = null,
$text = '',
- $attributes = null
+ ?array $attributes = []
) {
$this->labelClass = isset($attributes['label-class']) ? $attributes['label-class'] : '';
$this->checkboxClass = isset($attributes['checkbox-class']) ? $attributes['checkbox-class'] : 'checkbox';
diff --git a/public/main/inc/lib/pear/HTML/QuickForm/radio.php b/public/main/inc/lib/pear/HTML/QuickForm/radio.php
index 6d8cec44b6..fae908a986 100644
--- a/public/main/inc/lib/pear/HTML/QuickForm/radio.php
+++ b/public/main/inc/lib/pear/HTML/QuickForm/radio.php
@@ -38,8 +38,6 @@ class HTML_QuickForm_radio extends HTML_QuickForm_input
public $radioClass;
/**
- * Class constructor
- *
* @param string Input field name attribute
* @param mixed Label(s) for a field
* @param string Text to display near the radio
@@ -54,7 +52,7 @@ class HTML_QuickForm_radio extends HTML_QuickForm_input
$elementLabel = null,
$text = null,
$value = null,
- $attributes = []
+ ?array $attributes = []
) {
$this->labelClass = $attributes['label-class'] ?? '';
$this->radioClass = $attributes['radio-class'] ?? 'form-check';
diff --git a/public/main/session/session_list.php b/public/main/session/session_list.php
index a0cd96fdba..06f3750ce8 100644
--- a/public/main/session/session_list.php
+++ b/public/main/session/session_list.php
@@ -14,8 +14,8 @@ SessionManager::protectSession(null, false);
// Add the JS needed to use the jqgrid
$htmlHeadXtra[] = api_get_jqgrid_js();
-$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
-$idChecked = isset($_REQUEST['idChecked']) ? $_REQUEST['idChecked'] : null;
+$action = $_REQUEST['action'] ?? null;
+$idChecked = $_REQUEST['idChecked'] ?? null;
$listType = isset($_REQUEST['list_type']) ? Security::remove_XSS($_REQUEST['list_type']) : SessionManager::getDefaultSessionTab();
switch ($action) {
diff --git a/public/main/survey/create_new_survey.php b/public/main/survey/create_new_survey.php
index 39ca4ba4df..46f94c23a8 100644
--- a/public/main/survey/create_new_survey.php
+++ b/public/main/survey/create_new_survey.php
@@ -213,19 +213,22 @@ $form->addElement('html', ' 'javascript: if (this.checked) { document.getElementById(\'gradebook_options\').style.display = \'block\'; } else { document.getElementById(\'gradebook_options\').style.display = \'none\'; }'],
);
$form->addHtml(' ');
- $form->addElement(
- 'text',
+ $form->addText(
'survey_weight',
get_lang('Weight in Report'),
- 'value="0.00" style="width: 40px;" onfocus="javascript: this.select();"'
+ false,
+ [
+ 'value' => "0.00",
+ 'style' => "width: 40px;",
+ 'onfocus' => 'javascript: this.select();',
+ ]
);
$form->applyFilter('survey_weight', 'html_filter');
diff --git a/public/main/survey/survey.php b/public/main/survey/survey.php
index 4ca7ba7333..352b7f8e34 100644
--- a/public/main/survey/survey.php
+++ b/public/main/survey/survey.php
@@ -185,59 +185,58 @@ if (3 != $survey_data['survey_type']) {
}
$survey_actions .= SurveyUtil::getAdditionalTeacherActions($survey_id, ICON_SIZE_MEDIUM);
-
-echo ' '.$survey_actions.' ';
+echo Display::toolbarAction('survey', [$survey_actions]);
$urlQuestion = api_get_path(WEB_CODE_PATH).'survey/question.php?'.api_get_cidreq().'&action=add';
if (0 == $survey_data['survey_type']) {
- echo ' ';
- echo Display::url(
+ $questions = Display::url(
Display::return_icon('yesno.png', get_lang('Yes / No'), null, ICON_SIZE_BIG),
$urlQuestion.'&type=yesno&survey_id='.$survey_id
);
- echo Display::url(
+ $questions .= Display::url(
Display::return_icon('mcua.png', get_lang('Multiple choice'), null, ICON_SIZE_BIG),
$urlQuestion.'&type=multiplechoice&survey_id='.$survey_id
);
- echo Display::url(
+ $questions .= Display::url(
Display::return_icon('mcma.png', get_lang('Multiple answers'), null, ICON_SIZE_BIG),
$urlQuestion.'&type=multipleresponse&survey_id='.$survey_id
);
- echo Display::url(
+ $questions .= Display::url(
Display::return_icon('open_answer.png', get_lang('Open'), null, ICON_SIZE_BIG),
$urlQuestion.'&type=open&survey_id='.$survey_id
);
- echo Display::url(
+ $questions .= Display::url(
Display::return_icon('dropdown.png', get_lang('Dropdown'), null, ICON_SIZE_BIG),
$urlQuestion.'&type=dropdown&survey_id='.$survey_id
);
- echo Display::url(
+ $questions .= Display::url(
Display::return_icon('percentagequestion.png', get_lang('Percentage'), null, ICON_SIZE_BIG),
$urlQuestion.'&type=percentage&survey_id='.$survey_id
);
- echo Display::url(
+ $questions .= Display::url(
Display::return_icon('scorequestion.png', get_lang('Score'), null, ICON_SIZE_BIG),
$urlQuestion.'&type=score&survey_id='.$survey_id
);
- echo Display::url(
+ $questions .= Display::url(
Display::return_icon('commentquestion.png', get_lang('Comment'), null, ICON_SIZE_BIG),
$urlQuestion.'&type=comment&survey_id='.$survey_id
);
- echo Display::url(
+ $questions .= Display::url(
Display::return_icon('mcua.png', get_lang('SurveyMultipleAnswerWithOther'), null, ICON_SIZE_BIG),
$urlQuestion.'&type=multiplechoiceother&survey_id='.$survey_id
);
if (0 == $survey_data['one_question_per_page']) {
- echo Display::url(
+ $questions .= Display::url(
Display::return_icon('yesno.png', get_lang('SurveyQuestionSelectiveDisplay'), null, ICON_SIZE_BIG),
$urlQuestion.'&type=selectivedisplay&survey_id='.$survey_id
);
- echo Display::url(
+ $questions .= Display::url(
Display::return_icon('page_end.png', get_lang('Pagebreak'), null, ICON_SIZE_BIG),
$urlQuestion.'&type=pagebreak&survey_id='.$survey_id
);
}
- echo ' ';
+
+ echo Display::toolbarAction('questions', [$questions]);
} else {
if (3 != $survey_data['survey_type']) {
echo ' ';
diff --git a/public/main/work/work.lib.php b/public/main/work/work.lib.php
index 9d4710408d..5da2c78aeb 100644
--- a/public/main/work/work.lib.php
+++ b/public/main/work/work.lib.php
@@ -5496,7 +5496,7 @@ function getFormWork($form, $defaults = [], $workId = 0)
}
// ScoreOfAssignment
- $form->addElement('text', 'qualification', get_lang('ScoreNumeric'));
+ $form->addText('qualification', get_lang('ScoreNumeric'));
if (0 != $sessionId && Gradebook::is_active() || 0 == $sessionId) {
$form->addElement(
@@ -5511,7 +5511,7 @@ function getFormWork($form, $defaults = [], $workId = 0)
);
} else {
// QualificationOfAssignment
- $form->addElement('hidden', 'make_calification', false);
+ $form->addHidden('make_calification', false);
}
if (!empty($defaults) && isset($defaults['category_id'])) {
@@ -5526,7 +5526,12 @@ function getFormWork($form, $defaults = [], $workId = 0)
$form->addElement('text', 'weight', get_lang('Weight inside assessment'));
$form->addHtml(' ');
- $form->addElement('checkbox', 'enableExpiryDate', null, get_lang('Enable handing over deadline (visible to learners)'), 'id="expiry_date"');
+ $form->addCheckBox(
+ 'enableExpiryDate',
+ null,
+ get_lang('Enable handing over deadline (visible to learners)'),
+ ['id' => 'expiry_date']
+ );
if (isset($defaults['enableExpiryDate']) && $defaults['enableExpiryDate']) {
$form->addHtml(' ');
} else {
@@ -5542,7 +5547,12 @@ function getFormWork($form, $defaults = [], $workId = 0)
$form->addElement('date_time_picker', 'expires_on', get_lang('Posted sending deadline'));
$form->addHtml(' ');
- $form->addElement('checkbox', 'enableEndDate', null, get_lang('Enable final acceptance date (invisible to learners)'), 'id="end_date"');
+ $form->addCheckBox(
+ 'enableEndDate',
+ null,
+ get_lang('Enable final acceptance date (invisible to learners)'),
+ ['id' => 'end_date']
+ );
if (!isset($defaults['ends_on'])) {
$nextDay = substr(api_get_local_time($timeNextWeek + 86400), 0, 10);
@@ -5558,8 +5568,8 @@ function getFormWork($form, $defaults = [], $workId = 0)
$form->addElement('date_time_picker', 'ends_on', get_lang('Ends at (completely closed)'));
$form->addHtml(' ');
- $form->addElement('checkbox', 'add_to_calendar', null, get_lang('Add to calendar'));
- $form->addElement('select', 'allow_text_assignment', get_lang('Document type'), getUploadDocumentType());
+ $form->addCheckBox('add_to_calendar', null, get_lang('Add to calendar'));
+ $form->addSelect('allow_text_assignment', get_lang('Document type'), getUploadDocumentType());
// Extra fields
$extraField = new ExtraField('work');
diff --git a/src/CoreBundle/Resources/views/Admin/Settings/menu.html.twig b/src/CoreBundle/Resources/views/Admin/Settings/menu.html.twig
index d6de47fabc..30e0c78c34 100644
--- a/src/CoreBundle/Resources/views/Admin/Settings/menu.html.twig
+++ b/src/CoreBundle/Resources/views/Admin/Settings/menu.html.twig
@@ -1,9 +1,9 @@
- |