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_txt(&$resource){
14 // SECURITY : do not allow non admin execute anything on system !!
15 if (!isadmin($USER->id
)) return;
17 // just try to get text empirically from ppt binary flow
18 $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
19 if (!empty($CFG->block_search_limit_index_body
)){
20 $text = shorten($text, $CFG->block_search_limit_index_body
);