diff --git a/blocks/search/README.txt b/blocks/search/README.txt new file mode 100644 index 0000000000000..48dfb9f4679cd --- /dev/null +++ b/blocks/search/README.txt @@ -0,0 +1,15 @@ +This block is a revamping of the Google Summer Of Code Project (2006) on Global Search engine +for Moodle. New block version is completed and internationalized according to Moodle multilengual support. + +This block instanciates a startup database model for the search engine. + +## Installing + +You need installing the following elements in order the global search to be available : + +1. The global search bloc (this block) +2. update the /search root package from CVS +3. The antiword libraries +4. The xpdf libraries + +Both last libraries are provided as a patch called "global_search_libraries" in the contrib section. \ No newline at end of file diff --git a/blocks/search/block_search.php b/blocks/search/block_search.php index 286b258eb7942..f75fa1668ef65 100644 --- a/blocks/search/block_search.php +++ b/blocks/search/block_search.php @@ -14,8 +14,9 @@ class block_search extends block_base { function init() { - $this->title = "Global Search"; //get_string() - $this->version = 2006062500; + $this->title = get_string('blockname', 'block_search'); + $this->cron = 1; + $this->version = 2007081100; } //init // only one instance of this block is required @@ -45,8 +46,8 @@ function get_content() { //lazy check for the moment if (check_php_version("5.0.0")) { //fetch values if defined in admin, otherwise use defaults - $label = (isset($CFG->block_search_text)) ? $CFG->block_search_text : "Search Moodle"; - $button = (isset($CFG->block_search_button)) ? $CFG->block_search_button : "Go"; + $label = (!empty($CFG->block_search_text)) ? $CFG->block_search_text : get_string('searchmoodle', 'block_search'); + $button = (!empty($CFG->block_search_button)) ? $CFG->block_search_button : get_string('go', 'block_search'); //basic search form $this->content->text = @@ -68,7 +69,17 @@ function get_content() { function specialisation() { //empty! } //specialisation + + /** + * wraps up to search engine cron + * + */ + function cron(){ + global $CFG; + + include($CFG->dirroot.'/search/cron.php'); + } } //block_search -?> \ No newline at end of file +?> diff --git a/blocks/search/config_global.html b/blocks/search/config_global.html index 4f69a7da169b7..d60de30daaf85 100644 --- a/blocks/search/config_global.html +++ b/blocks/search/config_global.html @@ -1,19 +1,132 @@
+ : + | +
+ + |
+
+ : + | +
+ + |
+
+ : + | +
+ block_search_enable_file_indexing) && $CFG->block_search_enable_file_indexing) {
+ echo " checked=\"checked\" ";
+ } ?> /> -
+ block_search_enable_file_indexing) || !$CFG->block_search_enable_file_indexing) {
+ echo " checked=\"checked\" ";
+ } ?> />
+ + |
+
+ : + | +
+ "/> + |
+
+ : + | +
+ ostype == 'WINDOWS'){
+ p("lib/xpdf/win32/pdftotext.exe -eol dos $encoding -q");
+ }
+ else{
+ p("lib/xpdf/linux/pdftotext $encoding -eol unix -q");
+ }
+ } ?>"/> + |
+
+ : + | +
+ "/> + |
+
+ : + | +
+ dirroot}\\lib\\antiword\\win32");
+ }
+ else{
+ p("ANTIWORDHOME={$CFG->dirroot}/lib/antiword/linux/usr/share/antiword");
+ }
+ } ?>"/> + |
+
+ : + | +
+ + |
+
+ + | +