Add teachers in course list see BT#15597

pull/2913/head
Julio Montoya 7 years ago
parent 1c935a3c64
commit a660c27fac
  1. 75
      main/auth/courses_list.php

@ -28,6 +28,7 @@ if (!empty($message)) {
} }
$allowCollapsable = api_get_configuration_value('allow_user_course_category_collapsable'); $allowCollapsable = api_get_configuration_value('allow_user_course_category_collapsable');
$teachersIcon = Display::return_icon('teacher.png', get_lang('Teachers'), null, ICON_SIZE_TINY);
// COURSES WITH CATEGORIES // COURSES WITH CATEGORIES
if (!empty($user_course_categories)) { if (!empty($user_course_categories)) {
@ -107,12 +108,14 @@ if (!empty($user_course_categories)) {
$key = 0; $key = 0;
if (!empty($courses_in_category[$row['id']])) { if (!empty($courses_in_category[$row['id']])) {
foreach ($courses_in_category[$row['id']] as $course) { foreach ($courses_in_category[$row['id']] as $course) {
?> echo '<tr><td>';
<tr> echo '<a name="course'.$course['code'].'"></a>';
<td> echo '<strong>'.$course['title'].'</strong>';
<a name="course<?php echo $course['code']; ?>"></a> echo '<br />';
<strong><?php echo $course['title']; ?></strong><br /> echo $teachersIcon;
<?php echo '&nbsp;';
echo CourseManager::getTeacherListFromCourseCodeToString($course['code']);
echo '<br />';
if (api_get_setting('display_coursecode_in_courselist') === 'true') { if (api_get_setting('display_coursecode_in_courselist') === 'true') {
echo $course['visual_code']; echo $course['visual_code'];
} }
@ -125,11 +128,8 @@ if (!empty($user_course_categories)) {
if (api_get_setting('display_teacher_in_courselist') === 'true') { if (api_get_setting('display_teacher_in_courselist') === 'true') {
echo $course['tutor']; echo $course['tutor'];
} ?> }
</td> echo '</td><td valign="top">';
<td valign="top">
<!-- edit -->
<?php
if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) { if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) {
$edit_course = Security::remove_XSS($_GET['edit']); ?> $edit_course = Security::remove_XSS($_GET['edit']); ?>
@ -226,27 +226,30 @@ if (!empty($courses_without_category)) {
$number_of_courses = count($courses_without_category); $number_of_courses = count($courses_without_category);
$key = 0; $key = 0;
foreach ($courses_without_category as $course) { foreach ($courses_without_category as $course) {
echo '<tr>'; ?> echo '<tr><td>';
<td> echo '<a name="course'.$course['code'].'"></a>';
<a name="course<?php echo $course['code']; ?>"></a> echo '<strong>'.$course['title'].'</strong>';
<strong><?php echo $course['title']; ?></strong><br /> echo '<br />';
<?php echo $teachersIcon;
if (api_get_setting('display_coursecode_in_courselist') === 'true') { echo '&nbsp;';
echo $course['visual_code']; echo CourseManager::getTeacherListFromCourseCodeToString($course['code']);
} echo '<br />';
if (api_get_setting('display_coursecode_in_courselist') === 'true') {
echo $course['visual_code'];
}
if (api_get_setting('display_coursecode_in_courselist') === 'true' && if (api_get_setting('display_coursecode_in_courselist') === 'true' &&
api_get_setting('display_teacher_in_courselist') === 'true' api_get_setting('display_teacher_in_courselist') === 'true'
) { ) {
echo ' - '; echo ' - ';
} }
if (api_get_setting('display_teacher_in_courselist') === 'true') { if (api_get_setting('display_teacher_in_courselist') === 'true') {
echo $course['tutor']; echo $course['tutor'];
} ?> }
</td> echo '</td><td valign="top">';
<td valign="top"> // the edit icon OR the edit dropdown list
<!-- the edit icon OR the edit dropdown list --> if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) {
<?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) {
$edit_course = Security::remove_XSS($_GET['edit']); ?> $edit_course = Security::remove_XSS($_GET['edit']); ?>
<div style="float:left;"> <div style="float:left;">
<form name="edit_course_category" method="post" action="courses.php?action=<?php echo $action; ?>"> <form name="edit_course_category" method="post" action="courses.php?action=<?php echo $action; ?>">
@ -259,11 +262,11 @@ if (!empty($courses_without_category)) {
<option value="<?php echo $row['id']; ?>"><?php echo $row['title']; ?></option> <option value="<?php echo $row['id']; ?>"><?php echo $row['title']; ?></option>
<?php <?php
} ?> } ?>
</select> </select>
<button class="save" type="submit" name="submit_change_course_category"><?php echo get_lang('Ok'); ?></button> <button class="save" type="submit" name="submit_change_course_category"><?php echo get_lang('Ok'); ?></button>
</form><br /> </form><br />
</div> </div>
<?php <?php
} ?> } ?>
<div style="float:left; width:110px"> <div style="float:left; width:110px">
<?php <?php
@ -275,19 +278,15 @@ if (!empty($courses_without_category)) {
<?php <?php
} }
if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) { if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) {
?> echo Display::display_icon('edit_na.png', get_lang('Edit'), '', 22);
<?php echo Display::display_icon('edit_na.png', get_lang('Edit'), '', 22); ?>
<?php
} else { } else {
?> ?>
<a href="courses.php?action=<?php echo $action; ?>&amp;edit=<?php echo $course['code']; ?>&amp;sec_token=<?php echo $stok; ?>"> <a href="courses.php?action=<?php echo $action; ?>&amp;edit=<?php echo $course['code']; ?>&amp;sec_token=<?php echo $stok; ?>">
<?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?> <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?>
</a> </a>
<?php <?php
} ?> }
if ($key > 0) {
<!-- up /down icons-->
<?php if ($key > 0) {
?> ?>
<a href="courses.php?action=<?php echo $action; ?>&amp;move=up&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>"> <a href="courses.php?action=<?php echo $action; ?>&amp;move=up&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
<?php echo Display::display_icon('up.png', get_lang('Up'), '', 22); ?> <?php echo Display::display_icon('up.png', get_lang('Up'), '', 22); ?>

Loading…
Cancel
Save