Minor - format code.

1.9.x
Julio Montoya 11 years ago
parent e965254e82
commit bd149144b5
  1. 4
      main/forum/editpost.php
  2. 8
      main/forum/reply.php
  3. 17
      main/forum/viewforum.php
  4. 4
      main/forum/viewthread.php
  5. 2
      main/forum/viewthread_flat.inc.php

@ -70,8 +70,8 @@ $htmlHeadXtra[] = '<script>
// We are getting all the information about the current forum and forum category.
// Note pcool: I tried to use only one sql statement (and function) for this,
// but the problem is that the visibility of the forum AND forum cateogory are stored in the item_property table.
$current_thread = get_thread_information($_GET['thread']); // Note: This has to be validated that it is an existing thread.
$current_forum = get_forum_information($_GET['forum']); // Note: This has to be validated that it is an existing forum.
$current_thread = get_thread_information($_GET['thread']);
$current_forum = get_forum_information($_GET['forum']);
$current_forum_category = get_forumcategory_information($current_forum['forum_category']);
$current_post = get_post_information($_GET['post']);

@ -175,11 +175,15 @@ if (!empty($values) AND isset($_POST['SubmitPost'])) {
} else {
// Only show Forum attachment ajax form when do not pass form submit
echo '<div class="row"><div class="span12">';
$attachmentAjaxForm = getAttachmentAjaxForm($current_forum['forum_id'], $current_thread['thread_id'], 0);
$attachmentAjaxForm = getAttachmentAjaxForm(
$current_forum['forum_id'],
$current_thread['thread_id'],
0
);
echo $attachmentAjaxForm;
echo '</div></div>';
}
if ($origin != 'learnpath') {
Display :: display_footer();
}
}

@ -290,14 +290,19 @@ if ($origin != 'learnpath') {
// 1. the course admin is here
// 2. the course member is here and new threads are allowed
// 3. a visitor is here and new threads AND allowed AND anonymous posts are allowed
if (api_is_allowed_to_edit(false, true) OR ($current_forum['allow_new_threads'] == 1 AND isset($_user['user_id'])) OR ($current_forum['allow_new_threads'] == 1 AND !isset($_user['user_id']) AND $current_forum['allow_anonymous'] == 1)) {
if (api_is_allowed_to_edit(false, true) OR
($current_forum['allow_new_threads'] == 1 AND isset($_user['user_id'])) OR
($current_forum['allow_new_threads'] == 1 AND !isset($_user['user_id']) AND $current_forum['allow_anonymous'] == 1)
) {
if ($current_forum['locked'] <> 1 AND $current_forum['locked'] <> 1) {
if (!api_is_anonymous()) {
if ($my_forum == strval(intval($my_forum))) {
echo '<a href="'.$forumUrl.'newthread.php?'.api_get_cidreq().'&amp;forum='.Security::remove_XSS($my_forum).$origin_string.'">'.Display::return_icon('new_thread.png',get_lang('NewTopic'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.$forumUrl.'newthread.php?'.api_get_cidreq().'&amp;forum='.Security::remove_XSS($my_forum).$origin_string.'">'.
Display::return_icon('new_thread.png',get_lang('NewTopic'),'',ICON_SIZE_MEDIUM).'</a>';
} else {
$my_forum = strval(intval($my_forum));
echo '<a href="'.$forumUrl.'newthread.php?'.api_get_cidreq().'&amp;forum='.$my_forum.$origin_string.'">'.Display::return_icon('new_thread.png',get_lang('NewTopic'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.$forumUrl.'newthread.php?'.api_get_cidreq().'&amp;forum='.$my_forum.$origin_string.'">'.
Display::return_icon('new_thread.png',get_lang('NewTopic'),'',ICON_SIZE_MEDIUM).'</a>';
}
}
} else {
@ -336,7 +341,7 @@ echo '<td>'.get_lang('Actions').'</td>';
echo '</tr>';
// Getting al the threads
$threads = get_threads($my_forum); // Note: This has to be cleaned first
$threads = get_threads($my_forum);
$whatsnew_post_info = isset($_SESSION['whatsnew_post_info']) ? $_SESSION['whatsnew_post_info'] : null;
$course_id = api_get_course_int_id();
@ -345,7 +350,9 @@ $counter = 0;
if (is_array($threads)) {
foreach ($threads as $row) {
// Thread who have no replies yet and the only post is invisible should not be displayed to students.
if (api_is_allowed_to_edit(false, true) OR !($row['thread_replies'] == '0' AND $row['visibility'] == '0')) {
if (api_is_allowed_to_edit(false, true) OR
!($row['thread_replies'] == '0' AND $row['visibility'] == '0')
) {
if ($counter % 2 == 0) {
$class = 'row_odd';
} else {

@ -39,13 +39,13 @@ $gradebook = null;
// We are getting all the information about the current forum and forum category.
// Note pcool: I tried to use only one sql statement (and function) for this,
// but the problem is that the visibility of the forum AND forum cateogory are stored in the item_property table.
// but the problem is that the visibility of the forum AND forum category are stored in the item_property table.
// Note: This has to be validated that it is an existing thread
$current_thread = get_thread_information($_GET['thread']);
// Note: This has to be validated that it is an existing forum.
$current_forum = get_forum_information($current_thread['forum_id']);
$current_forum_category = get_forumcategory_information($current_forum['forum_category']);
$whatsnew_post_info = isset($_SESSION['whatsnew_post_info']) ? $_SESSION['whatsnew_post_info'] : null; // This variable should be deprecated?
$whatsnew_post_info = isset($_SESSION['whatsnew_post_info']) ? $_SESSION['whatsnew_post_info'] : null;
/* Header and Breadcrumbs */

@ -18,7 +18,7 @@ if (isset($current_thread['thread_id'])) {
if (!empty($rows)) {
foreach ($rows as $row) {
echo '<table width="100%" height="100%" class="forum_table" cellspacing="5" border="0">';
echo '<table width="100%" class="forum_table" cellspacing="5" border="0">';
// the style depends on the status of the message: approved or not
if ($row['visible']=='0') {
$titleclass='forum_message_post_title_2_be_approved';

Loading…
Cancel
Save