예제 #1
0
 if ($origin != 'learnpath') {
     if (GroupManager::is_tutor_of_group($userId, $groupId) || api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)) {
         if ($locked == false) {
             $iconEdit .= "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&forum=" . $clean_forum_id . "&thread=" . $clean_thread_id . "&action=delete&content=post&id=" . $row['post_id'] . "&origin=" . $origin . "\" onclick=\"javascript:if(!confirm('" . addslashes(api_htmlentities(get_lang('DeletePost'), ENT_QUOTES)) . "')) return false;\">" . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . "</a>";
         }
     }
     if (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)) {
         $iconEdit .= return_visible_invisible_icon('post', $row['post_id'], $row['visible'], array('forum' => $clean_forum_id, 'thread' => $clean_thread_id, 'origin' => $origin));
         $iconEdit .= "";
         if ($increment > 0) {
             $iconEdit .= "<a href=\"viewthread.php?" . api_get_cidreq() . "&forum=" . $clean_forum_id . "&thread=" . $clean_thread_id . "&action=move&post=" . $row['post_id'] . "&origin=" . $origin . "\">" . Display::return_icon('move.png', get_lang('MovePost'), array(), ICON_SIZE_SMALL) . "</a>";
         }
     }
 }
 $user_status = api_get_status_of_user_in_course($row['user_id'], api_get_course_int_id());
 $current_qualify_thread = showQualify('1', $row['poster_id'], $_GET['thread']);
 if (($current_thread['thread_peer_qualify'] == 1 || api_is_allowed_to_edit(null, true)) && $current_thread['thread_qualify_max'] > 0 && $origin != 'learnpath') {
     $my_forum_id = $clean_forum_id;
     if (isset($_GET['gradebook'])) {
         $info_thread = get_thread_information($clean_thread_id);
         $my_forum_id = $info_thread['forum_id'];
     }
     $userCanEdit = $current_thread['thread_peer_qualify'] == 1 && $row['poster_id'] != $userId;
     if (api_is_allowed_to_edit(null, true)) {
         $userCanEdit = true;
     }
     if ($increment > 0 && $locked == false && $userCanEdit) {
         $iconEdit .= "<a href=\"forumqualify.php?" . api_get_cidreq() . "&forum=" . $my_forum_id . "&thread=" . $clean_thread_id . "&action=list&post=" . $row['post_id'] . "&user="******"&user_id=" . $row['poster_id'] . "&origin=" . $origin . "&idtextqualify=" . $current_qualify_thread . "\" >" . Display::return_icon('quiz.gif', get_lang('Qualify')) . "</a> ";
     }
 }
 if ($iconEdit != '') {
예제 #2
0
    $message = approve_post($_GET['id'], $action);
}
if ($action == 'move' && isset($_GET['post'])) {
    $message = move_post_form();
}
/*
    Display the action messages
*/
if (!empty($message)) {
    Display::display_confirmation_message(get_lang($message));
}
if ($allowToQualify) {
    $currentThread = get_thread_information($_GET['thread']);
    $threadId = $currentThread['thread_id'];
    // Show max qualify in my form
    $maxQualify = showQualify('2', $userIdToQualify, $threadId);
    $score = isset($_POST['idtextqualify']) ? $_POST['idtextqualify'] : '';
    if ($score > $maxQualify) {
        Display::display_error_message(get_lang('QualificationCanNotBeGreaterThanMaxScore'), false);
    }
    if (!empty($score)) {
        $saveResult = saveThreadScore($currentThread, $userIdToQualify, $threadId, $score, api_get_utc_datetime(), api_get_session_id());
    }
    // show qualifications history
    $type = isset($_GET['type']) ? $_GET['type'] : '';
    $historyList = getThreadScoreHistory($userIdToQualify, $threadId, $type);
    $counter = count($historyList);
    // Show current qualify in my form
    $qualify = current_qualify_of_thread($threadId, api_get_session_id(), $_GET['user']);
    $result = get_statistical_information($threadId, $_GET['user_id'], api_get_course_int_id());
    $url = api_get_path(WEB_CODE_PATH) . 'forum/forumqualify.php?' . api_get_cidreq() . '&forum=' . intval($_GET['forum']) . '&thread=' . $threadId . '&user='******'user']) . '&user_id=' . intval($_GET['user']);
