Skip to content

Commit

Permalink
MDL-13766, mulit-filepicker in htmleditor worked.
Browse files Browse the repository at this point in the history
  • Loading branch information
dongsheng committed Aug 5, 2008
1 parent 77a2e14 commit 765943e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 6 additions & 0 deletions lib/editor/tinymce.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ function mce_saveOnSubmit(id) {
prevOnSubmit = null;
};
}
function moodlefilemanager(field_name, url, type, win) {
//alert(id2suffix[tinyMCE.selectedInstance.editorId]);
var suffix = id2suffix[tinyMCE.selectedInstance.editorId];
var el = win.document.getElementById(field_name);
eval('openpicker_'+suffix+'({"env":"editor","target":el})');
}
EOF;

$lifetime = '86400';
Expand Down
1 change: 1 addition & 0 deletions lib/javascript.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,6 @@ function getElementsByClassName(oElm, strTagName, oClassNames){
}
return (arrReturnElements)
}
var id2suffix = {};
//]]>
</script>
5 changes: 1 addition & 4 deletions lib/weblib.php
Original file line number Diff line number Diff line change
Expand Up @@ -4878,10 +4878,7 @@ function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $v
$str .= '<div class="textareaicons">';
$str .= '<script type="text/javascript">
//<![CDATA[
function moodlefilemanager(field_name, url, type, win) {
var el = win.document.getElementById(field_name);
openpicker_'.$suffix.'({"env":"editor","target":el});
}
id2suffix[\''.$id.'\']=\''.$suffix.'\';
mce_saveOnSubmit(\''.addslashes_js($id).'\');
document.write(\''.addslashes_js($str_toggle).'\');
document.write(\''.addslashes_js(editorshortcutshelpbutton()).'\');
Expand Down
2 changes: 1 addition & 1 deletion repository/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ function _client(){
_client.download = function(){
var title = document.getElementById('newname-$suffix').value;
var file = document.getElementById('fileurl-$suffix').value;
var itemid = 0;
var itemid = 1;
if(_client.itemid){
itemid = _client.itemid;
}
Expand Down

0 comments on commit 765943e

Please sign in to comment.