]> git.mjollnir.org Git - moodle.git/commitdiff
choosecoursefile file selection fixed
authorskodak <skodak>
Thu, 11 Jan 2007 11:33:44 +0000 (11:33 +0000)
committerskodak <skodak>
Thu, 11 Jan 2007 11:33:44 +0000 (11:33 +0000)
lib/form/choosecoursefile.php

index fb62b8ff8397b22e7d9b3e84fb2a83945c167417..dabb5ac29eb73d4a43e380ae68ee30a5f4c79fbf 100644 (file)
@@ -75,7 +75,9 @@ class MoodleQuickForm_choosecoursefile extends MoodleQuickForm_group
         } else {
             $courseid=$COURSE->id;
         }
-        $url="/files/index.php?id=$courseid&choose=id_".$this->getElementName(0);
+        // first find out the text field id - this is a bit hacky, is there a better way?
+        $choose = 'id_'.str_replace(array('[', ']'), array('_', ''), $this->getElementName(0));
+        $url="/files/index.php?id=$courseid&choose=".$choose;
 
         if ($this->_options['options'] == 'none') {
             $options = 'menubar=0,location=0,scrollbars,resizable,width='. $this->_options['width'] .',height='. $this->_options['height'];