public function renderContent() { global $platformLanguage; $out = ''; // Last user action $lastUserAction = isset($_SESSION['last_action']) && $_SESSION['last_action'] != '1970-01-01 00:00:00' ? $_SESSION['last_action'] : date('Y-m-d H:i:s'); $userCommands = array(); // User commands // 'Create Course Site' command. Only available for teacher. if (claro_is_allowed_to_create_course()) { $userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'course/create.php')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('courseadd') . '" alt="" /> ' . get_lang('Create a course site') . '</a>' . "\n"; } elseif ($GLOBALS['currentUser']->isCourseCreator) { $userCommands[] = '<span class="userCommandsItemDisabled">' . '<img src="' . get_icon_url('courseadd') . '" alt="" /> ' . get_lang('Create a course site') . '</span>' . "\n"; } if (get_conf('allowToSelfEnroll', true)) { $userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=rqReg&categoryId=0')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('enroll') . '" alt="" /> ' . get_lang('Enrol on a new course') . '</a>' . "\n"; $userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=rqUnreg')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('unenroll') . '" alt="" /> ' . get_lang('Remove course enrolment') . '</a>' . "\n"; } $userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'course/platform_courses.php')) . '" class="userCommandsItem">' . '<img src="' . get_icon_url('course') . '" alt="" /> ' . get_lang('All platform courses') . '</a>' . "\n"; $userCommands[] = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'notification_date.php')) . '" class="userCommandsItem">' . '<img class="iconDefinitionList" src="' . get_icon_url('hot') . '" alt="' . get_lang('New items') . '" />' . ' ' . get_lang('New items') . ' ' . get_lang('to another date') . (substr($lastUserAction, strlen($lastUserAction) - 8) == '00:00:00' ? ' [' . claro_html_localised_date(get_locale('dateFormatNumeric'), strtotime($lastUserAction)) . ']' : '') . '</a>' . "\n"; $userCourseList = render_user_course_list(); $userCourseListDesactivated = render_user_course_list_desactivated(); $out .= '<div class="userCommands">' . '<h2>' . get_lang('Manage my courses') . '</h2>' . claro_html_list($userCommands) . '</div>' . '<div class="userCourseList">' . '<h2>' . get_lang('My course list') . '</h2>' . $userCourseList; if (!empty($userCourseListDesactivated)) { $out .= '<h4>' . get_lang('Deactivated course list') . '</h4>' . $userCourseListDesactivated; } $out .= '</div>'; /*'</td>' . '</tr>' . '</tbody>' . '</table>'*/ $this->content = $out; return $this->content; }
} /****************************************************************************** * CLAROLINE ****************************************************************************** * This module displays the course list of a the current authenticated user * * @version 1.9 $Revision: 11724 $ * @copyright (c) 2001-2008 Universite catholique de Louvain (UCL) * @license (GPL) GENERAL PUBLIC LICENSE - http://www.gnu.org/copyleft/gpl.html * @package CLINDEX ******************************************************************************/ if (!claro_is_user_authenticated()) { claro_disp_auth_form(); } //List $userCourseList = render_user_course_list(); $userCourseListDesactivated = render_user_course_list_desactivated(); echo claro_html_tool_title(get_lang('My course list')); // display activated list if (!empty($userCourseList)) { echo $userCourseList; } elseif (empty($userCourseListDesactivated)) { echo get_lang('You are not enrolled to any course on this platform or all your courses are deactivated'); } else { echo get_lang('All your courses are deactivated (see list below)'); } //display legend if required if (!empty($modified_course)) { echo '<br />' . '<small><span class="item hot"> ' . get_lang('denotes new items') . '</span></small>' . '</td>' . "\n"; } // DISPLAY DEACTIVATED COURSES