]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13766, mulit-filepicker in htmleditor worked.
authordongsheng <dongsheng>
Tue, 5 Aug 2008 08:12:21 +0000 (08:12 +0000)
committerdongsheng <dongsheng>
Tue, 5 Aug 2008 08:12:21 +0000 (08:12 +0000)
lib/editor/tinymce.js.php
lib/javascript.php
lib/weblib.php
repository/lib.php

index 6650b48a30990751fb05a2d51347e8e523129568..d60d156387aae273eaa545e28c50a139cfdd6fe0 100644 (file)
@@ -205,6 +205,12 @@ $output .= <<<EOF
             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';
index b15a0ed44d42f8754d783b4da390e0801a962786..12656abda63b6af18c4865e8bdb426d74cb7a299 100644 (file)
@@ -123,5 +123,6 @@ function getElementsByClassName(oElm, strTagName, oClassNames){
        }
        return (arrReturnElements)
 }
+var id2suffix = {};
 //]]>
 </script>
index 80e37bf27b399c70f8153921db210e643daa82e5..f5faac4d6f861401fd3d39295670fa062a04c933 100644 (file)
@@ -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()).'\');
index adc63ce102a907badb27cb32b4c6bf4856fd345b..83e9d264075fbb36037c667f0c4464926e1d0e63 100644 (file)
@@ -663,7 +663,7 @@ function get_repository_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;
             }