mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 00:42:54 +02:00
MDL-13766, fix for filepicker in moodleform
This commit is contained in:
parent
4b844d63ef
commit
77a2e1461b
@ -47,22 +47,22 @@ class MoodleQuickForm_filepicker extends HTML_QuickForm_button
|
||||
$strsaved = get_string('filesaved', 'repository');
|
||||
$itemid = time();
|
||||
$ret = get_repository_client();
|
||||
$str = $this->_getTabs();
|
||||
$str .= '<input type="hidden" value="'.$itemid.'" name="repo_attachment" id="repo_value" />';
|
||||
$suffix = $ret['suffix'];
|
||||
$str = $this->_getTabs();
|
||||
$str .= '<input type="hidden" value="'.$itemid.'" name="repo_attachment" id="repo_value_'.$suffix.'" />';
|
||||
$str .= <<<EOD
|
||||
<script type="text/javascript">
|
||||
function updatefile(){
|
||||
alert('$strsaved');
|
||||
document.getElementById('repo_info').innerHTML = '$strsaved';
|
||||
document.getElementById('repo_info_$suffix').innerHTML = '$strsaved';
|
||||
}
|
||||
function callpicker_$suffix(){
|
||||
var el=document.getElementById('repo_value');
|
||||
var el=document.getElementById('repo_value_$suffix');
|
||||
openpicker_$suffix({"env":"form", 'itemid': $itemid, 'target':el, 'callback':updatefile})
|
||||
}
|
||||
</script>
|
||||
EOD;
|
||||
$str .= '<input' . $this->_getAttrString($this->_attributes) . ' onclick=\'callpicker_'.$suffix.'()\' />'.'<span id="repo_info" style="color:green"></span>'.$ret['html'].$ret['js'];
|
||||
$str .= '<input' . $this->_getAttrString($this->_attributes) . ' onclick=\'callpicker_'.$suffix.'()\' />'.'<span id="repo_info_'.$suffix.'" style="color:green"></span>'.$ret['html'].$ret['js'];
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user