]> git.mjollnir.org Git - moodle.git/commitdiff
Disabled global search by default and marked as experimental MDL-7296 and AJAX moved...
authorskodak <skodak>
Mon, 30 Oct 2006 21:01:47 +0000 (21:01 +0000)
committerskodak <skodak>
Mon, 30 Oct 2006 21:01:47 +0000 (21:01 +0000)
13 files changed:
admin/settings/misc.php
admin/settings/server.php
blocks/search/block_search.php
lang/en_utf8/admin.php
search/add.php
search/cron.php
search/delete.php
search/indexer.php
search/indexersplash.php
search/query.php
search/stats.php
search/tests/index.php
search/update.php

index 57f3b3985162b61bed7cfabda7aa6ec3c26677ba..f14c8e552a07d7f0fb368dfe3e6e6d82b9f5159f 100644 (file)
@@ -1,9 +1,17 @@
 <?php // $Id$
 
-// * Miscellaneous settings (still to be sorted)
+// * Miscellaneous settings
 
+// Experimental settings page
+$temp = new admin_settingpage('experimental', get_string('experimental', 'admin'));
+$temp->add(new admin_setting_configcheckbox('enableajax', get_string('enableajax', 'admin'), get_string('configenableajax', 'admin'), 0));
+$temp->add(new admin_setting_configcheckbox('enableglobalsearch', get_string('enableglobalsearch', 'admin'), get_string('configenableglobalsearch', 'admin'), 0));
+$ADMIN->add('misc', $temp);
+
+// XMLDB editor
 $ADMIN->add('misc', new admin_externalpage('xmldbeditor', get_string('xmldbeditor'), "$CFG->wwwroot/$CFG->admin/xmldb/"));
 
+
 // hidden scripts linked from elsewhere
 $ADMIN->add('misc', new admin_externalpage('oacleanup', 'Online Assignment Cleanup', $CFG->wwwroot.'/'.$CFG->admin.'/oacleanup.php', 'moodle/site:config', true));
 $ADMIN->add('misc', new admin_externalpage('upgradeforumread', 'Upgrade forum', $CFG->wwwroot.'/'.$CFG->admin.'/upgradeforumread.php', 'moodle/site:config', true));
index 9a62bc5fa4ad901181798f42e83d1263cd5f959e..b01eabaa9503886bdb494c415e73898336d92d86 100644 (file)
@@ -88,7 +88,6 @@ $ADMIN->add('server', $temp);
 $temp = new admin_settingpage('debugging', get_string('debugging', 'admin'));
 $temp->add(new admin_setting_special_debug());
 $temp->add(new admin_setting_special_perfdebug());
-$temp->add(new admin_setting_configcheckbox('enableajax', get_string('enableajax', 'admin'), get_string('configenableajax', 'admin'), 0));
 $ADMIN->add('server', $temp);
 
 
