From 7dc22930f75c47a5dce2e3ca9b4c82e9d95b3e68 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 11 Jan 2007 11:33:44 +0000 Subject: [PATCH] choosecoursefile file selection fixed --- lib/form/choosecoursefile.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/form/choosecoursefile.php b/lib/form/choosecoursefile.php index fb62b8ff83..dabb5ac29e 100644 --- a/lib/form/choosecoursefile.php +++ b/lib/form/choosecoursefile.php @@ -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']; -- 2.39.5