]> git.mjollnir.org Git - moodle.git/commitdiff
Only show search box when there is content in the block
authormoodler <moodler>
Mon, 2 Oct 2006 08:36:25 +0000 (08:36 +0000)
committermoodler <moodler>
Mon, 2 Oct 2006 08:36:25 +0000 (08:36 +0000)
blocks/admin_tree/block_admin_tree.php

index d6ad1b92be8dbc18490465e957823336ead6aad5..67b7e4b52bef3194b440fcf438c1385273e06a35 100644 (file)
@@ -182,18 +182,19 @@ class block_admin_tree extends block_base {
             $this->content->text .= $this->expandjavascript;
 
             $this->content->text .= '</script>' . "\n";
+
+            $searchcontent = isset($CFG->adminsearchquery) ? $CFG->adminsearchquery : '';
+
+            $this->content->footer = '<div class="adminsearchform">'.
+                                     '<form action="'.$CFG->wwwroot.'/admin/search.php" method="get">'.
+                                     '<input type="text" name="query" size="8" value="'.$searchcontent.'" />'.
+                                     '<input type="submit" value="'.get_string('search').'" />'.
+                                     '</form></div>';
         } else {
             $this->content = new stdClass;
             $this->content->text = '';
         }
 
-        $searchcontent = isset($CFG->adminsearchquery) ? $CFG->adminsearchquery : '';
-
-        $this->content->footer = '<div class="adminsearchform">'.
-                                 '<form action="'.$CFG->wwwroot.'/admin/search.php" method="get">'.
-                                 '<input type="text" name="query" size="8" value="'.$searchcontent.'" />'.
-                                 '<input type="submit" value="'.get_string('search').'" />'.
-                                 '</form></div>';
         return $this->content;
 
     }