3 * Global Search Engine for Moodle
4 * add-on 1.8+ : Valery Fremaux [valery.fremaux@club-internet.fr]
7 * this is a format handler for getting text out of a proprietary binary format
8 * so it can be indexed by Lucene search engine
11 function get_text_for_indexing_xml(&$resource){
14 // SECURITY : do not allow non admin execute anything on system !!
15 if (!isadmin($USER->id
)) return;
18 $text = implode('', file("{$CFG->dataroot}/{$resource->course}/($resource->reference)"));
20 // filter out all xml tags
21 $text = preg_replace("/<[^>]*>/", ' ', $text);
23 if (!empty($CFG->block_search_limit_index_body
)){
24 $text = shorten($text, $CFG->block_search_limit_index_body
);