Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / search / documents / physical_txt.php
blob1ef3fd8d379eec30f3e30f21844bc3a99de425cb
1 <?php
2 /**
3 * Global Search Engine for Moodle
4 * add-on 1.8+ : Valery Fremaux [valery.fremaux@club-internet.fr]
5 * 2007/08/02
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
9 */
11 function get_text_for_indexing_txt(&$resource){
12 global $CFG, $USER;
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);
22 return $text;