예제 #3
0
     if (Database::num_rows($student_list) > 0) {
         while ($row_student_list = Database::fetch_array($student_list)) {
             $userInfo = api_get_user_info($row_student_list['id']);
             if ($counter_stdlist % 2 == 0) {
                 $class_stdlist = 'row_odd';
             } else {
                 $class_stdlist = 'row_even';
             }
             $table_list .= '<tr class="' . $class_stdlist . '"><td>';
             $table_list .= UserManager::getUserProfileLink($userInfo);
             $table_list .= '</td>';
             if ($listType == 'qualify') {
                 $table_list .= '<td>' . $row_student_list['qualify'] . '/' . $max_qualify . '</td>';
             }
             if (api_is_allowed_to_edit(null, true)) {
                 $current_qualify_thread = showQualify('1', $row_student_list['id'], $_GET['id']);
                 $table_list .= '<td>
                     <a href="' . $forumUrl . 'forumqualify.php?' . api_get_cidreq() . '&forum=' . Security::remove_XSS($my_forum) . '&thread=' . Security::remove_XSS($_GET['id']) . '&user='******'id'] . '&user_id=' . $row_student_list['id'] . '&idtextqualify=' . $current_qualify_thread . '&origin=' . $origin . '">' . Display::return_icon($icon_qualify, get_lang('Qualify')) . '</a></td></tr>';
             }
             $counter_stdlist++;
         }
     } else {
         if ($listType == 'qualify') {
             $table_list .= '<tr><td colspan="2">' . get_lang('ThereIsNotQualifiedLearners') . '</td></tr>';
         } else {
             $table_list .= '<tr><td colspan="2">' . get_lang('ThereIsNotUnqualifiedLearners') . '</td></tr>';
         }
     }
     $table_list .= '</table></center>';
     $table_list .= '<br />';
 } else {
예제 #4
0
                echo '<span class="forum_attach_comment" >' . $attachment['comment'] . '</span><br />';
                echo '</td></tr>';
            }
        }
        // The post has been displayed => it can be removed from the what's new array
        if (isset($whatsnew_post_info)) {
            unset($whatsnew_post_info[$currentForum['forum_id']][$current_thread['thread_id']][$row['post_id']]);
            unset($whatsnew_post_info[$currentForum['forum_id']][$current_thread['thread_id']]);
        }
        if (isset($_SESSION['whatsnew_post_info'])) {
            unset($_SESSION['whatsnew_post_info'][$currentForum['forum_id']][$current_thread['thread_id']][$row['post_id']]);
            unset($_SESSION['whatsnew_post_info'][$currentForum['forum_id']][$current_thread['thread_id']]);
        }
        echo "</table></div>";
        $counter++;
    }
}
//return Max qualify thread
$max_qualify = showQualify('2', $userid, $threadid);
$current_qualify_thread = showQualify('1', $userid, $threadid);
if (isset($_POST['idtextqualify'])) {
    saveThreadScore($current_thread, $userid, $threadid, $_POST['idtextqualify'], api_get_user_id(), date('Y-m-d H:i:s'), '');
}
$result = get_statistical_information($current_thread['thread_id'], $_GET['user_id'], api_get_course_int_id());
/*
if ($userInfo['status']!='1') {
    echo '<div class="forum-qualification-input-box">';
    require_once 'forumbody.inc.php';
    echo '</div>';
}
*/
    }
    display_visible_invisible_icon('post', $rows[$display_post_id]['post_id'], $rows[$display_post_id]['visible'], array('forum' => $forumId, 'thread' => $threadId, 'post' => Security::remove_XSS($_GET['post'])));
    if (!isset($_GET['id']) && $post_id > $post_minor) {
        echo "<a href=\"viewthread.php?" . api_get_cidreq() . "&forum=" . $forumId . "&thread=" . $threadId . "&origin=" . $origin . "&action=move&post=" . $rows[$display_post_id]['post_id'] . "\">" . Display::return_icon('move.png', get_lang('MovePost'), array(), ICON_SIZE_SMALL) . "</a>";
    }
}
$userCanQualify = $currentThread['thread_peer_qualify'] == 1 && $rows[$display_post_id]['poster_id'] != $userId;
if (api_is_allowed_to_edit(null, true)) {
    $userCanQualify = true;
}
if (empty($currentThread['thread_qualify_max'])) {
    $userCanQualify = false;
}
if ($userCanQualify) {
    if ($post_id > $post_minor) {
        $current_qualify_thread = showQualify('1', $rows[$display_post_id]['user_id'], $_GET['thread']);
        if ($locked == false) {
            echo "<a href=\"forumqualify.php?" . api_get_cidreq() . "&forum=" . $forumId . "&thread=" . $threadId . "&action=list&post=" . $rows[$display_post_id]['post_id'] . "&user="******"&user_id=" . $rows[$display_post_id]['user_id'] . "&origin=" . $origin . "&idtextqualify=" . $current_qualify_thread . "\" >" . Display::return_icon('quiz.gif', get_lang('Qualify')) . "</a>";
        }
    }
}
if ($current_forum_category && $current_forum_category['locked'] == 0 && $current_forum['locked'] == 0 && $current_thread['locked'] == 0 || api_is_allowed_to_edit(false, true)) {
    if ($_user['user_id'] || $current_forum['allow_anonymous'] == 1 && !$_user['user_id']) {
        if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) {
            echo '<a href="reply.php?' . api_get_cidreq() . '&forum=' . $forumId . '&thread=' . $threadId . '&post=' . $rows[$display_post_id]['post_id'] . '&action=replymessage&origin=' . $origin . '">' . Display::return_icon('message_reply_forum.png', get_lang('ReplyToMessage')) . "</a>";
            echo '<a href="reply.php?' . api_get_cidreq() . '&forum=' . $forumId . '&thread=' . $threadId . '&post=' . $rows[$display_post_id]['post_id'] . '&action=quote&origin=' . $origin . '">' . Display::return_icon('quote.gif', get_lang('QuoteMessage')) . "</a>";
        }
    }
} else {
    if ($current_forum_category && $current_forum_category['locked'] == 1) {
        echo get_lang('ForumcategoryLocked') . '<br />';
 if (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)) {
     $iconEdit .= return_visible_invisible_icon('post', $post['post_id'], $post['visible'], array('forum' => $clean_forum_id, 'thread' => $clean_thread_id));
     if ($count > 0) {
         $iconEdit .= "<a href=\"viewthread.php?" . api_get_cidreq() . "&forum={$clean_forum_id}&thread={$clean_thread_id}&action=move&origin={$origin}&post={$post['post_id']}" . "\">" . Display::return_icon('move.png', get_lang('MovePost'), array(), ICON_SIZE_SMALL) . "</a>";
     }
 }
 $userCanQualify = $currentThread['thread_peer_qualify'] == 1 && $post['poster_id'] != $userId;
 if (api_is_allowed_to_edit(null, true)) {
     $userCanQualify = true;
 }
 if (empty($currentThread['thread_qualify_max'])) {
     $userCanQualify = false;
 }
 if ($userCanQualify) {
     if ($count > 0) {
         $current_qualify_thread = showQualify('1', $post['user_id'], $_GET['thread']);
         if ($locked == false) {
             $iconEdit .= "<a href=\"forumqualify.php?" . api_get_cidreq() . "&forum={$clean_forum_id}&thread={$clean_thread_id}&action=list&post={$post['post_id']}" . "&user={$post['user_id']}&user_id={$post['user_id']}&origin={$origin}" . "&idtextqualify={$current_qualify_thread}" . "\" >" . Display::return_icon('quiz.gif', get_lang('Qualify')) . "</a>";
         }
     }
 }
 $statusIcon = getPostStatus($current_forum, $post);
 if ($iconEdit != '') {
     $html .= '<div class="tools-icons">' . $iconEdit . ' ' . $statusIcon . '</div>';
 }
 if ($current_forum_category && $current_forum_category['locked'] == 0 && $current_forum['locked'] == 0 && $current_thread['locked'] == 0 || api_is_allowed_to_edit(false, true)) {
     if ($userId || $current_forum['allow_anonymous'] == 1 && !$userId) {
         if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) {
             $buttonReply = Display::tag('a', '<em class="fa fa-reply"></em> ' . get_lang('ReplyToMessage'), array('href' => 'reply.php?' . api_get_cidreq() . "&forum={$clean_forum_id}'&thread={$clean_thread_id}" . "&post={$post['post_id']}&action=replymessage&origin={$origin}", 'class' => 'btn btn-primary'));
             $buttonQuote = Display::tag('a', '<em class="fa fa-quote-left"></em> ' . get_lang('QuoteMessage'), array('href' => 'reply.php?' . api_get_cidreq() . "&forum={$clean_forum_id}&thread={$clean_thread_id}" . "&post={$post['post_id']}&action=quote&origin={$origin}", 'class' => 'btn btn-success'));
         }