commit type disqus forum for view scorm BT#9882 #TMI

aragonc 11 years ago
parent dbe7216445
commit 6eaa25ad9c
  1. 2
      main/forum/viewthread.php
  2. 35
      main/forum/viewthread_flat.inc.php
  3. 2
      main/inc/ajax/lp.ajax.php
  4. 8
      main/newscorm/scorm_api.php
  5. 3
      main/template/games/layout/head.tpl

@ -82,6 +82,7 @@ if ($origin == 'group') {
Display::display_header('');
} else {
$my_search = isset($_GET['search']) ? $_GET['search'] : '';
if ($origin == 'learnpath') {
Display::display_reduced_header();
} else {
@ -109,6 +110,7 @@ if ($origin == 'group') {
);
$message = isset($message) ? $message : '';
// the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string
Display::display_header('');
}

@ -33,6 +33,9 @@ if (isset($current_thread['thread_id'])) {
$closedPost = null;
if (!empty($rows)) {
if ($origin != 'learnpath') {
/* start foreach forum normal */
foreach ($rows as $row) {
if ($row['user_id'] == '0') {
$name = prepare4display($row['poster_name']);
@ -292,7 +295,8 @@ if (isset($current_thread['thread_id'])) {
$html .= '<a href="download.php?file=' . $realname . '"> ' . $user_filename . ' </a>';
if (($current_forum['allow_edit'] == 1 && $row['user_id'] == $_user['user_id']) ||
(api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId))
(api_is_allowed_to_edit(false,
true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId))
) {
$html .= '&nbsp;&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;origin='
. Security::remove_XSS($_GET['origin']) . '&amp;action=delete_attach&amp;id_attach='
@ -326,4 +330,33 @@ if (isset($current_thread['thread_id'])) {
echo $html;
}
}
/* end foreach*/
if ($origin == 'learnpath') {
/* start foreach type disqus*/
$html = '';
$html .= '<div class="forum-disqus">';
foreach ($rows as $row) {
$name = api_get_person_name($row['firstname'], $row['lastname']);
$username = sprintf(get_lang('LoginX'), $row['username']);
$date = api_get_local_time($row['post_date']);
$html .= '<div class="row">';
$html .= '<div class="col-xs-1 col-md-2">';
$html .= '<div class="thumbnail">' . display_user_image($row['user_id'], $name) . '</div>';
$html .= '</div>';
$html .= '<div class="col-xs-11 col-md-10">';
$html .= '<h5>'.$name.'</h5>';
$html .= '<div class="time timeago" title="'.$date.'">'.$date.'</div>';
$html .= '<div class="description-disqus">'.$row['post_text'].'</div>';
$html .= '</div>';
$html .= '</div>';
}
$html .= '</div>';
echo $html;
/* end foreach type disqus */
}
}
}

@ -182,6 +182,7 @@ switch ($action) {
$forum = $learningPath->getForum();
if (empty($forum)) {
echo json_encode([
'error' => true,
@ -200,6 +201,7 @@ switch ($action) {
$forumThread = $lpItem->getForumThread($course_id, api_get_session_id());
if (empty($forumThread)) {
echo json_encode([
'error' => true,

@ -41,7 +41,9 @@ $userId = api_get_user_id();
header('Content-type: text/javascript');
?>var scorm_logs=<?php echo ((empty($oLP->scorm_debug) or (!api_is_course_admin() && !api_is_platform_admin()) )?'0':'3');?>; //debug log level for SCORM. 0 = none, 1=light, 2=a lot, 3=all - displays logs in log frame
?>
var scorm_logs=<?php echo ((empty($oLP->scorm_debug) or (!api_is_course_admin() && !api_is_platform_admin()) )?'0':'3');?>; //debug log level for SCORM. 0 = none, 1=light, 2=a lot, 3=all - displays logs in log frame
var lms_logs = 0; //debug log level for LMS actions. 0=none, 1=light, 2=a lot, 3=all
// API Object initialization (eases access later on)
@ -1659,6 +1661,9 @@ var loadForumThead = function(lpId, lpItemId) {
$('#forum-container').show();
var forumIframe = $('<iframe>').attr({
width:'900px',
height:'600px',
src: '<?php echo api_get_path(WEB_CODE_PATH) ?>forum/viewthread.php?<?php echo api_get_cidreq() ?>&gradebook=0&origin=learnpath&forum=' + forumThreadData.forumId +'&thread=' + forumThreadData.threadId
});
@ -1666,6 +1671,7 @@ var loadForumThead = function(lpId, lpItemId) {
});
};
/**
* Save a specific item (with its interactions, if any) into the LMS through
* an AJAX call to lp_ajax_save_item.php.

@ -16,6 +16,9 @@
{{ css_static_file_to_string }}
{{ js_file_to_string }}
<script>
$(document).ready(function(){
$(".timeago").timeago();
});
// External plugins not part of the default Ckeditor package.
var plugins = [

Loading…
Cancel
Save