]> git.mjollnir.org Git - moodle.git/commitdiff
fixing header/formatting
authortoyomoyo <toyomoyo>
Tue, 20 Nov 2007 05:16:11 +0000 (05:16 +0000)
committertoyomoyo <toyomoyo>
Tue, 20 Nov 2007 05:16:11 +0000 (05:16 +0000)
search/indexersplash.php
search/query.php
search/tests/index.php

index 26b7763a34f9615f07d309b01566f0de2fbed3bb..27edca42c0bf272a18d810174bb04c96a1114a19 100644 (file)
@@ -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, "&nbsp;", navmenu($site));
     mtrace("<pre>The data directory ($indexinfo->path) contains $indexinfo->filecount files, and\n"
           ."there are ".$indexinfo->dbcount." records in the <em>block_search_documents</em> table.\n"
           ."\n"
@@ -48,6 +58,7 @@ if ($indexinfo->valid()) {
           ."<a href='tests/index.php'>Test indexing</a> or "
           ."<a href='indexer.php?areyousure=yes'>Continue indexing</a> or <a href='index.php'>Back to query page</a>."
           ."</pre>");
+    print_footer();
 } 
 else {
     header('Location: indexer.php?areyousure=yes');
index b415891835efbeec16f3f068a7828dfeac44d929..03675ab974548aefdb45fbf0d87d73daf825477f 100644 (file)
@@ -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, "&nbsp;", navmenu($course));
+$site = get_site();
+print_header("$strsearch", "$site->fullname" , $navigation, "", "", true, "&nbsp;", navmenu($site));
 
 //keep things pretty, even if php5 isn't available
 if (!$check) {
index d31cd734672c5375d9c8ca5ced7e5f759408b6ee..2b0290292b22a2e12921bd2e9cd696fee576e418 100644 (file)
    * 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, "&nbsp;", 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('<pre>Server Time: '.date('r',time()));
-  mtrace("Testing global search capabilities:\n");
+mtrace('<pre>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("<br/><a href='../index.php'>Back to query page</a> or <a href='../indexersplash.php'>Start indexing</a>.");
-  mtrace('</pre>');
+//now blocks...
+//
 
+mtrace("<br/><a href='../index.php'>Back to query page</a> or <a href='../indexersplash.php'>Start indexing</a>.");
+mtrace('</pre>');
+print_footer();
 ?>
\ No newline at end of file