index 778dc6bf39ca405ec3b7e19af82090dbbd6d70f4..96b73ec2d799c616f7de811bcd68e3375ed142f9 100644 (file)
       
     function get_content() {
       global $CFG;
-      
+
+      if (empty($CFG->enableglobalsearch)) {
+        return '';
+      }
+
       //cache block contents
       if ($this->content !== NULL) {
         return $this->content;
index 5ce5497b52ca4bfa6a6195200e9ba17652d4d081..d906d50cdb391e34351c13699e2d7926e2b58ce1 100644 (file)
@@ -3,6 +3,10 @@
 
 
 // begin {added with admin cleanup}
+$string['experimental'] = 'Experimental';
+$string['enableglobalsearch'] = 'Enable global search';
+$string['configenableglobalsearch'] = 'This setting enables global text searching in resources and activities, it is not compatible with PHP 4.';
+$string['enableajax'] = 'Enable AJAX';
 $string['gradebook'] = 'Gradebook';
 $string['gradebookroles'] = 'Graded roles';
 $string['configgradebookroles'] = 'This setting allows you to control who appears on the gradebook.  Users need to have at least one of these roles in a course to be shown in the gradebook for that course.';
index f6f2607e0caa1d7dc0050d61b58ee66a7d6840ef..285c9d948c8a7b1a58ac8654a00d70f015bc395f 100644 (file)
@@ -5,6 +5,10 @@
 
   require_login();
 
+  if (empty($CFG->enableglobalsearch)) {
+    error('Global searching is not enabled.');
+  }
+
   if (!isadmin()) {
     error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
   } //if
index 36797e3c140b155fb5b8d91ebc3587cb37bed577..841d51fe8c7a3af636bfaa7c3577e714a08ac248 100644 (file)
   require_once('../config.php');
   require_once("$CFG->dirroot/search/lib.php");
 
+  if (empty($CFG->enableglobalsearch)) {
+    error('Global searching is not enabled.');
+  }
+
   mtrace("<pre>Starting cron...\n");
 
   mtrace("--DELETE----");
index 2e0bc7991b66effcf824869e308e7c534412a3fe..8b86305e12901129ff5b466241f34fe1d0743367 100644 (file)
@@ -5,6 +5,10 @@
 
   require_login();
 
+  if (empty($CFG->enableglobalsearch)) {
+    error('Global searching is not enabled.');
+  }
+
   if (!isadmin()) {
     error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
   } //if
index 32300a58b35dbbfe2308e978a5e6417a0d055bb5..04772c5cd0567482047864d482060b7a2faa6f46 100644 (file)
   //only administrators can index the moodle installation, because access to all pages is required
   require_login();
 
+  if (empty($CFG->enableglobalsearch)) {
+    error('Global searching is not enabled.');
+  }
+
   if (!isadmin()) {
     error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
   } //if
index a187fbd6ff5e810e081aeb2c0c491a4a8d9db7e3..913e2ae669b3321f710f182628bd4c15e785b288 100644 (file)
@@ -9,6 +9,10 @@
 
   require_login();
 
+  if (empty($CFG->enableglobalsearch)) {
+    error('Global searching is not enabled.');
+  }
+
   if (!isadmin()) {
     error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
   } //if
index fbefcfa7552f05d87f7d158d364ccb3fe9b179b3..6667201e90e33afb9bb6db968cb0b6121d0e4a29 100644 (file)
   require_once('../config.php');
   require_once("$CFG->dirroot/search/lib.php");
 
+  if ($CFG->forcelogin) {
+    require_login();
+  }
+
+  if (empty($CFG->enableglobalsearch)) {
+    error('Global searching is not enabled.');
+  }
+
   $adv = new Object();
 
   //check for php5, but don't die yet (see line 52)
index 948c8b0521abe779ddc7629441c8d61ef142eac3..5e391b164f671a6f238c44b2ef05fe95d39496b3 100644 (file)
@@ -7,6 +7,14 @@
   require_once('../config.php');
   require_once("$CFG->dirroot/search/lib.php");
 
+  if ($CFG->forcelogin) {
+    require_login();
+  }
+
+  if (empty($CFG->enableglobalsearch)) {
+    error('Global searching is not enabled.');
+  }
+
   //check for php5, but don't die yet
   if ($check = search_check_php5()) {
     require_once("$CFG->dirroot/search/indexlib.php");
index 927f9d517b894cab5aa5a922a955f7553d04930e..b0a1609c6a52aafaa4b7f82851baefff3efa8dd2 100644 (file)
 
   require_login();
 
+  if (empty($CFG->enableglobalsearch)) {
+    error('Global searching is not enabled.');
+  }
+
   if (!isadmin()) {
     error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
   } //if
index 0217afd3e4027b0ef42a882e54be597ab0ecf191..8282a62bcdf0e48ce130178d6ec8c589e069b467 100644 (file)
@@ -5,6 +5,10 @@
 
   require_login();
 
+  if (empty($CFG->enableglobalsearch)) {
+    error('Global searching is not enabled.');
+  }
+
   if (!isadmin()) {
     error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
   } //if