]> git.mjollnir.org Git - moodle.git/commitdiff
Don't display search buttons if all the courses are being displayed anyway
authormoodler <moodler>
Tue, 21 Oct 2003 02:25:22 +0000 (02:25 +0000)
committermoodler <moodler>
Tue, 21 Oct 2003 02:25:22 +0000 (02:25 +0000)
course/lib.php

index 6f9e31199581e3fa5211e1fa16cf8702dd43f21d..a2a482f879ea0b319753b422ef08b98786ac255a 100644 (file)
@@ -1199,11 +1199,13 @@ function print_my_moodle() {
             echo "<br />\n";
         }
 
-        echo "<table width=\"100%\"><tr><td align=\"center\">";
-        print_course_search("", false, "short");
-        echo "</td><td align=\"center\">";
-        print_single_button("$CFG->wwwroot/course/index.php", NULL, get_string("fulllistofcourses"), "get");
-        echo "</td></tr></table>\n";
+        if (count_records("course") > (count($courses) + 1) ) {  // Some courses not being displayed
+            echo "<table width=\"100%\"><tr><td align=\"center\">";
+            print_course_search("", false, "short");
+            echo "</td><td align=\"center\">";
+            print_single_button("$CFG->wwwroot/course/index.php", NULL, get_string("fulllistofcourses"), "get");
+            echo "</td></tr></table>\n";
+        }
     } else {
         if (count_records("course_categories") > 1) {
             print_simple_box_start("center", "100%", "#FFFFFF", 5, "categorybox");