]> git.mjollnir.org Git - moodle.git/commitdiff
fixes base table printing for the student
authordiml <diml>
Tue, 6 Nov 2007 11:09:53 +0000 (11:09 +0000)
committerdiml <diml>
Tue, 6 Nov 2007 11:09:53 +0000 (11:09 +0000)
search/stats.php

index cd956e0ceed34cb6a9f9596d4e44f08505b8d1c1..7a41cf9f5c60a19e8fe96c9303af75811079f558 100644 (file)
@@ -2,12 +2,15 @@
 /**
 * Global Search Engine for Moodle
 * Michael Champanis (mchampan) [cynnical@gmail.com]
-* review 1.8+ : Valery Fremaux [valery.fremaux@club-internet.fr]
+* review 1.8+ : Valery Fremaux [valery.fremaux@club-internet.fr] 
 * 2007/08/02
 *
 * Prints some basic statistics about the current index.
 * Does some diagnostics if you are logged in as an administrator.
-*
+* 
+* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
+* @package search
+* @version 2007110400
 */
 
 require_once('../config.php');
@@ -24,22 +27,19 @@ if (empty($CFG->enableglobalsearch)) {
 //check for php5, but don't die yet
 if ($check = search_check_php5()) {
     require_once("{$CFG->dirroot}/search/indexlib.php");
-
+    
     $indexinfo = new IndexInfo();
-}
+} 
 
 if (!$site = get_site()) {
     redirect("index.php");
-}
+} 
 
 $strsearch = get_string('search', 'search');
-$strquery  = get_string('statistics', 'search');
+$strquery  = get_string('statistics', 'search'); 
 
-$navlinks = array();
-$navlinks[] = array('name' => $strsearch, 'link' => "index.php", 'type' => 'misc');
-$navlinks[] = array('name' => $strquery, 'link' => null, 'type' => 'misc');
-$navigation = build_navigation($navlinks);
-print_header("$site->shortname: $strsearch: $strquery", "$site->fullname", $navigation);
+print_header("$site->shortname: $strsearch: $strquery", "$site->fullname",
+           "<a href=\"index.php\">$strsearch</a> -> $strquery");
 
 //keep things pretty, even if php5 isn't available
 if (!$check) {
@@ -72,7 +72,7 @@ if (isadmin()) {
     $checkdbadvicestr = get_string('checkdbadvice', 'search');
     $runindexerteststr = get_string('runindexertest', 'search');
     $runindexerstr = get_string('runindexer', 'search');
-
+    
     $admin_table->tablealign = "center";
     $admin_table->align = array ("right", "left");
     $admin_table->wrap = array ("nowrap", "nowrap");
@@ -86,36 +86,36 @@ if (isadmin()) {
 
     if ($indexinfo->time > 0) {
         $admin_table->data[] = array(get_string('createdon', 'search'), date('r', $indexinfo->time));
-    }
+    } 
     else {
         $admin_table->data[] = array(get_string('createdon', 'search'), '-');
-    }
+    } 
 
     if (!$indexinfo->valid($errors)) {
         $admin_table->data[] = array("<strong>{$errorsstr}</strong>", '&nbsp;');
         foreach ($errors as $key => $value) {
             $admin_table->data[] = array($key.' ... ', $value);
-        }
+        } 
     }
 
     print_table($admin_table);
     print_spacer(20);
     print_heading($solutionsstr);
-
+    
     unset($admin_table->data);
     if (isset($errors['dir'])) {
         $admin_table->data[] = array($checkdirstr, $checkdiradvicestr);
-    }
+    } 
     if (isset($errors['db'])) {
         $admin_table->data[] = array($checkdbstr, $checkdbadvicestr);
-    }
-
+    } 
+    
     $admin_table->data[] = array($runindexerteststr, '<a href="tests/index.php" target="_blank">tests/index.php</a>');
     $admin_table->data[] = array($runindexerstr, '<a href="indexersplash.php" target="_blank">indexersplash.php</a>');
-
+    
     print_table($admin_table);
     print_spacer(20);
-}
+} 
 
 //this is the standard summary table for normal users, shows document counts
 $table->tablealign = "center";
@@ -125,23 +125,23 @@ $table->cellpadding = 5;
 $table->cellspacing = 0;
 $table->width = '500';
 
-$table->data[] = array("<strong>{$databasestr}</strong>", "<em><strong>{$CFG->prefix}block_search_documents</strong></em>");
+$table->data[] = array("<strong>{$databasestr}</strong>", "<em><strong>{$CFG->prefix}".SEARCH_DATABASE_TABLE.'</strong></em>');
 
 //add extra fields if we're admin
 if (isadmin()) {
     //don't want to confuse users if the two totals don't match (hint: they should)
     $table->data[] = array($documentsinindexstr, $indexinfo->indexcount);
-
+    
     //*cough* they should match if deletions were actually removed from the index,
     //as it turns out, they're only marked as deleted and not returned in search results
     $table->data[] = array($deletionsinindexstr, (int)$indexinfo->indexcount - (int)$indexinfo->dbcount);
-}
+} 
 
 $table->data[] = array($documentsindatabasestr, $indexinfo->dbcount);
 
 foreach($indexinfo->types as $key => $value) {
     $table->data[] = array(get_string('documentsfor', 'search') . " '".get_string('modulenameplural', $key)."'", $value);
-}
+} 
 
 print_heading($databasestatestr);
 print_table($table);
@@ -149,4 +149,4 @@ print_table($table);
 print_box_end();
 print_box_end();
 print_footer();
-?>
+?>
\ No newline at end of file