]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed up use of isteacher (removed isadmin check because it's done in isteacher now)
authormartin <martin>
Wed, 3 Apr 2002 06:36:04 +0000 (06:36 +0000)
committermartin <martin>
Wed, 3 Apr 2002 06:36:04 +0000 (06:36 +0000)
course/edit.php
course/log.php
course/loglive.php
course/mod.php
course/social.php
course/view.php
course/weeks.php

index 31ff510e6a56ce498a87ec9f26f431d0ed778d5a..3f4977f6e1dc743917688464a861f957f9ec99f9 100644 (file)
@@ -12,7 +12,7 @@
 
            require_login($course->id);
 
-        if (!isteacher($course->id)  && ! isadmin()) {
+        if (!isteacher($course->id)) {
             error("Only teachers can edit the course!");
         }
     } else {  // Admin is creating a new course
index bae4f7cef67282cc493f56dc9454f1abf5875209..2153f4d21ac3fccd9067b6ecd278311b849e2d4e 100644 (file)
@@ -11,7 +11,7 @@
         error("That's an invalid course id");
     }
 
-    if ( ! isteacher($course->id) && ! isadmin()) {
+    if ( ! isteacher($course->id)) {
         error("Only teachers can view logs");
     }
 
index 3b6f687dce2f709c36dc0e4187ff056dca4ae2a3..71d09bd65ffa65c856afcf1693f70e0dfe1c23ba 100644 (file)
@@ -11,7 +11,7 @@
         error("That's an invalid course id");
     }
 
-    if ( ! isteacher($course->id) && ! isadmin()) {
+    if (! isteacher($course->id)) {
         error("Only teachers can view logs");
     }
 
index ded225188cd2c25bfa8851ed7ad8f134384c6c46..832f6e7a20194cb5fbf1c8db97b35c075a4f2884 100644 (file)
@@ -9,7 +9,7 @@
 
         require_login($mod->course);
 
-        if (!isteacher($mod->course) && !isadmin()) {
+        if (!isteacher($mod->course)) {
             error("You can't modify this course!");
         }
 
@@ -93,7 +93,7 @@
 
         require_login($course->id);
 
-        if (!isteacher($course->id) && !isadmin()) {
+        if (!isteacher($course->id)) {
             error("You can't modify this course!");
         }
 
 
     require_login($course->id);
 
-    if (!isteacher($course->id) && !isadmin()) {
+    if (!isteacher($course->id)) {
         error("You can't modify this course!");
     }
 
index aa695e63ece0de0028d3f901a5341b2b2976a46a..81a2c69341019e6d109944d2ccb8ff59a830298d 100644 (file)
       } else {
           $subtext = "Subscribe me by mail";
       }
-      $headertext = "<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD>Discussion Topics<TD ALIGN=RIGHT><FONT SIZE=1><A HREF=\"../mod/discuss/subscribe.php?id=$social->id\">$subtext</A></TD></TR></TABLE>";
+      $headertext = "<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD>Social Forum - Current Topics<TD ALIGN=RIGHT><FONT SIZE=1><A HREF=\"../mod/discuss/subscribe.php?id=$social->id\">$subtext</A></TD></TR></TABLE>";
          print_simple_box("$headertext", $align="CENTER", $width="100%", $color="$THEME->cellheading"); ?>
       <IMG HEIGHT=7 SRC="../pix/spacer.gif"><BR>
 
       <? 
           if ($social = get_course_social_forum($course->id)) {
-              forum_latest_topics($social->id, 5, "plain", "DESC", false);
+              forum_latest_topics($social->id, 10, "plain", "DESC", false);
           } else {
               error("Could not find or create a social forum here");
           }
index f86e47a777c475d6557333386afb788b51839b67..1a1d932aa7e7a8ae243b8670414177e0327595d8 100644 (file)
@@ -14,7 +14,7 @@
 
     add_to_log("View course: $course->shortname", $id);
 
-    if ( isteacher($course->id) || isadmin() ) {
+    if ( isteacher($course->id) ) {
         if ($edit == "on") {
             $USER->editing = true;
         } else if ($edit == "off") {
index d70ef0054ba1a52a4ba92f1ca70de6e872e6f5ab..68fddb891167a2cd63b9e25e98f94a1745ec5455 100644 (file)
@@ -46,7 +46,7 @@
 
     // Admin links and controls
 
-    if ($USER->teacher[$course->id] || isadmin()) {
+    if (isteacher($course->id)) {
         $adminicon[]="<IMG SRC=\"../pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"Edit\">";
         if ($USER->editing) {
             $admindata[]="<A HREF=\"view.php?id=$course->id&edit=off\">Turn editing off</A>";