mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General syncback from HEAD branch (2.0)
- Loading branch information
diml
committed
Nov 8, 2007
1 parent
386aed2
commit 603042b
Showing
7 changed files
with
266 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,19 +1,132 @@ | |||
<div style="text-align:center;"> | <div style="text-align:center;"> | ||
<label for="block_search_text">Search label</label> | <table cellspacing="5"> | ||
<input id="block_search_text" type="text" name="block_search_text" value="<?php | <tr> | ||
if(isset($CFG->block_search_text)) { | <td valign="top" align="right"> | ||
p($CFG->block_search_text); | <b><?php print_string('configsearchtext', 'block_search') ?>:</b> | ||
} else { | </td> | ||
p("Search Moodle"); | <td valign="top" align="left"> | ||
} ?>"/><br/> | <input id="block_search_text" type="text" name="block_search_text" value="<?php | ||
|
if(isset($CFG->block_search_text)) { | ||
<label for="block_search_button">Button label</label> | p($CFG->block_search_text); | ||
<input id="block_search_button" type="text" name="block_search_button" value="<?php | } else { | ||
if(isset($CFG->block_search_button)) { | p(get_string('searchmoodle', 'block_search')); | ||
p($CFG->block_search_button); | } ?>"/><br/> | ||
} else { | </td> | ||
p("Go"); | </tr> | ||
} ?>"/><br/><br/> | <tr> | ||
|
<td valign="top" align="right"> | ||
<input type="submit" value="<?php print_string('savechanges'); ?>" /> | <b><?php print_string('configbuttonlabel', 'block_search') ?>:</b> | ||
</td> | |||
<td valign="top" align="left"> | |||
<input id="block_search_button" type="text" name="block_search_button" value="<?php | |||
if(isset($CFG->block_search_button)) { | |||
p($CFG->block_search_button); | |||
} else { | |||
p(get_string('go', 'block_search')); | |||
} ?>"/><br/><br/> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td valign="top" align="right"> | |||
<b><?php print_string('configenablefileindexing', 'block_search') ?>:</b> | |||
</td> | |||
<td valign="top" align="left"> | |||
<input id="block_enable_file_indexing" type="radio" name="block_search_enable_file_indexing" value="1" <?php | |||
if(isset($CFG->block_search_enable_file_indexing) && $CFG->block_search_enable_file_indexing) { | |||
echo " checked=\"checked\" "; | |||
} ?> /> <?php print_string('yes') ?> - | |||
<input id="block_search_enable_file_indexing" type="radio" name="block_search_enable_file_indexing" value="0" <?php | |||
if(!isset($CFG->block_search_enable_file_indexing) || !$CFG->block_search_enable_file_indexing) { | |||
echo " checked=\"checked\" "; | |||
} ?> /> <?php print_string('no') ?> | |||
<br/><br/> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td valign="top" align="right"> | |||
<b><?php print_string('configfiletypes', 'block_search') ?>:</b> | |||
</td> | |||
<td valign="top" align="left"> | |||
<input id="block_search_filetypes" type="text" name="block_search_filetypes" value="<?php | |||
if(isset($CFG->block_search_filetypes)) { | |||
p($CFG->block_search_filetypes); | |||
} else { | |||
p("PDF,TXT,HTML,PPT,XML,DOC,HTM"); | |||
} ?>"/><br/><br/> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td valign="top" align="right"> | |||
<b><?php print_string('configpdftotextcmd', 'block_search') ?>:</b> | |||
</td> | |||
<td valign="top" align="left"> | |||
<input id="block_search_pdf_to_text_cmd" type="text" size="60" name="block_search_pdf_to_text_cmd" value="<?php | |||
if(isset($CFG->block_search_pdf_to_text_cmd)) { | |||
p($CFG->block_search_pdf_to_text_cmd); | |||
} else { | |||
$encoding = ($CFG->unicodedb) ? "-enc UTF-8" : "-enc ISO-8859-1" ; | |||
if ($CFG->ostype == 'WINDOWS'){ | |||
p("lib/xpdf/win32/pdftotext.exe -eol dos $encoding -q"); | |||
} | |||
else{ | |||
p("lib/xpdf/linux/pdftotext $encoding -eol unix -q"); | |||
} | |||
} ?>"/><br/><br/> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td valign="top" align="right"> | |||
<b><?php print_string('configwordtotextcmd', 'block_search') ?>:</b> | |||
</td> | |||
<td valign="top" align="left"> | |||
<input id="block_search_word_to_text_cmd" type="text" size="60" name="block_search_word_to_text_cmd" value="<?php | |||
if(isset($CFG->block_search_word_to_text_cmd)) { | |||
p($CFG->block_search_word_to_text_cmd); | |||
} else { | |||
if ($CFG->ostype == 'WINDOWS'){ | |||
p("lib/antiword/win32/antiword/antiword.exe "); | |||
} | |||
else{ | |||
p("lib/antiword/linux/usr/bin/antiword"); | |||
} | |||
} ?>"/><br/><br/> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td valign="top" align="right"> | |||
<b><?php print_string('configwordtotextenv', 'block_search') ?>:</b> | |||
</td> | |||
<td valign="top" align="left"> | |||
<input id="block_search_word_to_text_env" type="text" size="60" name="block_search_word_to_text_env" value="<?php | |||
if(isset($CFG->block_search_word_to_text_env)) { | |||
echo stripslashes($CFG->block_search_word_to_text_env); | |||
} else { | |||
if ($CFG->ostype == 'WINDOWS'){ | |||
p("HOME={$CFG->dirroot}\\lib\\antiword\\win32"); | |||
} | |||
else{ | |||
p("ANTIWORDHOME={$CFG->dirroot}/lib/antiword/linux/usr/share/antiword"); | |||
} | |||
} ?>"/><br/><br/> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td valign="top" align="right"> | |||
<b><?php print_string('configlimitindexbody', 'block_search') ?>:</b> | |||
</td> | |||
<td valign="top" align="left"> | |||
<input id="block_search_limit_index_body" type="text" size="8" name="block_search_limit_index_body" value="<?php | |||
if(isset($CFG->block_search_limit_index_body)) { | |||
p($CFG->block_search_limit_index_body); | |||
} else { | |||
p(''); | |||
} ?>"/> <?php print_string('bytes', 'block_search') ?><br/><br/> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td valign="top" align="right" colspan="2"> | |||
<input type="submit" value="<?php print_string('savechanges'); ?>" /> | |||
</td> | |||
</tr> | |||
</table> | |||
</div> | </div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,30 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<XMLDB PATH="blocks/search/db" VERSION="20070811" COMMENT="XMLDB file for Moodle search engine" | |||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd" | |||
> | |||
<TABLES> | |||
<TABLE NAME="block_search_documents" COMMENT="table to store search index backups"> | |||
<FIELDS> | |||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="docid"/> | |||
<FIELD NAME="docid" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="doctype"/> | |||
<FIELD NAME="doctype" TYPE="char" LENGTH="32" NOTNULL="true" DEFAULT="none" SEQUENCE="false" ENUM="false" PREVIOUS="docid" NEXT="itemtype"/> | |||
<FIELD NAME="itemtype" TYPE="char" LENGTH="32" NOTNULL="true" DEFAULT="standard" SEQUENCE="false" ENUM="false" PREVIOUS="doctype" NEXT="title"/> | |||
<FIELD NAME="title" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="itemtype" NEXT="url"/> | |||
<FIELD NAME="url" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="title" NEXT="docdate"/> | |||
<FIELD NAME="docdate" TYPE="datetime" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="url" NEXT="updated"/> | |||
<FIELD NAME="updated" TYPE="datetime" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="docdate" NEXT="courseid"/> | |||
<FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="updated" NEXT="groupid"/> | |||
<FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid"/> | |||
</FIELDS> | |||
<KEYS> | |||
<KEY NAME="primary" TYPE="primary" FIELDS="id" /> | |||
</KEYS> | |||
<INDEXES> | |||
<INDEX NAME="mdl_search_docid" UNIQUE="false" FIELDS="docid" NEXT="mdl_search_doctype"/> | |||
<INDEX NAME="mdl_search_doctype" UNIQUE="false" FIELDS="doctype" PREVIOUS="mdl_search_docid" NEXT="mdl_search_itemtype"/> | |||
<INDEX NAME="mdl_search_itemtype" UNIQUE="false" FIELDS="itemtype" PREVIOUS="mdl_search_doctype"/> | |||
</INDEXES> | |||
</TABLE> | |||
</TABLES> | |||
</XMLDB> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters