From: toyomoyo Date: Tue, 20 Nov 2007 05:16:11 +0000 (+0000) Subject: fixing header/formatting X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d052434c4f4558396d969bf1654bdebf61687c6c;p=moodle.git fixing header/formatting --- diff --git a/search/indexersplash.php b/search/indexersplash.php index 26b7763a34..27edca42c0 100644 --- a/search/indexersplash.php +++ b/search/indexersplash.php @@ -34,6 +34,16 @@ require_once("$CFG->dirroot/search/indexlib.php"); $indexinfo = new IndexInfo(); if ($indexinfo->valid()) { + $strsearch = get_string('search', 'search'); + $strquery = get_string('stats'); + + $navlinks[] = array('name' => $strsearch, 'link' => "index.php", 'type' => 'misc'); + $navlinks[] = array('name' => $strquery, 'link' => "stats.php", 'type' => 'misc'); + $navlinks[] = array('name' => get_string('runindexer','search'), 'link' => null, 'type' => 'misc'); + $navigation = build_navigation($navlinks); + $site = get_site(); + print_header("$strsearch", "$site->fullname" , $navigation, "", "", true, " ", navmenu($site)); + mtrace("
The data directory ($indexinfo->path) contains $indexinfo->filecount files, and\n"
           ."there are ".$indexinfo->dbcount." records in the block_search_documents table.\n"
           ."\n"
@@ -48,6 +58,7 @@ if ($indexinfo->valid()) {
           ."Test indexing or "
           ."Continue indexing or Back to query page."
           ."
"); + print_footer(); } else { header('Location: indexer.php?areyousure=yes'); diff --git a/search/query.php b/search/query.php index b415891835..03675ab974 100644 --- a/search/query.php +++ b/search/query.php @@ -138,8 +138,8 @@ $strquery = get_string('enteryoursearchquery', 'search'); $navlinks[] = array('name' => $strsearch, 'link' => "index.php", 'type' => 'misc'); $navlinks[] = array('name' => $strquery, 'link' => null, 'type' => 'misc'); $navigation = build_navigation($navlinks); -$course = get_site(); -print_header("$strsearch", "$strsearch" , $navigation, "", "", true, " ", navmenu($course)); +$site = get_site(); +print_header("$strsearch", "$site->fullname" , $navigation, "", "", true, " ", navmenu($site)); //keep things pretty, even if php5 isn't available if (!$check) { diff --git a/search/tests/index.php b/search/tests/index.php index d31cd73467..2b0290292b 100644 --- a/search/tests/index.php +++ b/search/tests/index.php @@ -6,91 +6,101 @@ * directory. * */ - @set_time_limit(0); - @ob_implicit_flush(true); - @ob_end_flush(); - - require_once('../../config.php'); - require_once("$CFG->dirroot/search/lib.php"); - - require_login(); - - if (empty($CFG->enableglobalsearch)) { +@set_time_limit(0); +@ob_implicit_flush(true); +@ob_end_flush(); + +require_once('../../config.php'); +require_once("$CFG->dirroot/search/lib.php"); + +require_login(); + +$strsearch = get_string('search', 'search'); +$strquery = get_string('stats'); + +$navlinks[] = array('name' => $strsearch, 'link' => "../index.php", 'type' => 'misc'); +$navlinks[] = array('name' => $strquery, 'link' => "../stats.php", 'type' => 'misc'); +$navlinks[] = array('name' => get_string('runindexertest','search'), 'link' => null, 'type' => 'misc'); +$navigation = build_navigation($navlinks); +$site = get_site(); +print_header("$strsearch", "$site->fullname" , $navigation, "", "", true, " ", navmenu($site)); + +if (empty($CFG->enableglobalsearch)) { error('Global searching is not enabled.'); - } +} - if (!isadmin()) { +if (!isadmin()) { error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php"); - } //if +} //if - mtrace('
Server Time: '.date('r',time()));
-  mtrace("Testing global search capabilities:\n");
+mtrace('
Server Time: '.date('r',time()));
+mtrace("Testing global search capabilities:\n");
 
-  $phpversion = phpversion();
+$phpversion = phpversion();
 
-  if (!search_check_php5()) {
+if (!search_check_php5()) {
     mtrace("ERROR: PHP 5.0.0 or later required (currently using version $phpversion).");
     exit(0);
-  } else {
+} else {
     mtrace("Success: PHP 5.0.0 or later is installed ($phpversion).\n");
-  } //else
+} //else
 
-  //fix paths for testing
-  set_include_path(get_include_path().":../");
-  require_once("$CFG->dirroot/search/Zend/Search/Lucene.php");
+//fix paths for testing
+set_include_path(get_include_path().":../");
+require_once("$CFG->dirroot/search/Zend/Search/Lucene.php");
 
-  mtrace("Checking activity modules:\n");
+mtrace("Checking activity modules:\n");
 
-  //the presence of the required search functions -
-  // * mod_iterator
-  // * mod_get_content_for_index
-  //are the sole basis for including a module in the index at the moment.
+//the presence of the required search functions -
+// * mod_iterator
+// * mod_get_content_for_index
+//are the sole basis for including a module in the index at the moment.
 
-  if ($mods = get_records_select('modules')) {
+if ($mods = get_records_select('modules')) {
     $mods = array_merge($mods, search_get_additional_modules());
 
     foreach ($mods as $mod) {
-      $class_file = $CFG->dirroot.'/search/documents/'.$mod->name.'_document.php';
-
-      if (file_exists($class_file)) {
-        include_once($class_file);
-
-        if (!defined('SEARCH_TYPE_'.strtoupper($mod->name))) {
-          mtrace("ERROR: Constant 'SEARCH_TYPE_".strtoupper($mod->name)."' is not defined in /search/lib.php");
-          continue;
-        } //if
-
-        $iter_function = $mod->name.'_iterator';
-        $index_function = $mod->name.'_get_content_for_index';
-
-        if (function_exists($index_function) && function_exists($iter_function)) {
-          if (is_array($iter_function())) {
-            $documents = $index_function(array_pop($iter_function()));
-
-            if (is_array($documents)) {
-              mtrace("Success: '$mod->name' module seems to be ready for indexing.");
+        $class_file = $CFG->dirroot.'/search/documents/'.$mod->name.'_document.php';
+
+        if (file_exists($class_file)) {
+            include_once($class_file);
+
+            if (!defined('SEARCH_TYPE_'.strtoupper($mod->name))) {
+                mtrace("ERROR: Constant 'SEARCH_TYPE_".strtoupper($mod->name)."' is not defined in /search/lib.php");
+                continue;
+            } //if
+
+            $iter_function = $mod->name.'_iterator';
+            $index_function = $mod->name.'_get_content_for_index';
+
+            if (function_exists($index_function) && function_exists($iter_function)) {
+                if (is_array($iter_function())) {
+                    $documents = $index_function(array_pop($iter_function()));
+
+                    if (is_array($documents)) {
+                        mtrace("Success: '$mod->name' module seems to be ready for indexing.");
+                    } else {
+                        mtrace("ERROR: $index_function() doesn't seem to be returning an array.");
+                    } //else
+                } else {
+                    mtrace("ERROR: $iter_function() doesn't seem to be returning an object array.");
+                } //else
             } else {
-              mtrace("ERROR: $index_function() doesn't seem to be returning an array.");
+                mtrace("ERROR: $iter_function() and/or $index_function() does not exist in $class_file");
             } //else
-          } else {
-            mtrace("ERROR: $iter_function() doesn't seem to be returning an object array.");
-          } //else
         } else {
-          mtrace("ERROR: $iter_function() and/or $index_function() does not exist in $class_file");
+            mtrace("Notice: $class_file does not exist, this module will not be indexed.");
         } //else
-      } else {
-        mtrace("Notice: $class_file does not exist, this module will not be indexed.");
-      } //else
     } //foreach
-  } //if
-
-  //finished modules
-  mtrace("\nFinished checking activity modules.");
+} //if
 
-  //now blocks...
-  //
+//finished modules
+mtrace("\nFinished checking activity modules.");
 
-  mtrace("
Back to query page or Start indexing."); - mtrace('
'); +//now blocks... +// +mtrace("
Back to query page or Start indexing."); +mtrace('
'); +print_footer(); ?> \ No newline at end of file