Replace custom HTML with functions to parse HTML elements

Fix UI elements
pull/3890/head
Julio Montoya 4 years ago
parent b121368d8c
commit bcc9e910c5
  1. 8
      assets/css/app.scss
  2. 56
      public/main/dropbox/index.php
  3. 2
      public/main/gradebook/lib/be/category.class.php
  4. 5
      public/main/group/group.php
  5. 8
      public/main/group/group_category.php
  6. 4
      public/main/group/settings.php
  7. 14
      public/main/inc/lib/display.lib.php
  8. 50
      public/main/inc/lib/formvalidator/Element/DateTimeRangePicker.php
  9. 35
      public/main/inc/lib/groupmanager.lib.php
  10. 4
      public/main/inc/lib/pear/HTML/QuickForm/checkbox.php
  11. 4
      public/main/inc/lib/pear/HTML/QuickForm/radio.php
  12. 4
      public/main/session/session_list.php
  13. 15
      public/main/survey/create_new_survey.php
  14. 29
      public/main/survey/survey.php
  15. 22
      public/main/work/work.lib.php
  16. 4
      src/CoreBundle/Resources/views/Admin/Settings/menu.html.twig
  17. 2
      src/CoreBundle/Resources/views/Course/settings_menu.html.twig

@ -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";
}

