]> git.mjollnir.org Git - moodle.git/commitdiff
Disable gui for forum timed posts since we are not quite ready for it. All code is...
authormjollnir_ <mjollnir_>
Fri, 14 Apr 2006 04:51:43 +0000 (04:51 +0000)
committermjollnir_ <mjollnir_>
Fri, 14 Apr 2006 04:51:43 +0000 (04:51 +0000)
mod/forum/lib.php
mod/forum/post.html

index e1dca3b54bfa5ca65be9a715482a92fb06242d21..7173492008934043eb7b132855fc0767272d3d89 100644 (file)
@@ -1140,7 +1140,7 @@ function forum_search_posts($searchterms, $courseid, $page=0, $recordsperpage=50
     }
 
     $timelimit = '';
-    if (!((isadmin() and !empty($CFG->admineditalways)) || isteacher($courseid))) {
+    if (!empty($CFG->forum_enabletimedposts) && (!((isadmin() and !empty($CFG->admineditalways)) || isteacher($courseid)))) {
         $now = time();
         $timelimit = " AND (d.userid = $USER->id OR ((d.timestart = 0 OR d.timestart <= $now) AND (d.timeend = 0 OR d.timeend > $now)))";
     }
index c085f2d5b67a0c3eca29b669b9698f64a799b64b..1d7d79e5af91d56ec2a1859e8aa2449884de05d3 100644 (file)
@@ -113,8 +113,10 @@ if (!isset($discussion->timeend)) {
 <?php } ?>
 
 
-<?php if ($forum->type == 'news' && !$post->parent) {  //  This is the first post of a discussion in news forum  ?>
-
+<?php if (!empty($CFG->forum_enabletimedposts) && 
+    isteacher($course->id) && $forum->type == 'news' && !$post->parent) {  
+   //  This is the first post of a discussion in news forum 
+ ?>
 <tr valign="top">
     <td align="right"><b><?php print_string("displayperiod", "forum") ?>:<br />(<?php print_string("optional") ?>)&nbsp;</b></td>
     <td>
@@ -145,9 +147,10 @@ if (!isset($discussion->timeend)) {
     </td>
 </tr>
 
-<?php } ?>
-
-
+<?php } else { ?>
+<input type="hidden" name="timestartdisabled" value="1" />
+<input type="hidden" name="timeenddisabled" value="1" />
+<? } ?>
 <tr>
     <td align="center" colspan="2">
     <input type="hidden" name="course"     value="<?php p($post->course) ?>" />