Fix toolbar, fix php warnings

pull/3890/head
Julio Montoya 4 years ago
parent d0ad3303e2
commit f20377098a
  1. 28
      public/main/inc/lib/tracking.lib.php
  2. 2
      public/main/lp/LearnPathItemForm.php
  3. 3
      public/main/lp/learnpath.class.php
  4. 4
      public/main/tracking/courseLog.php
  5. 4
      public/main/tracking/course_log_events.php
  6. 14
      public/main/tracking/course_log_resources.php
  7. 11
      public/main/tracking/course_log_tools.php
  8. 3
      public/main/tracking/exams.php
  9. 2
      public/main/tracking/lp_report.php

@ -8789,7 +8789,7 @@ class TrackingCourseLog
/**
* @param string $current
*/
public static function actionsLeft($current, $sessionId = 0)
public static function actionsLeft($current, $sessionId = 0, $addWrapper = true)
{
$usersLink = Display::url(
Display::return_icon('user.png', get_lang('Report on learners'), [], ICON_SIZE_MEDIUM),
@ -8897,17 +8897,21 @@ class TrackingCourseLog
break;
}
$items = [
$usersLink,
$groupsLink,
$courseLink,
$resourcesLink,
$examLink,
$eventsLink,
$lpLink,
$attendanceLink,
];
$links =
$usersLink.
$groupsLink.
$courseLink.
$resourcesLink.
$examLink.
$eventsLink.
$lpLink.
$attendanceLink
;
if ($addWrapper) {
return Display::toolbarAction('tracking', [$links]);
}
return Display::toolbarAction('tracking', $items);
return $links;
}
}

@ -135,7 +135,7 @@ class LearnPathItemForm
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate(' {label}{element}', 'content_lp');
$form->addHtml('<div class="editor-lp">');
$form->addHtmlEditor('content_lp', null, null, true, $editorConfig, true);
$form->addHtmlEditor('content_lp', null, null, true, $editorConfig);
$form->addHtml('</div>');
if ($document) {
$form->addHidden('document_id', $document->getIid());

@ -9536,8 +9536,7 @@ EOD;
null,
true,
false,
$editorConfig,
true
$editorConfig
);
$form->addHidden('action', 'add_final_item');
$form->addHidden('path', Session::read('pathItem'));

@ -196,7 +196,7 @@ Session::write('extra_field_info', $extra_info);
Display::display_header($nameTools, 'Tracking');
$actionsLeft = TrackingCourseLog::actionsLeft('users', $sessionId);
$actionsLeft = TrackingCourseLog::actionsLeft('users', $sessionId, false);
$actionsRight = '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>';
@ -234,7 +234,7 @@ $form_search->addHidden('cid', $courseId);
$form_search->addElement('text', 'user_keyword');
$form_search->addButtonSearch(get_lang('Search users'));
echo Display::toolbarAction(
'toolbar-courselog',
'course_log',
[$actionsLeft, $form_search->returnForm(), $actionsRight]
);

@ -126,12 +126,8 @@ $(function() {
</script>';
Display::display_header();
echo '<div class="actions">';
echo TrackingCourseLog::actionsLeft('logs', api_get_session_id());
echo '</div>';
$form = new FormValidator(
'search_simple',
'get',

@ -93,10 +93,8 @@ $nametools = get_lang('Reporting');
Display::display_header($nametools, 'Reporting');
echo '<div class="actions">';
echo TrackingCourseLog::actionsLeft('resources', api_get_session_id());
echo '<span style="float:right; padding-top:0px;">';
echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
$left = TrackingCourseLog::actionsLeft('resources', api_get_session_id(), false);
$right = '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).
'</a>';
@ -110,12 +108,12 @@ if (isset($_GET['users_tracking_per_page'])) {
$users_tracking_per_page = '&users_tracking_per_page='.intval($_GET['users_tracking_per_page']);
}
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&'.$addional_param.$users_tracking_per_page.'">
$right .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&'.$addional_param.$users_tracking_per_page.'">
'.Display::return_icon('export_csv.png', get_lang('CSV export'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=xls&'.$addional_param.$users_tracking_per_page.'">
$right .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=xls&'.$addional_param.$users_tracking_per_page.'">
'.Display::return_icon('export_excel.png', get_lang('Excel export'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</span>';
echo '</div>';
echo Display::toolbarAction('log_resource', [$left, $right]);
// Create a search-box.
$form = new FormValidator(

@ -100,15 +100,16 @@ $nbStudents = count($a_students);
$student_ids = array_keys($a_students);
$studentCount = count($student_ids);
echo TrackingCourseLog::actionsLeft('courses', api_get_session_id());
$left = TrackingCourseLog::actionsLeft('courses', api_get_session_id(), false);
echo '<span style="float:right; padding-top:0px;">';
echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
$right = '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&id_session='.api_get_session_id().'&export=csv">
$right .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&id_session='.api_get_session_id().'&export=csv">
'.Display::return_icon('export_csv.png', get_lang('CSV export'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</span>';
$right .= '</span>';
echo Display::toolbarAction('tools', [$left, $right]);
$course_code = api_get_course_id();
$course_id = api_get_course_int_id();

@ -122,8 +122,7 @@ if (!$exportToXLS) {
}
}
} else {
$actionsLeft = TrackingCourseLog::actionsLeft('exams', api_get_session_id());
$actionsLeft = TrackingCourseLog::actionsLeft('exams', api_get_session_id(), false);
$actionsRight .= Display::url(
Display::return_icon('export_excel.png', get_lang('Excel export'), [], 32),
api_get_self().'?'.api_get_cidreq().'&export=1&score='.$filter_score.'&exercise_id='.$exerciseId

@ -423,7 +423,7 @@ if (!empty($action)) {
}
}
$actionsLeft = TrackingCourseLog::actionsLeft('lp');
$actionsLeft = TrackingCourseLog::actionsLeft('lp', api_get_session_id(), false);
$actionsCenter = '';
$actionsRight = Display::url(
Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), null, ICON_SIZE_MEDIUM),

Loading…
Cancel
Save