From: moodler <moodler>
Date: Tue, 21 Oct 2003 02:25:22 +0000 (+0000)
Subject: Don't display search buttons if all the courses are being displayed anyway
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7f989948163f95d4329da22e899b7cd6e8b715d5;p=moodle.git

Don't display search buttons if all the courses are being displayed anyway
---

diff --git a/course/lib.php b/course/lib.php
index 6f9e311995..a2a482f879 100644
--- a/course/lib.php
+++ b/course/lib.php
@@ -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");