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; }
public function export() { $postsList = $this->loadTopic($this->getTopicId()); $topicInfo = get_topic_settings($this->getTopicId()); $this->createPDF($topicInfo['topic_title']); $this->pdf->AddPage(); $htmlContent = '<p>' . "\n" . '<table cellspacing="0" cellpadding="2" border="1">' . "\n" . '<tbody>' . "\n" . '<tr>' . "\n" . '<th colspan="2" style="font-weight: bold; background-color: #EDF1E3; color: #669933; border-bottom: 1px solid #96BB7A;">' . claro_utf8_encode($topicInfo['topic_title']) . '</th>' . '</tr>' . "\n"; foreach ($postsList as $post) { $htmlContent .= '<tr>' . "\n" . '<td style="width: 150px; background-color: #EEEEEE;">' . "\n" . '<div style="font-weight: bold;">' . claro_utf8_encode($post['firstname'] . ' ' . $post['lastname'], get_conf('charset')) . '</div>' . "\n" . '<small>' . claro_html_localised_date(get_locale('dateTimeFormatLong'), datetime_to_timestamp($post['post_time'])) . '</small>' . "\n" . '</td>' . "\n" . '<td style="width: 354px;">' . claro_utf8_encode(claro_parse_user_text(strip_tags($post['post_text'])), get_conf('charset')) . '</td>' . "\n" . '</tr>' . "\n"; } $htmlContent .= '</tbody>' . "\n" . '</table>' . "\n" . '</p>'; //exit( claro_utf8_decode($htmlContent) ); $this->pdf->writeHTML($htmlContent, true, 0, true, 0); switch ($this->output) { case 'screen': $this->pdf->Output(claro_utf8_encode($topicInfo['topic_id'] . '_' . $topicInfo['topic_title'] . '.pdf'), 'D'); break; default: $path = get_conf('rootSys') . get_conf('tmpPathSys') . '/forum_export/'; claro_mkdir($path); $this->pdf->Output($path . claro_utf8_encode(replace_dangerous_char($topicInfo['topic_id'] . '_' . $topicInfo['topic_title']) . '.pdf'), 'F'); break; } return true; }
public function renderContent() { $output = ''; $output .= '<table class="claroTable emphaseLine" width="99%" border="0" cellspacing="2">' . "\n" . '<thead>' . "\n" . '<tr align="center" valign="top">' . "\n" . '<th> </th>' . "\n" . '<th>' . get_lang('Subject') . '</th>' . "\n" . '<th>' . get_lang('Sender') . '</th>' . "\n" . '<th>' . get_lang('Date') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n" . '<tbody>' . "\n"; if ($this->inbox->getNumberOfMessage() > 0) { foreach ($this->inbox as $message) { if ($message->isPlatformMessage()) { $classMessage = 'class="platformMessage"'; $iconMessage = '<img src="' . get_icon_url('important') . '" alt="' . get_lang('Important') . '" />'; } else { $classMessage = $message->isRead() ? 'class="readMessage"' : 'class="unreadMessage"'; $iconMessage = $message->isRead() ? '<img src="' . get_icon_url('mail_open') . '" alt="" />' : '<img src="' . get_icon_url('mail_close') . '" alt="" />'; } $output .= "\n" . '<tr ' . $classMessage . '>' . "\n" . '<td>' . $iconMessage . '</td>' . "\n" . '<td>' . '<a href="' . get_path('clarolineRepositoryWeb') . 'messaging/readmessage.php?messageId=' . $message->getId() . '&type=received">' . claro_htmlspecialchars($message->getSubject()) . '</a>' . "\n" . '</td>' . "\n" . '<td>' . claro_htmlspecialchars($message->getSenderLastName()) . ' ' . claro_htmlspecialchars($message->getSenderFirstName()) . '</td>' . "\n" . '<td align="center">' . claro_html_localised_date(get_locale('dateFormatLong'), strtotime($message->getSendTime())) . '</td>' . "\n" . '</tr>' . "\n"; } } else { $output .= "\n" . '<tr>' . "\n" . '<td colspan="4" align="center">' . get_lang('Empty') . '</td>' . "\n" . '</tr>' . "\n"; } $output .= "\n" . '</tbody>' . "\n" . '</table>' . "\n" . '<a href="' . get_path('clarolineRepositoryWeb') . 'messaging/index.php' . '">' . get_lang('View all my messages') . '</a>'; return $output; }
protected function renderContent() { $submittedWorks = $this->getUserWorks(); $html = ''; $html .= '<table class="claroTable emphaseLine" cellpadding="2" cellspacing="1" border="0" align="center" style="width: 99%;">' . "\n" . '<thead>' . "\n" . '<tr class="headerX">' . "\n" . '<th>' . get_lang('Assignment') . '</th>' . "\n" . '<th>' . get_lang('Work title') . '</th>' . "\n" . '<th>' . get_lang('Author(s)') . '</th>' . "\n" . '<th>' . get_lang('Score') . '</th>' . "\n" . '<th>' . get_lang('Date') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n"; if (!empty($submittedWorks) && is_array($submittedWorks)) { $html .= '<tbody>' . "\n"; $prevAssignmentTitle = ""; foreach ($submittedWorks as $work) { if ($work['a_title'] == $prevAssignmentTitle) { $assignmentTitle = " "; } else { $assignmentTitle = $work['a_title']; $prevAssignmentTitle = $work['a_title']; } if ($work['score'] != 0) { $displayedScore = $work['score'] . " %"; } else { $displayedScore = get_lang('No score'); } if (isset($work['g_name'])) { $authors = $work['authors'] . "( " . $work['g_name'] . " )"; } else { $authors = $work['authors']; } $timestamp = strtotime($work['last_edit_date']); $beautifulDate = claro_html_localised_date(get_locale('dateTimeFormatLong'), $timestamp); $html .= '<tr>' . "\n" . '<td>' . $assignmentTitle . '</td>' . "\n" . '<td>' . $work['s_title'] . '</td>' . "\n" . '<td>' . $authors . '</td>' . "\n" . '<td>' . $displayedScore . '</td>' . "\n" . '<td>' . $beautifulDate . '</td>' . "\n" . '</tr>' . "\n"; } $html .= '</tbody>' . "\n"; } else { $html .= '<tbody><tr>' . "\n" . '<td colspan="5" align="center">' . get_lang('No result') . '</td>' . "\n" . '</tr></tbody>' . "\n"; } $html .= '</table>' . "\n"; return $html; }
$output .= '<div id="leftContent">' . "\n"; $output .= claro_html_tool_title($nameTools); // menu $output .= '<small>' . "\n" . '[<a href="' . $_SERVER['PHP_SELF'] . '?userId=' . $userId . '&period=week&reqdate=' . $reqdate . '">' . get_lang('Week') . '</a>]' . "\n" . '[<a href="' . $_SERVER['PHP_SELF'] . '?userId=' . $userId . '&period=month&reqdate=' . $reqdate . '">' . get_lang('Month') . '</a>]' . "\n" . ' || ' . "\n"; if ($period == 'week') { // previous and next date must be evaluated $output .= '[<a href="' . $_SERVER['PHP_SELF'] . '?userId=' . $userId . '&period=week&reqdate=' . $previousReqDate . '">' . get_lang('Previous week') . '</a>]' . "\n" . '[<a href="' . $_SERVER['PHP_SELF'] . '?userId=' . $userId . '&period=week&reqdate=' . $nextReqDate . '">' . get_lang('Next week') . '</a>]' . "\n"; } else { $output .= '[<a href="' . $_SERVER['PHP_SELF'] . '?userId=' . $userId . '&period=month&reqdate=' . $previousReqDate . '">' . get_lang('Previous month') . '</a>]' . "\n" . '[<a href="' . $_SERVER['PHP_SELF'] . '?userId=' . $userId . '&period=month&reqdate=' . $nextReqDate . '">' . get_lang('Next month') . '</a>]' . "\n"; } $output .= '</small>' . "\n\n"; $output .= '<table class="claroTable" width="100%" cellpadding="4" cellspacing="1">' . "\n" . '<thead>' . '<tr class="headerX"><th>' . $displayedDate . '</th></tr>' . "\n" . '</thead>' . "\n" . '<tbody>'; if (!empty($accessList) && is_array($accessList)) { $i = 0; while ($i < sizeof($accessList)) { $output .= '<tr>' . "\n" . '<td><small>' . claro_html_localised_date(get_locale('dateTimeFormatLong'), strtotime($accessList[$i]['date'])) . '</small></td>' . "\n" . '</tr>' . "\n"; // $limit is used to select only results between current login and next one if ($i == sizeof($accessList) - 1 || !isset($accessList[$i + 1]['date'])) { $limit = date("Y-m-d H:i:s", $nextReqDate); } else { $limit = $accessList[$i + 1]['date']; } // select all access in the displayed date range $sql = "SELECT `tool_id`, count(`id`) AS `nbr_access`\n FROM `" . $tbl_course_tracking_event . "`\n WHERE `user_id` = '" . (int) $userId . "'\n AND `type` = 'tool_access'\n AND `date` >= '" . $accessList[$i]['date'] . "'\n AND `date` < '" . $limit . "'\n GROUP BY `tool_id`\n ORDER BY `tool_id` ASC"; $toolAccess = claro_sql_query_fetch_all($sql); if (!empty($toolAccess) && is_array($toolAccess)) { $output .= '<tr>' . "\n" . '<td colspan="2">' . "\n" . '<table width="100%" cellpadding="0" cellspacing="0" border="0">' . "\n"; foreach ($toolAccess as $aToolAccess) { $output .= '<tr>' . "\n" . '<td width="70%"><small>' . claro_get_tool_name(claro_get_tool_id_from_course_tid($aToolAccess['tool_id'])) . '</small></td>' . "\n" . '<td width="30%" align="right"><small>' . $aToolAccess['nbr_access'] . ' ' . get_lang('Visits') . '</small></td>' . "\n" . '</tr>' . "\n"; } $output .= '</table>' . "\n" . '</td></tr>' . "\n\n";
{ if (confirm("' . get_lang('Are you sure to delete the message?') . '")) { window.location=localPath; return false; } else { return false; } } </script>'; $claroline->display->header->addHtmlHeader($javascriptDelete); foreach ($box as $key => $message) { $userData = user_get_properties($message->getSender()); $content .= '<tr>' . "\n" . '<td class="im_list_selection"><input type="checkbox" name="msg[]" value="' . $message->getId() . '" /></td>' . "\n" . '<td><a href="readmessage.php?messageId=' . $message->getId() . '&type=received">' . claro_htmlspecialchars($message->getSubject()) . '</a></td>' . "\n" . '<td><a href="sendmessage.php?cmd=rqMessageToUser&userId=' . $message->getSender() . '">' . get_lang('%firstName %lastName', array('%firstName' => claro_htmlspecialchars($message->getSenderFirstName()), '%lastName' => claro_htmlspecialchars($message->getSenderLastName()))) . '</a>' . '</td>' . '<td>' . claro_htmlspecialchars($userData['username']) . '</td>' . "\n" . '<td>' . claro_html_localised_date(get_locale('dateTimeFormatLong'), strtotime($message->getSendTime())) . '</td>' . "\n" . '<td class="im_list_action"><a href="' . $linkDelete . 'cmd=rqDeleteMessage&message_id=' . $message->getId() . '" ' . 'onclick="return deleteMessage(\'' . $linkDelete . 'cmd=exDeleteMessage&message_id=' . $message->getId() . '\')"' . '><img src="' . get_icon_url('delete') . '" alt="" /></a></td>' . "\n" . '</tr>' . "\n\n"; } $content .= '</table>' . '<input type="submit" value="' . get_lang('Delete selected message(s)') . '" />' . "\n\n"; } $content .= '</form>'; // prepare the link to change of page if ($box->getNumberOfPage() > 1) { // number of page to display in the page before and after thecurrent page $nbPageToDisplayBeforeAndAfterCurrentPage = 1; $content .= '<div id="im_paging">'; $arg_paging = makeArgLink($arguments, array('page')); if ($arg_paging == "") { $linkPaging = $_SERVER['PHP_SELF'] . "?page="; } else { $linkPaging = $_SERVER['PHP_SELF'] . "?" . $arg_paging . "&page="; }
} else { foreach ($searchResultList as $thisPost) { // PREVENT USER TO CONSULT POST FROM A GROUP THEY ARE NOT ALLOWED if (!is_null($thisPost['group_id']) && $is_groupPrivate && !(in_array($thisPost['group_id'], $userGroupList) || in_array($thisPost['group_id'], $tutorGroupList) || claro_is_course_manager())) { continue; } else { // notify if is new message $post_time = datetime_to_timestamp($thisPost['post_time']); if ($post_time < $last_visit) { $class = ' class="item"'; } else { $class = ' class="item hot"'; } // get user picture $userData = user_get_properties($thisPost['poster_id']); $picturePath = user_get_picture_path($userData); if ($picturePath && file_exists($picturePath)) { $pictureUrl = user_get_picture_url($userData); } else { $pictureUrl = null; } $out .= '<div id="post' . $thisPost['post_id'] . '" class="threadPost">' . '<div class="threadPostInfo">' . (!is_null($pictureUrl) ? '<div class="threadPosterPicture"><img src="' . $pictureUrl . '" alt=" " /></div>' : '') . "\n" . '<b>' . $thisPost['firstname'] . ' ' . $thisPost['lastname'] . '</b> ' . '<br />' . '<small>' . claro_html_localised_date(get_locale('dateTimeFormatLong'), $post_time) . '</small>' . "\n"; $out .= ' </div>' . "\n" . '<div class="threadPostContent">' . "\n" . '<img src="' . get_icon_url('topic') . '" alt="" />' . '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLFRM') . '/viewtopic.php?topic=' . $thisPost['topic_id'])) . '">' . claro_htmlspecialchars($thisPost['topic_title']) . '</a>' . "\n" . '<span class="threadPostIcon ' . $class . '"><img src="' . get_icon_url('post') . '" alt="" /></span><br />' . "\n" . claro_parse_user_text($thisPost['post_text']) . "\n"; $out .= '</div>' . "\n" . '<div class="spacer"></div>' . "\n\n" . '</div>' . "\n"; } // end else if ( ! is_null($thisPost['group_id']) } } // end for each $claroline->display->body->appendContent($out); echo $claroline->display->render();
} ?> </ul> <div class="collapsible collapsed"> <a href="#" class="doCollapse"><?php echo get_lang('More information'); ?> </a> <div class="collapsible-wrapper"> <ul id="moreInformation" style="font-size:small;"> <li><?php echo get_lang('Start date') . ' : ' . claro_html_localised_date($this->dateTimeFormatLong, $this->exercise->getStartDate()); ?> </li> <li><?php echo get_lang('End date') . ' : ' . (!is_null($this->exercise->getEndDate()) ? claro_html_localised_date($this->dateTimeFormatLong, $this->exercise->getEndDate()) : get_lang('No closing date')); ?> </li> <li><?php echo get_lang('Time limit') . ' : ' . ($this->exercise->getTimeLimit() > 0 ? claro_disp_duration($this->exercise->getTimeLimit()) : get_lang('No time limitation')); ?> </li> <li><?php echo get_lang('Attempts allowed') . ' : ' . ($this->exercise->getAttempts() > 0 ? $this->exercise->getAttempts() : get_lang('Unlimited')); ?> </li> <li><?php echo get_lang('Anonymous attempts') . ' : ' . ($this->exercise->getAnonymousAttempts() == 'ALLOWED' ? get_lang('Allowed : do not record usernames in tracking, anonymous users can do the exercise.') : get_lang('Not allowed : record usernames in tracking, anonymous users cannot do the exercise.')); ?> </li> <li><?php
$template->assign('templateMyCourses', $courseTreeView); // User commands $userCommands = array(); $userCommands[] = '<a href="' . $_SERVER['PHP_SELF'] . '" class="userCommandsItem">' . '<img src="' . get_icon_url('mycourses') . '" alt="" /> ' . get_lang('My course list') . '</a>' . "\n"; // 'Create Course Site' command. Only available for teacher. if (claro_is_allowed_to_create_course()) { $userCommands[] = '<a href="claroline/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="claroline/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="claroline/auth/courses.php?cmd=rqUnreg" class="userCommandsItem">' . '<img src="' . get_icon_url('unenroll') . '" alt="" /> ' . get_lang('Remove course enrolment') . '</a>' . "\n"; } $userCommands[] = '<a href="claroline/course/platform_courses.php" class="userCommandsItem">' . '<img src="' . get_icon_url('course') . '" alt="" /> ' . get_lang('All platform courses') . '</a>' . "\n"; $userCommands[] = '<img class="iconDefinitionList" src="' . get_icon_url('hot') . '" alt="' . get_lang('New items') . '" />' . ' ' . get_lang('New items') . ' ' . '(<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'notification_date.php')) . '" class="userCommandsItem">' . get_lang('to another date') . '</a>)' . (substr($lastUserAction, strlen($lastUserAction) - 8) == '00:00:00' ? ' <br />[' . claro_html_localised_date(get_locale('dateFormatNumeric'), strtotime($lastUserAction)) . ']' : '') . "\n"; $template->assign('userCommands', $userCommands); // User profilebox FromKernel::uses('display/userprofilebox.lib'); $userProfileBox = new UserProfileBox(false); $template->assign('userProfileBox', $userProfileBox); } else { // Category browser $categoryId = !empty($_REQUEST['categoryId']) ? (int) $_REQUEST['categoryId'] : 0; $categoryBrowser = new CategoryBrowser($categoryId); $templateCategoryBrowser = $categoryBrowser->getTemplate(); $template->assign('templateCategoryBrowser', $templateCategoryBrowser); } // Render $claroline->display->body->setContent($template->render()); if (!(isset($_REQUEST['logout']) && isset($_SESSION['isVirtualUser']))) {
$out = ''; $nameTools = get_lang('Chat'); $out .= claro_html_tool_title($nameTools); if (claro_is_javascript_enabled() && $_uid) { $jsloader = JavascriptLoader::getInstance(); $jsloader->load('jquery'); $jsloader->load('clchat'); // init var with values from get_conf before including tool library $htmlHeaders = '<script type="text/javascript">' . "\n" . 'var refreshRate = "' . get_conf('msg_list_refresh_rate', 5) * 1000 . '";' . "\n" . 'var userListRefresh = "' . get_conf('user_list_refresh_rate') * 1000 . '";' . "\n" . 'var cidReq = "' . claro_get_current_course_id() . '";' . "\n"; if (claro_is_in_a_group()) { $htmlHeaders .= 'var gidReq = "' . claro_get_current_group_id() . '";' . "\n"; } $htmlHeaders .= 'var lang = new Array();' . "\n" . 'lang["confirmFlush"] = "' . clean_str_for_javascript(get_lang('Are you sure to delete all logs ?')) . '";' . '</script>'; $claroline->display->header->addHtmlHeader($htmlHeaders); // dialog box $out .= '<div id="clchat_user_list"></div>' . "\n" . '<div id="clchat_chatarea">' . "\n" . ' <div id="clchat_log"></div>' . "\n" . ' <div id="clchat_connectTime">' . get_lang('Start of this chat session (%connectTime)', array('%connectTime' => claro_html_localised_date(get_locale('dateTimeFormatLong'), $_SESSION['chat_connectionTime']))) . '</div>' . "\n" . ' <div id="clchat_text"></div>' . "\n" . '</div>' . "\n"; // display form $out .= '<form action="#" id="clchat_form" method="get" >' . "\n" . claro_form_relay_context() . "\n" . '<img src="' . get_module_url('CLCHAT') . '/img/loading.gif" alt="' . get_lang('Loading...') . '" id="clchat_loading" width="16" height="16" />' . "\n" . '<input id="clchat_msg" type="text" name="message" maxlength="200" size="80" />' . "\n" . '<input type="submit" name="Submit" value=" >> " />' . "\n" . '</form>' . "\n" . claro_html_menu_horizontal($cmdMenu) . "\n" . '<p id="clchat_dialogBox"></p>' . "\n"; } else { if (!claro_is_javascript_enabled()) { $dialogBox = new DialogBox(); $dialogBox->error(get_lang('Javascript must be enabled in order to use this tool.')); $out .= $dialogBox->render(); } elseif (!$_uid) { $dialogBox = new DialogBox(); $dialogBox->error(get_lang('Anonymous users cannot use this tool.')); $out .= $dialogBox->render(); } } $claroline->display->body->appendContent($out); echo $claroline->display->render();
/** * diplay a received message * * @param ReceivedMessage $message Message to display * @param string $action list of action autorised on the message * @return string HTML source */ private static function displayReceivedMessage($message, $action) { $content = '<div id="im_message">' . "\n" . '<h4 class="header">' . claro_htmlspecialchars($message->getSubject()) . '</h4>' . "\n" . '<div class="imInfoBlock">' . "\n" . '<div class="imCmdList">' . $action . '</div>' . "\n\n" . '<div class="imInfo">' . "\n" . ' <span class="imInfoTitle">' . get_lang('Sender') . ' : </span>' . "\n" . ' <span class="imInfoValue">'; $isAllowed = current_user_is_allowed_to_send_message_to_user($message->getSender()); if ($isAllowed) { $content .= '<a href="sendmessage.php?cmd=rqMessageToUser&userId=' . $message->getSender() . '">'; } $content .= get_lang('%firstName %lastName', array('%firstName' => claro_htmlspecialchars($message->getSenderFirstName()), '%lastName' => claro_htmlspecialchars($message->getSenderLastName()))); if ($isAllowed) { $content .= "</a>"; } $isManager = FALSE; $isAdmin = claro_is_user_platform_admin($message->getSender()); if (!is_null($message->getCourseCode())) { $isManager = claro_is_user_course_manager($message->getSender(), $message->getCourseCode()); } if ($isManager) { $content .= ' <img src="' . get_icon_url('manager') . '" alt="" />'; } elseif ($isAdmin) { $content .= ' <img src="' . get_icon_url('platformadmin') . '" alt="" />'; } else { $content .= ' <img src="' . get_icon_url('user') . '" alt="" />'; } $content .= '' . ' </span>' . "\n" . '</div>' . "\n\n" . '<div class="imInfo">' . "\n" . '<span class="imInfoTitle">' . get_lang('Date') . ' : </span>' . "\n" . '<span class="imInfoValue">' . claro_html_localised_date(get_locale('dateTimeFormatLong'), strtotime($message->getSendTime())) . '</span>' . "\n" . '</div>' . "\n\n"; if (!is_null($message->getCourseCode())) { $content .= '<div class="imInfo">' . "\n" . ' <span class="imInfoTitle">' . get_lang('Course') . '</span>' . "\n" . ' <span class="imInfoValue">' . "\n"; $courseData = claro_get_course_data($message->getCourseCode()); if ($courseData) { $content .= claro_htmlspecialchars($courseData['officialCode']) . ' - ' . claro_htmlspecialchars($courseData['name']); } else { $content .= '?'; } $content .= ' </span>' . "\n" . '</div>' . "\n\n"; if (!is_null($message->getGroupId())) { $content .= '<div class="imInfo">' . "\n" . ' <span class="imInfoTitle">' . get_lang('Group') . ' : </span>' . "\n" . ' <span class="imInfoValue">' . "\n"; $groupData = claro_get_group_data(array(CLARO_CONTEXT_COURSE => $message->getCourseCode(), CLARO_CONTEXT_GROUP => $message->getGroupId())); if ($groupData) { $content .= $groupData['name']; } else { $content .= '?'; } $content .= ' </span>' . "\n" . '</div>' . "\n\n"; } if (!is_null($message->getToolsLabel())) { $content .= '<div class="imInfo">' . "\n" . ' <span class="imInfoTitle">' . get_lang('Tool') . ' : </span>' . "\n" . ' <span class="imInfoValue">' . "\n"; $md = get_module_data($message->getToolsLabel()); if ($md) { $content .= get_lang($md['moduleName']); } else { $content .= '?'; } $content .= ' </span>' . "\n" . '</div>' . "\n\n"; } } $body = $message->getMessage(); $body = claro_html_sanitize_all($body); $content .= '</div>' . "\n" . '<div class="imContent">' . claro_parse_user_text($body) . '</div>' . "\n" . '</div>' . "\n\n"; return $content; }
$checked2 = ''; } $out .= '<td>' . '<input type="radio" name="old" value="' . $version['id'] . '"' . $checked1 . ' />' . "\n" . '</td>' . "\n"; $out .= '<td>' . '<input type="radio" name="new" value="' . $version['id'] . '"' . $checked2 . ' />' . "\n" . '</td>' . "\n"; $userInfo = user_get_properties($version['editor_id']); if (!empty($userInfo)) { $userStr = $userInfo['firstname'] . " " . $userInfo['lastname']; } else { $userStr = get_lang('Unknown user'); } if (claro_is_course_member()) { $userUrl = '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLUSR') . '/userInfo.php?uInfo=' . (int) $version['editor_id'])) . '">' . $userStr . '</a>'; } else { $userUrl = $userStr; } $versionUrl = '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?wikiId=' . (int) $wikiId . '&title=' . rawurlencode($title) . '&action=show' . '&versionId=' . (int) $version['id'])) . '">' . claro_html_localised_date(get_locale('dateTimeFormatLong'), strtotime($version['mtime'])) . '</a>'; $out .= '<td>' . sprintf(get_lang('%1\\$s by %2\\$s'), $versionUrl, $userUrl) . '</td>' . "\n"; $out .= '</tr>' . "\n"; } } $out .= '</table>' . "\n"; $out .= '</form>'; break; case 'exSearch': $out .= '<h3>' . get_lang("Search result") . '</h3>' . "\n"; $out .= '<ul>' . "\n"; foreach ($searchResult as $page) { if ('__MainPage__' == $page['title']) { $title = get_lang("Main page"); } else { $title = $page['title'];
} elseif ($recipientList['sentTo'] == 'toCourse') { $content .= get_lang('Course: ') . " " . $message->getCourseCode(); } elseif ($recipientList['sentTo'] == 'toGroup') { $groupInfo = claro_get_group_data(array(CLARO_CONTEXT_COURSE => $message->getCourseCode(), CLARO_CONTEXT_GROUP => $message->getGroupId())); $courseInfo = claro_get_course_data($message->getCourseCode()); if (!$groupInfo) { $content .= get_lang('Course') . ' : ' . get_lang('unknown') . "; " . get_lang('Group') . ' : ' . get_lang('unknown'); } else { $content .= get_lang('Course') . ' : ' . $courseInfo['officialCode'] . "; " . get_lang('Group') . ' : ' . $groupInfo['name']; } } elseif ($message->isPlatformMessage()) { $content .= get_lang('All users of the platform'); } else { $content .= get_lang('Unknown recipient'); } $content .= '</td>' . '<td>' . claro_html_localised_date(get_locale('dateTimeFormatLong'), strtotime($message->getSendTime())) . '</td>' . "\n"; $content .= '</tr>' . "\n\n"; } } $content .= '</table>' . "\n"; // prepare the link to change of page // prepare the link to change of page if ($box->getNumberOfPage() > 1) { // number of page to display in the page before and after thecurrent page $nbPageToDisplayBeforeAndAfterCurrentPage = 1; $arg_paging = makeArgLink($link_arg, array('page')); if ($arg_paging == "") { $linkPaging = $linkPage . "?page="; } else { $linkPaging = $linkPage . "?" . $arg_paging . "&page="; }
/** * Transform a UNIX time stamp in human readable format date * * @copyright (c) 2001-2011, Universite catholique de Louvain (UCL) * @param - date - UNIX time stamp */ function format_date($fileDate) { return claro_html_localised_date(get_locale('dateFormatNumeric'), $fileDate); }
$out .= '</p>' . "\n\n"; $tempView = $view; $levelView++; $out .= '<p>' . "\n"; if ('1' == $view[$levelView]) { $tempView[$levelView] = '0'; //-- Courses with unexisting users registered : courses that have users not registered on the platform $out .= '- ' . ' ' . '<b>' . get_lang('Courses with unexisting users registered') . '</b>' . ' ' . '<small>' . '[<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $tempView . '">' . get_lang('Close') . '</a>]' . '</small>' . '<br />' . "\n"; if (false === ($datagrid[$levelView] = $Cache_Lite->get($levelView))) { $sql = "\n SELECT concat('(',cu.code_cours,') <br />', c.administrativeNumber,' : ',c.intitule) course,\n cu.user_id AS user_id\n FROM `" . $tbl_rel_course_user . "` AS cu\n INNER JOIN `" . $tbl_course . "` AS c\n ON c.code = cu.code_cours\n LEFT JOIN `" . $tbl_user . "` AS u\n ON u.user_id = cu.user_id\n WHERE u.user_id is null\n ORDER BY user_id\n LIMIT 100"; $option['colTitleList'] = array('code', 'count'); $data = claro_sql_query_fetch_all($sql); if (!is_array($data) || 0 == sizeof($data)) { $dg->set_colTitleList(array(get_lang('Code'), get_lang('Total'))); } $dg->set_grid($data); $datagrid[$levelView] = $dg->render(); $Cache_Lite->save($datagrid[$levelView], $levelView); } $out .= $datagrid[$levelView] . '<small>' . get_lang('Last computing') . ' ' . claro_html_localised_date(get_locale('dateTimeFormatLong') . ':%S', $Cache_Lite->lastModified()) . ', ' . get_lang('%delay ago', array('%delay' => claro_html_duration(time() - $Cache_Lite->lastModified()))) . '</small>' . '<br />'; } else { $tempView[$levelView] = '1'; $out .= '+' . ' ' . '<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $tempView . '">' . get_lang('Courses with unexisting users registered') . '</a>'; } $out .= '</p>' . "\n\n"; break; default: trigger_error('display (' . $display . ') unknown', E_USER_NOTICE); } $claroline->display->body->appendContent($out); echo $claroline->display->render();
echo $thisTopic['topic_replies']; ?> </small></td> <td align="center"> <small> <?php echo 'anonymous' == $thisTopic['nom'] ? get_lang('Anonymous') : $thisTopic['prenom'] . ' ' . $thisTopic['nom']; ?> </small> </td> <td align="center"><small><?php echo $thisTopic['topic_views']; ?> </small></td> <td align="center"><small><?php echo claro_html_localised_date(get_locale('dateTimeFormatShort'), datetime_to_timestamp($thisTopic['post_time'])); ?> </small></td> <?php if ($this->is_allowedToEdit) { ?> <td align="center"> <a href="<?php echo claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqEditTopic&forum=' . $this->forumId . '&topic=' . $thisTopic['topic_id'])); ?> "> <img src="<?php echo get_icon_url('edit'); ?> " alt="<?php echo get_lang('Edit');
/** * Display a date at localized format * @copyright (c) 2001-2011, Universite catholique de Louvain (UCL) * @param formatOfDate see http://www.php.net/manual/en/function.strftime.php for syntax to use for this string I suggest to use the format you can find in trad4all.inc.php files * @param timestamp timestamp of date to format */ function claro_disp_localised_date($formatOfDate, $timestamp = -1) { pushClaroMessage((function_exists('claro_html_debug_backtrace') ? claro_html_debug_backtrace() : 'claro_html_debug_backtrace() not defined') . 'claro_ disp _localised_date() is deprecated , use claro_ html _localised_date()', 'error'); return claro_html_localised_date($formatOfDate, $timestamp); }
public function render() { // Select current course's datas $tbl_mdb_names = claro_sql_get_main_tbl(); $tbl_courses = $tbl_mdb_names['course']; $curdate = claro_mktime(); $sql = "SELECT course.cours_id,\n course.code AS `sysCode`,\n course.directory AS `directory`,\n course.administrativeNumber AS `officialCode`,\n course.dbName AS `db`,\n course.intitule AS `title`,\n course.titulaires AS `titular`,\n course.language AS `language`,\n course.access AS `access`,\n course.status,\n course.sourceCourseId,\n UNIX_TIMESTAMP(course.expirationDate) AS expirationDate,\n UNIX_TIMESTAMP(course.creationDate) AS creationDate\n FROM `" . $tbl_courses . "` AS course\n WHERE course.code = " . Claroline::getDatabase()->quote($this->courseCode); $result = Claroline::getDatabase()->query($sql); $courseData = $result->fetch(Database_ResultSet::FETCH_ASSOC); $courseEventList = get_agenda_next_items_list($courseData, 10, $this->month, $this->year); if (is_array($courseEventList)) { $courseDigestList = array(); foreach ($courseEventList as $thisEvent) { $eventLine = trim(strip_tags($thisEvent['title'])); if ($eventLine == '') { $eventContent = trim(strip_tags($thisEvent['content'])); $eventLine = substr($eventContent, 0, 60) . (strlen($eventContent) > 60 ? ' (...)' : ''); } $eventDate = $thisEvent['day']; if (!array_key_exists($eventDate, $courseDigestList)) { $courseDigestList[$eventDate] = array(); $courseDigestList[$eventDate]['eventList'] = array(); $courseDigestList[$eventDate]['date'] = $eventDate; } $courseDigestList[$eventDate]['eventList'][] = array('id' => $thisEvent['id'], 'hour' => $thisEvent['hour'], 'location' => $thisEvent['location'], 'courseOfficialCode' => $courseData['officialCode'], 'courseSysCode' => $courseData['sysCode'], 'content' => $eventLine, 'url' => get_path('url') . '/claroline/calendar/agenda.php?cidReq=' . $courseData['sysCode']); } } $output = ''; //$output .= '<div class="calendar">'.$this->ajaxMiniCalendar($agendaItemList).'</div>'; $output .= '<div class="details">' . "\n" . '<dl>' . "\n"; if ($courseDigestList) { foreach ($courseDigestList as $agendaItem) { $output .= '<dt>' . "\n" . '<h2>' . claro_html_localised_date(get_locale('dateFormatLong'), strtotime($agendaItem['date'])) . '</h2>' . "\n" . '</dt>' . "\n"; foreach ($agendaItem['eventList'] as $agendaEvent) { $output .= '<dd>' . '<b>' . $agendaEvent['content'] . '</b>' . "\n" . (!empty($agendaEvent['hour']) ? ' – ' . ucfirst(strftime(get_locale('timeNoSecFormat'), strtotime($agendaEvent['hour']))) : '') . (!empty($agendaEvent['location']) ? ' | ' . $agendaEvent['location'] : '') . ' (<a href="' . $agendaEvent['url'] . '#item' . $agendaEvent['id'] . '">' . get_lang('more details') . '</a>)' . "\n" . '</dd>' . "\n"; } } } else { $output .= '<dt>' . "\n" . get_lang('No event to display') . "\n" . '</dt>' . "\n"; } $output .= '' . '</dl>' . "\n" . '</div>' . "\n"; return $output; }
/** * Open log file * * @param string claroline version * @param string database version * * @since 1.7 */ function open_upgrade_log() { global $new_version, $currentClarolineVersion, $currentDbVersion; global $fp_upgrade_log; if (!file_exists('../../../platform')) { claro_mkdir('../../../platform', CLARO_FILE_PERMISSIONS, true); } $upgradeLogPath = '../../../platform/upgrade_log.txt'; // open file in write mode if ($fp_upgrade_log = fopen($upgradeLogPath, 'a+')) { $upgradeHeader = '========================================================' . "\n" . ' * Upgrade to ' . $new_version . "\n" . ' * Current File Version : ' . $currentClarolineVersion . "\n" . ' * Current Database Version : ' . $currentDbVersion . "\n" . ' * Date :' . claro_html_localised_date(get_locale('dateTimeFormatLong')) . "\n" . '========================================================' . "\n"; // write content in file fwrite($fp_upgrade_log, $upgradeHeader); return true; } else { return false; } }
protected function renderContent() { $documentDownloads = $this->prepareContent(); $html = ''; $html .= '<table class="claroTable emphaseLine" cellpadding="2" cellspacing="1" border="0" align="center" style="width: 99%;">' . "\n" . '<thead>' . "\n" . '<tr>' . "\n" . '<th>' . get_lang('Document') . '</th>' . "\n" . '<th>' . get_lang('Last download') . '</th>' . "\n" . '<th>' . get_lang('Downloads') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n"; if (!empty($documentDownloads) && is_array($documentDownloads)) { $html .= '<tbody>' . "\n"; foreach ($documentDownloads as $download) { $data = unserialize($download['data']); if (!empty($data['url'])) { $path = $data['url']; // TODO make document path shorter if needed $html .= '<tr>' . "\n" . '<td>' . $path . '</td>' . "\n" . '<td>' . claro_html_localised_date(get_locale('dateFormatLong'), $download['unix_date']) . '</td>' . "\n" . '<td>' . $download['downloads'] . '</td>' . "\n" . '</tr>' . "\n"; } } $html .= '</tbody>' . "\n"; } else { $html .= '<tbody>' . "\n" . '<tr>' . "\n" . '<td colspan="3" align="center">' . get_lang('No result') . '</td>' . "\n" . '</tr>' . "\n" . '</tbody>' . "\n"; } $html .= '</table>' . "\n\n"; return $html; }
$is_allowedToReset = $is_allowedToReset || claro_is_group_tutor(); $activeChatFile = $curChatRep . $courseId . '.' . $groupId . '.chat.html'; $onflySaveFile = $curChatRep . $courseId . '.' . $groupId . '.tmpChatArchive.html'; $exportFile = $coursePath . '/group/' . claro_get_current_group_data('directory') . '/'; } else { die('<center>' . get_lang('You are not a member of this group') . '</center>'); } } else { $groupContext = FALSE; $courseContext = TRUE; $activeChatFile = $curChatRep . $courseId . '.chat.html'; $onflySaveFile = $curChatRep . $courseId . '.tmpChatArchive.html'; $exportFile = $coursePath . '/document/'; } $dateNow = claro_html_localised_date(get_locale('dateTimeFormatLong')); $timeNow = claro_html_localised_date('[%d/%m/%y %H:%M]'); if (!file_exists($activeChatFile)) { // create the file $fp = @fopen($activeChatFile, 'w') or die('<center>' . get_lang('Error : Cannot initialize chat') . '</center>'); fclose($fp); $dateLastWrite = get_lang('New chat'); } /*============================================================================ COMMANDS ============================================================================*/ /*---------------------------------------------------------------------------- RESET COMMAND ----------------------------------------------------------------------------*/ if (isset($_REQUEST['cmd']) && $_REQUEST['cmd'] == 'reset' && $is_allowedToReset) { $fchat = fopen($activeChatFile, 'w'); fwrite($fchat, '<small>' . $timeNow . ' -------- ' . get_lang('Chat reset by') . ' ' . $nick . ' --------</small><br />' . "\n");
$assignmentUrl = Url::Contextualize('work_list.php?assigId=' . $anAssignment['id']); if (isset($_REQUEST['submitGroupWorkUrl']) && !empty($_REQUEST['submitGroupWorkUrl'])) { if (!isset($anAssignment['authorized_content']) || $anAssignment['authorized_content'] != 'TEXT') { $assignmentUrl = Url::Contextualize('work_list.php?cmd=rqSubWrk&assigId=' . $anAssignment['id'] . '&submitGroupWorkUrl=' . urlencode($_REQUEST['submitGroupWorkUrl']) . '&gidReq=' . claro_get_current_group_id()); } } $out .= '<a href="' . claro_htmlspecialchars($assignmentUrl) . '" class="item' . $classItem . '">' . '<img src="' . get_icon_url('assignment') . '" alt="" /> ' . $anAssignment['title'] . '</a>' . "\n" . '</td>' . "\n"; $out .= '<td align="center">'; if ($anAssignment['assignment_type'] == 'INDIVIDUAL') { $out .= '<img src="' . get_icon_url('user') . '" alt="' . get_lang('Individual') . '" />'; } elseif ($anAssignment['assignment_type'] == 'GROUP') { $out .= '<img src="' . get_icon_url('group') . '" alt="' . get_lang('Groups (from groups tool, only group members can post)') . '" />'; } else { $out .= ' '; } $out .= '</td>' . "\n" . '<td><small>' . claro_html_localised_date(get_locale('dateTimeFormatLong'), $anAssignment['start_date_unix']) . '</small></td>' . "\n" . '<td><small>' . claro_html_localised_date(get_locale('dateTimeFormatLong'), $anAssignment['end_date_unix']) . '</small></td>' . "\n"; if (isset($_REQUEST['submitGroupWorkUrl']) && !empty($_REQUEST['submitGroupWorkUrl'])) { if (!isset($anAssignment['authorized_content']) || $anAssignment['authorized_content'] != 'TEXT') { $out .= '<td align="center">' . '<a href="' . claro_htmlspecialchars($assignmentUrl) . '">' . '<small>' . get_lang('Publish') . '</small>' . '</a>' . '</td>' . "\n"; } else { $out .= '<td align="center">' . '<small>-</small>' . '</td>' . "\n"; } } if ($is_allowedToEdit) { $out .= '<td align="center">' . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqEditAssig&assigId=' . $anAssignment['id'])) . '">' . '<img src="' . get_icon_url('edit') . '" alt="' . get_lang('Modify') . '" /></a>' . '</td>' . "\n" . '<td align="center">' . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exRmAssig&assigId=' . $anAssignment['id'])) . '" onclick="return WORK.confirmationDel(\'' . clean_str_for_javascript($anAssignment['title']) . '\');">' . '<img src="' . get_icon_url('delete') . '" alt="' . get_lang('Delete') . '" /></a>' . '</td>' . "\n" . '<td align="center">'; if ($anAssignment['visibility'] == "INVISIBLE") { $out .= '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exChVis&assigId=' . $anAssignment['id'] . '&vis=v')) . '">' . '<img src="' . get_icon_url('invisible') . '" alt="' . get_lang('Make visible') . '" />' . '</a>'; } else { $out .= '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exChVis&assigId=' . $anAssignment['id'] . '&vis=i')) . '">' . '<img src="' . get_icon_url('visible') . '" alt="' . get_lang('Make invisible') . '" />' . '</a>'; } $out .= '</td>' . "\n" . '</tr>' . "\n\n";
protected function renderContent() { if (isset($_REQUEST['exId']) && is_numeric($_REQUEST['exId'])) { $exId = (int) $_REQUEST['exId']; } else { $exId = null; } $exerciseResults = $this->prepareContent(); $jsloader = JavascriptLoader::getInstance(); $jsloader->load('jquery'); $context = array('cidReq' => $this->courseId, 'cidReset' => true, 'userId' => $this->userId); $html = '<script language="javascript" type="text/javascript">' . "\n" . ' $(document).ready(function() {' . ' $(\'.exerciseDetails\').hide();' . ' $(\'.exerciseDetailsToggle\').click( function()' . ' {' . ' $(this).next(".exerciseDetails").toggle();' . ' return false;' . ' });' . ' });' . '</script>' . "\n\n"; $html .= '<table class="claroTable emphaseLine" cellpadding="2" cellspacing="1" border="0" align="center" style="width: 99%;">' . "\n" . '<thead>' . "\n" . '<tr class="headerX">' . "\n" . '<th>' . get_lang('Exercises') . '</th>' . "\n" . '<th>' . get_lang('Worst score') . '</th>' . "\n" . '<th>' . get_lang('Best score') . '</th>' . "\n" . '<th>' . get_lang('Average score') . '</th>' . "\n" . '<th>' . get_lang('Average Time') . '</th>' . "\n" . '<th>' . get_lang('Attempts') . '</th>' . "\n" . '<th>' . get_lang('Last attempt') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n"; if (!empty($exerciseResults) && is_array($exerciseResults)) { $html .= '<tbody>' . "\n"; foreach ($exerciseResults as $result) { $html .= '<tr class="exerciseDetailsToggle">' . "\n" . '<td><a href="#">' . claro_htmlspecialchars($result['title']) . '</td>' . "\n" . '<td>' . (int) $result['minimum'] . '</td>' . "\n" . '<td>' . (int) $result['maximum'] . '</td>' . "\n" . '<td>' . round($result['average'] * 10) / 10 . '</td>' . "\n" . '<td>' . claro_html_duration(floor($result['avgTime'])) . '</td>' . "\n" . '<td>' . (int) $result['attempts'] . '</td>' . "\n" . '<td>' . claro_html_localised_date(get_locale('dateTimeFormatLong'), strtotime($result['lastAttempt'])) . "</td> \n"; $html .= '</tr>' . "\n"; // details $exerciseDetails = $this->getUserExerciceDetails($result['id']); if (is_array($exerciseDetails) && !empty($exerciseDetails)) { $html .= '<tr class="exerciseDetails" >'; if (claro_is_course_manager()) { $html .= '<td><a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLQWZ') . '/track_exercise_reset.php?cmd=resetAllAttemptsForUser&exId=' . $result['id'], $context)) . '">' . get_lang('delete all') . '</a></td>'; } else { $html .= '<td> </td>' . "\n"; } $html .= '<td colspan="6" class="noHover">' . "\n" . '<table class="claroTable emphaseLine" cellspacing="1" cellpadding="2" border="0" width="100%" style="width: 99%;">' . "\n" . '<thead>' . "\n"; $html .= '' . '<tr>' . "\n" . '<th><small>' . get_lang('Date') . '</small></th>' . "\n" . '<th><small>' . get_lang('Score') . '</small></th>' . "\n" . '<th><small>' . get_lang('Time') . '</small></th>' . "\n" . '<th><small>' . get_lang('Delete') . '</small></th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n" . '<tbody>' . "\n"; foreach ($exerciseDetails as $details) { $html .= '<tr>' . "\n" . '<td><small>' . "\n" . '<a href="' . get_module_url('CLQWZ') . '/track_exercise_details.php?trackedExId=' . $details['id'] . '">' . claro_html_localised_date(get_locale('dateTimeFormatLong'), strtotime($details['date'])) . '</a></small></td>' . "\n" . '<td><small>' . $details['result'] . '/' . $details['weighting'] . '</small></td>' . "\n" . '<td><small>' . claro_html_duration($details['time']) . '</small></td>' . "\n"; if (claro_is_course_manager()) { $html .= '<td><small><a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLQWZ') . '/track_exercise_reset.php?cmd=resetAttemptForUser&trackId=' . $details['id'], $context)) . '">' . get_lang('delete') . '</a></small></td>' . "\n"; } else { $html .= '<td><small>-</small></td>'; } $html .= '</tr>' . "\n"; } $html .= '</tbody>' . "\n" . '</table>' . "\n\n" . '</td>' . "\n" . '</tr>' . "\n"; } } $html .= '</tbody>' . "\n"; } else { $html .= '<tbody>' . "\n" . '<tr>' . "\n" . '<td colspan="7" align="center">' . get_lang('No result') . '</td>' . "\n" . '</tr>' . "\n" . '</tbody>' . "\n"; } $html .= '</table>' . "\n\n"; return $html; }
protected function getExtraToolLinkList() { $otherToolsList = array(); $otherToolsList[] = '<img class="iconDefinitionList" src="' . get_icon_url('hot') . '" alt="' . get_lang('New items') . '" />' . ' ' . get_lang('New items') . ' ' . '(<a href="' . claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'notification_date.php', $this->currentCourseContext)) . '">' . get_lang('to another date') . '</a>)' . (substr($this->getUserLastAction(), strlen($this->getUserLastAction()) - 8) == '00:00:00' ? ' <br />[' . claro_html_localised_date(get_locale('dateFormatNumeric'), strtotime($this->getUserLastAction())) . ']' : '') . "\n"; return $otherToolsList; }
</span><br /> <span class="comment"><?php echo $thisForum['forum_desc']; ?> </span> </td> <td align="center"><small><?php echo $thisForum['forum_topics']; ?> </small></td> <td align="center"><small><?php echo $thisForum['forum_posts']; ?> </small></td> <td align="center"><small><?php echo $thisForum['post_time'] > 0 ? claro_html_localised_date(get_locale('dateTimeFormatShort'), datetime_to_timestamp($thisForum['post_time'])) : get_lang('No post'); ?> </small></td> <?php if ($this->is_allowedToEdit) { ?> <td align="center"> <a href="<?php echo get_lang(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqEdForum&forumId=' . $thisForum['forum_id']))); ?> "> <img src="<?php echo get_icon_url('edit'); ?> " alt="<?php echo get_lang('Edit');
<span style="font-weight: bold;display:none;"><?php echo $userData['firstname'] . ' ' . $userData['lastname']; ?> </span><?php } } else { ?> <span style="font-weight: bold;"><?php echo $thisPost['firstname'] . ' ' . $thisPost['lastname']; ?> </span><?php } ?> <br /> <small><?php echo claro_html_localised_date(get_locale('dateTimeFormatLong'), datetime_to_timestamp($thisPost['post_time'])); ?> </small> </div> <div class="threadPostContent"> <?php $itemClass = claro_is_user_authenticated() && $this->claro_notifier->is_a_notified_ressource(claro_get_current_course_id(), $this->claro_notifier->get_notification_date(claro_get_current_user_id()), claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id(), $this->forum_id . "-" . $this->topic_id . "-" . $thisPost['post_id']) ? 'item hot' : 'item'; ?> <span class="threadPostIcon <?php echo $itemClass; ?> "> <img src="<?php echo get_icon_url('post'); ?> " alt="" />
*/ ClaroBreadCrumbs::getInstance()->prepend(get_lang('Statistics'), 'courseReport.php'); $nameTools = get_lang('Traffic Details'); $html = ''; $html .= claro_html_tool_title($nameTools); //** dislayed period $html .= '<p><strong>'; switch ($period) { case 'year': $html .= date('Y', $reqdate); break; case 'month': $html .= claro_html_localised_date('%B %Y', $reqdate); break; case 'day': $html .= claro_html_localised_date('%A %d %B %Y', $reqdate); break; } $html .= '</strong></p>' . "\n\n"; $html .= '<p><small>' . "\n"; $html .= get_lang('Period') . ' : ' . '[<a href="' . $_SERVER['PHP_SELF'] . '?period=year&reqdate=' . $reqdate . '&displayType=month">' . ($period == 'year' ? '<strong>' . get_lang('Year') . '</strong>' : get_lang('Year')) . '</a>]' . "\n" . '[<a href="' . $_SERVER['PHP_SELF'] . '?period=month&reqdate=' . $reqdate . '&displayType=day">' . ($period == 'month' ? '<strong>' . get_lang('Month') . '</strong>' : get_lang('Month')) . '</a>]' . "\n" . '[<a href="' . $_SERVER['PHP_SELF'] . '?period=day&reqdate=' . $reqdate . '">' . ($period == 'day' ? '<strong>' . get_lang('Day') . '</strong>' : get_lang('Day')) . '</a>]' . "\n" . ' || ' . "\n" . get_lang('View by') . ' : '; switch ($period) { case 'year': //-- if period is "year" display can be by month, day or hour $html .= ' [<a href="' . $_SERVER['PHP_SELF'] . '?period=' . $period . '&reqdate=' . $reqdate . '&displayType=month">' . ($displayType == 'month' ? '<strong>' . get_lang('Month') . '</strong>' : get_lang('Month')) . '</a>]' . "\n"; case 'month': //-- if period is "month" display can be by day or hour $html .= ' [<a href="' . $_SERVER['PHP_SELF'] . '?period=' . $period . '&reqdate=' . $reqdate . '&displayType=day">' . ($displayType == 'day' ? '<strong>' . get_lang('Day') . '</strong>' : get_lang('Day')) . '</a>]' . "\n"; case 'day': //-- if period is "day" display can only be by hour $html .= ' [<a href="' . $_SERVER['PHP_SELF'] . '?period=' . $period . '&reqdate=' . $reqdate . '&displayType=hour">' . ($displayType == 'hour' ? '<strong>' . get_lang('Hour') . '</strong>' : get_lang('Hour')) . '</a>]' . "\n";
/** * Send course creation information by mail to all platform administrators * * @param string creator firstName * @param string creator lastname * @param string creator email */ public function mailAdministratorOnCourseCreation($creatorFirstName, $creatorLastName, $creatorEmail) { $subject = get_lang('Course created : %course_name', array('%course_name' => $this->title)); $categoryCodeList = array(); foreach ($this->categories as $category) { $categoryCodeList[] = $category->name; } $body = nl2br(get_block('blockCourseCreationEmailMessage', array('%date' => claro_html_localised_date(get_locale('dateTimeFormatLong')), '%sitename' => get_conf('siteName'), '%user_firstname' => $creatorFirstName, '%user_lastname' => $creatorLastName, '%user_email' => $creatorEmail, '%course_code' => $this->officialCode, '%course_title' => $this->title, '%course_lecturers' => $this->titular, '%course_email' => $this->email, '%course_categories' => !empty($this->categories) ? implode(', ', $categoryCodeList) : get_lang('No category'), '%course_language' => $this->language, '%course_url' => get_path('rootWeb') . 'claroline/course/index.php?cid=' . claro_htmlspecialchars($this->courseId)))); // Get the concerned senders of the email $mailToUidList = claro_get_uid_of_system_notification_recipient(); if (empty($mailToUidList)) { $mailToUidList = claro_get_uid_of_platform_admin(); } $message = new MessageToSend(claro_get_current_user_id(), $subject, $body); $recipient = new UserListRecipient(); $recipient->addUserIdList($mailToUidList); //$message->sendTo($recipient); $recipient->sendMessage($message); }
} /** * OUTPUT * * 3 parts in this output * - A detail about the current assignment * - "Command" links to commands * - A list of user relating submission and feedback * */ $out = ''; $out .= claro_html_tool_title($pageTitle, null, $cmdList); /** * ASSIGNMENT INFOS */ $out .= '<p>' . "\n" . '<small>' . "\n" . '<b>' . get_lang('Title') . '</b> : ' . "\n" . $assignment->getTitle() . '<br />' . "\n" . get_lang('<b>From</b> %startDate <b>until</b> %endDate', array('%startDate' => claro_html_localised_date(get_locale('dateTimeFormatLong'), $assignment->getStartDate()), '%endDate' => claro_html_localised_date(get_locale('dateTimeFormatLong'), $assignment->getEndDate()))) . '<br />' . "\n" . '<b>' . get_lang('Submission type') . '</b> : ' . "\n"; if ($assignment->getSubmissionType() == 'TEXT') { $out .= get_lang('Text only (text required, no file)'); } elseif ($assignment->getSubmissionType() == 'TEXTFILE') { $out .= get_lang('Text with attached file (text required, file optional)'); } else { $out .= get_lang('File (file required, description text optional)'); } $out .= '<br />' . "\n" . '<b>' . get_lang('Submission visibility') . '</b> : ' . "\n" . ($assignment->getDefaultSubmissionVisibility() == 'VISIBLE' ? get_lang('Visible for all users') : get_lang('Only visible for teacher(s) and submitter(s)')) . '<br />' . "\n" . '<b>' . get_lang('Assignment type') . '</b> : ' . "\n" . ($assignment->getAssignmentType() == 'INDIVIDUAL' ? get_lang('Individual') : get_lang('Groups')) . '<br />' . "\n" . '<b>' . get_lang('Allow late upload') . '</b> : ' . "\n" . ($assignment->getAllowLateUpload() == 'YES' ? get_lang('Users can submit after end date') : get_lang('Users can not submit after end date')) . '</small>' . "\n" . '</p>' . "\n"; // description of assignment if ($assignment->getDescription() != '') { $out .= '<b><small>' . get_lang('Description') . '</small></b>' . "\n" . '<blockquote>' . "\n" . '<small>' . "\n" . claro_parse_user_text($assignment->getDescription()) . '</small>' . "\n" . '</blockquote>' . "\n" . '<br />' . "\n"; } // show to authenticated and anonymous users if ($textOrFilePresent && ($showAfterEndDate || $showAfterPost)) { $out .= '<fieldset>' . "\n" . '<legend>' . '<b>' . get_lang('Feedback') . '</b>' . '</legend>';
} if ('exDelete' == $cmd && 'BEFORE' == $scope) { if (!is_null($beforeDate)) { // load all available managers $trackingManagerRegistry = TrackingManagerRegistry::getInstance(); // get the loaded list $trackingManagerList = $trackingManagerRegistry->getManagerList(); // perform delete on each manager found foreach ($trackingManagerList as $ctr) { $manager = new $ctr(claro_get_current_course_id()); $manager->deleteBefore($beforeDate); } $dialogBox->success(get_block('All events before %date have been successfully deleted', array('%date' => claro_html_localised_date(get_locale('dateFormatLong'), $beforeDate)))); Console::log("In course " . claro_get_current_course_id() . " : tracking events before " . date('Y-m-d', $beforeDate) . " deleted by " . claro_get_current_user_id(), 'COURSE_RESET_TRACKING_BEFORE'); } else { $dialogBox->error(get_block('%date not valid', array('%date' => claro_html_localised_date(get_locale('dateFormatLong'))))); } $display = DISP_FLUSH_RESULT; } if ('exDelete' == $cmd && 'ALL' == $scope) { // load all available managers $trackingManagerRegistry = TrackingManagerRegistry::getInstance(); // get the loaded list $trackingManagerList = $trackingManagerRegistry->getManagerList(); // perform delete on each manager found foreach ($trackingManagerList as $ctr) { $manager = new $ctr(claro_get_current_course_id()); $manager->deleteAll(); } $dialogBox->success(get_lang('Course statistics are now empty')); Console::log("In course " . claro_get_current_course_id() . " : all tracking events deleted by user " . claro_get_current_user_id(), 'COURSE_RESET_ALL_TRACKING');