]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14678 syntax problems
authorskodak <skodak>
Sat, 3 May 2008 21:43:36 +0000 (21:43 +0000)
committerskodak <skodak>
Sat, 3 May 2008 21:43:36 +0000 (21:43 +0000)
search/documents/physical_xml.php

index 0fde56cb064dedc4977321f0c8c528f3a3abdb83..85f9ba8f721ec8528806d99740aafc2bea67047f 100644 (file)
 * @param object $resource
 * @uses CFG, USER
 */
-function get_text_for_indexing_xml(&$resource){
+function get_text_for_indexing_xml(&$resource, $directfile = ''){
     global $CFG, $USER;
     
     // SECURITY : do not allow non admin execute anything on system !!
     if (!isadmin($USER->id)) return;
 
     // just get text
-    $text = implode('', file("{$CFG->dataroot}/{$resource->course}/($resource->reference)"));
+    if ($directfile == ''){
+        $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
+    } else {
+        $text = implode('', file("{$CFG->dataroot}/{$directfile}"));
+    }
 
     // filter out all xml tags
     $text = preg_replace("/<[^>]*>/", ' ', $text);