@ -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 '<div class="actions">';
if (0 != $view_dropbox_category_received && api_is_allowed_to_session_edit(false, true)) {
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.
$actions .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.
Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('root'), '', ICON_SIZE_MEDIUM).
"</a>";
echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> ';
$actions .= get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> ';
$movelist[0] = 'Root'; // move_received selectbox content
} else {
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.
$actions .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.
Display::return_icon('new_folder.png', get_lang('Add a new folder'), '', ICON_SIZE_MEDIUM).'</a>';
}
echo '</div>';
echo Display::toolbarAction('dropbox', [$actions]);
} else {
if (api_is_allowed_to_session_edit(false, true)) {
echo '<div class="actions">';
if (0 != $view_dropbox_category_received && api_is_allowed_to_session_edit(false, true)) {
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.
$actions .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.
Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('root'), '', ICON_SIZE_MEDIUM)."</a>";
echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> ';
$actions .= get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> ';
$movelist[0] = 'Root'; // move_received selectbox content
} else {
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.
$actions .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.
Display::return_icon('new_folder.png', get_lang('Add a new folder'), '', ICON_SIZE_MEDIUM).
'</a>';
}
echo '</div>';
echo Display::toolbarAction('dropbox', [$actions]);
}
}
}
if (!$view || 'sent' == $view || !$showSentReceivedTabs) {
$actions = '';
if (!$view || 'sent' === $view || !$showSentReceivedTabs) {
// This is for the categories
if (isset($viewSentCategory) && '' != $viewSentCategory) {
$view_dropbox_category_sent = $viewSentCategory;
@ -281,40 +281,38 @@ if ('add' != $action) {
/* Menu Sent */
if (0 == api_get_session_id()) {
echo '<div class="actions">';
if (empty($viewSentCategory)) {
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".
$actions .= "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".
Display::return_icon('upload_file.png', get_lang('Share a new file'), '', ICON_SIZE_MEDIUM).
"</a>";
}
if (0 != $view_dropbox_category_sent) {
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.
$actions .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.
Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('root'), '', ICON_SIZE_MEDIUM).
"</a>";
echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> ';
$actions .= get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> ';
} else {
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".
$actions .= "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".
Display::return_icon('new_folder.png', get_lang('Add a new folder'), '', ICON_SIZE_MEDIUM)."</a>\n";
}
echo '</div>';
echo Display::toolbarAction('dropbox', [$actions]);
} else {
if (api_is_allowed_to_session_edit(false, true)) {
echo '<div class="actions">';
if (empty($viewSentCategory)) {
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".
$actions .= "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".
Display::return_icon('upload_file.png', get_lang('Share a new file'), '', ICON_SIZE_MEDIUM).
"</a>";
}
if (0 != $view_dropbox_category_sent) {
echo get_lang('You are in folder').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> ';
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.
$actions .= get_lang('You are in folder').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> ';
$actions .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.
Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('root'), '', ICON_SIZE_MEDIUM).
"</a>";
} else {
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".
$actions .= "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".
Display::return_icon('new_folder.png', get_lang('Add a new folder'), '', ICON_SIZE_MEDIUM)."</a>\n";
}
echo '</div>';
echo Display::toolbarAction('dropbox', [$actions]);
}
}
}
@ -339,7 +337,7 @@ if ('add' != $action) {
<?php
}
/* RECEIVED FILES */
if ('received' == $view || !$showSentReceivedTabs) {
if ('received' === $view || !$showSentReceivedTabs) {
// This is for the categories
if (isset($viewReceivedCategory) && '' != $viewReceivedCategory) {
$view_dropbox_category_received = $viewReceivedCategory;
@ -455,7 +453,7 @@ if ('add' != $action) {
if ('viewfeedback' == $action && isset($_GET['id']) && is_numeric($_GET['id']) && $dropbox_file->id == $_GET['id']) {
$action_icons .= "</td></tr>"; // Ending the normal row of the sortable table
$url = api_get_path(WEB_CODE_PATH).'dropbox/index.php?"'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory."&view_sent_category=".$viewSentCategory."&view=".$view.'&'.$sort_params;
$action_icons .= "
$action_icons .= "
<tr>
<td colspan=\"9\">".
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').'
<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.
Display::return_icon('discuss.png', get_lang('Comment'), '', ICON_SIZE_SMALL).
'</a>
'</a>
<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/update.php?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=update&id='.$dropbox_file->id.'&'.$sort_params.'">'.
Display::return_icon('upload_file.png', get_lang('Update'), '', ICON_SIZE_SMALL).
'</a>
'</a>
<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movesent&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.
Display::return_icon('move.png', get_lang('Move'), '', ICON_SIZE_SMALL).'
</a>

@ -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));

@ -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;
}

@ -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,

@ -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(

@ -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]);
}
/**

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**
@ -41,17 +42,12 @@ class DateTimeRangePicker extends DateRangePicker
<span class="fa fa-trash text-danger" aria-hidden="true"></span>
<span class="sr-only">'.sprintf(get_lang('Reset %s'), $this->_label).'</span>
</button>
</span>
</div>
</span>
</div>
'.$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
<!-- BEGIN label_3 -->
{label_3}
<!-- END label_3 -->
</div>
</div>
</div>
</div>
<div class="form-group {error_class}">
<label class="col-sm-'.$size[0].' control-label" >
<!-- BEGIN required --><span class="form_required">*</span><!-- END required -->
'.get_lang('Hour').'
</label>
<div class="col-sm-'.$size[1].'">
<div class="input-group">
<p id="'.$id.'_time_range">
<input type="text" id="'.$id.'_time_range_start" name="'.$id.'_time_range_start" class="time start" autocomplete="off">
<div class="col-sm-'.$size[1].'">
<div class="input-group">
<p id="'.$id.'_time_range">
<input type="text" id="'.$id.'_time_range_start" name="'.$id.'_time_range_start" class="time start" autocomplete="off">
'.get_lang('To').'
<input type="text" id="'.$id.'_time_range_end" name="'.$id.'_time_range_end" class="time end " autocomplete="off">
</p>
</div>
</div>
</div>
</div>
</span>
</div>
</span>
';
break;
case FormValidator::LAYOUT_BOX_NO_LABEL:
return '
<label {label-for}>{label}</label>
<div class="input-group">
{icon}
{element}
</div>';
@ -182,13 +178,13 @@ class DateTimeRangePicker extends DateRangePicker
$endTime = $dates['end_time'];
}
$js .= "<script>
$js .= "<script>
$(function() {
var txtDate = $('#$id'),
inputGroup = txtDate.parents('.input-group'),
txtDateAlt = $('#{$id}_alt'),
txtDateAltText = $('#{$id}_alt_text');
txtDate
.hide()
.datepicker({
@ -207,11 +203,11 @@ class DateTimeRangePicker extends DateRangePicker
.on('change', function (e) {
txtDateAltText.text(txtDateAlt.val());
});
txtDateAltText.on('click', function () {
txtDate.datepicker('show');
});
inputGroup
.find('button')
.on('click', function (e) {
@ -219,18 +215,18 @@ class DateTimeRangePicker extends DateRangePicker
$('#$id, #{$id}_alt').val('');
$('#{$id}_alt_text').html('');
});
$('#".$id."_time_range .time').timepicker({
'showDuration': true,
'timeFormat': 'H:i:s',
'scrollDefault': 'now',
'scrollDefault': 'now',
});
$('#".$id."_time_range_start').timepicker('setTime', new Date('".$startTime."'));
$('#".$id."_time_range_end').timepicker('setTime', new Date('".$endTime."'));
var timeOnlyExampleEl = document.getElementById('".$id."_time_range');
var timeOnlyDatepair = new Datepair(timeOnlyExampleEl);
var timeOnlyDatepair = new Datepair(timeOnlyExampleEl);
});
</script>";

@ -2755,27 +2755,22 @@ class GroupManager
}
$url = api_get_path(WEB_CODE_PATH).'group/%s?'.api_get_cidreq();
echo '
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link '.$activeSettings.'"
id="group_settings_tab" href="'.sprintf($url, 'settings.php').'">
'.Display::return_icon('settings.png').' '.get_lang('Settings').'
</a>
</li>
<li class="nav-item">
<a class="nav-link '.$activeMember.'"
id="group_members_tab" href="'.sprintf($url, 'member_settings.php').'">
'.Display::return_icon('user.png').' '.get_lang('Group members').'</a>
</li>
<li class="nav-item">
<a class="nav-link '.$activeTutor.'"
id="group_tutors_tab" href="'.sprintf($url, 'tutor_settings.php').'">
$items = [
'<a class="nav-link '.$activeSettings.'"
id="group_settings_tab" href="'.sprintf($url, 'settings.php').'">
'.Display::return_icon('settings.png').' '.get_lang('Settings').'
</a>'.
'<a class="nav-link '.$activeMember.'"
id="group_members_tab" href="'.sprintf($url, 'member_settings.php').'">
'.Display::return_icon('user.png').' '.get_lang('Group members').
'</a>'.
'<a class="nav-link '.$activeTutor.'"
id="group_tutors_tab" href="'.sprintf($url, 'tutor_settings.php').'">
'.Display::return_icon('teacher.png').' '.get_lang('Group tutors').'
</a>
</li>
</ul>';
</a>',
];
echo Display::toolbarAction('group', $items);
}
public static function groupOverview($group, $url)

@ -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';

@ -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';

@ -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) {

@ -213,19 +213,22 @@ $form->addElement('html', '<div id="advanced_params_options" style="display:none
if (Gradebook::is_active()) {
// An option: Qualify the fact that survey has been answered in the gradebook
$form->addElement(
'checkbox',
$form->addCheckBox(
'survey_qualify_gradebook',
null,
get_lang('Grade in the assessment tool'),
'onclick="javascript: if (this.checked) { document.getElementById(\'gradebook_options\').style.display = \'block\'; } else { document.getElementById(\'gradebook_options\').style.display = \'none\'; }"'
['onclick' => 'javascript: if (this.checked) { document.getElementById(\'gradebook_options\').style.display = \'block\'; } else { document.getElementById(\'gradebook_options\').style.display = \'none\'; }'],
);
$form->addHtml('<div id="gradebook_options"'.($gradebook_link_id ? '' : ' style="display:none"').'>');
$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');

@ -185,59 +185,58 @@ if (3 != $survey_data['survey_type']) {
}
$survey_actions .= SurveyUtil::getAdditionalTeacherActions($survey_id, ICON_SIZE_MEDIUM);
echo '<div class="actions">'.$survey_actions.'</div>';
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 '<div class="well">';
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 '</div>';
echo Display::toolbarAction('questions', [$questions]);
} else {
if (3 != $survey_data['survey_type']) {
echo '<div class="well">';

@ -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('</div>');
$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('<div id="option2" style="display: block;">');
} 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('</div>');
$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('</div>');
$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');

@ -1,9 +1,9 @@
<div class="list-group">
<div class="list-group q-card ">
{% set current_namespace = app.request.get('namespace') %}
{% for namespace in schemas|keys %}
{% set namespace = namespace | replace({'chamilo_core.settings.' : ''}) %}
<a
class = "list-group-item list-group-item-action {% if (current_namespace == namespace) %} active {% endif %} "
class = "list-group-item {% if (current_namespace == namespace) %} active {% endif %} "
href="{{ path('chamilo_platform_settings', { 'namespace': namespace }) }}"
>
<img src="{{ asset('img/icons/32/' ~ namespace ~'.png') }}" />

@ -1,4 +1,4 @@
<div class="list-group">
<div class="list-group q-card ">
{% set current_namespace = app.request.get('namespace') %}
{% for namespace in schemas|keys %}
{% set namespace = namespace | replace({'chamilo_course.settings.' : ''}) %}

Loading…
Cancel
Save