]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14741:
authorscyrma <scyrma>
Thu, 3 Jul 2008 07:12:03 +0000 (07:12 +0000)
committerscyrma <scyrma>
Thu, 3 Jul 2008 07:12:03 +0000 (07:12 +0000)
* use a better name for a variable
* remove extra browse button and simplify code. Fix by Mauno K.

lib/editor/tinymce.js.php
lib/editor/tinymce/jscripts/tiny_mce/plugins/moodlelink/link.php

index 72c63fd97128a5a583e642e5393830919f0fe5a8..6a104003d6407cf91edc01714c67726b44cc8834 100644 (file)
@@ -2,7 +2,7 @@
 
 require_once('../../config.php');
 
-$course = optional_param('course', 0, PARAM_INT);
+$courseid = optional_param('course', 0, PARAM_INT);
 
 /*
  *
@@ -177,7 +177,7 @@ echo <<<EOF
         theme_advanced_buttons3: "media,advhr,emoticons,dragmath,spellchecker,search,code,fullscreen,bullist,numlist,outdent,indent,forecolor,backcolor,link,unlink,anchor,image,charmap,insertlayer,table",
         theme_advanced_buttons3_add: "media,emoticons,charmap,dragmath,search,code,fullscreen",
         theme_advanced_fonts: "Trebuchet=Trebuchet MS,Verdana,Arial,Helvetica,sans-serif;Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;Wingdings=wingdings", 
-        moodleimage_course_id: $course,
+        moodleimage_course_id: $courseid,
         theme_advanced_resize_horizontal: true,
         theme_advanced_resizing: true,
         theme_advanced_toolbar_location : "top",
@@ -198,7 +198,7 @@ echo <<<EOF
     }
     function moodlefilemanager(field_name, url, type, win) {
         tinyMCE.activeEditor.windowManager.open({
-            file: "{$CFG->httpswwwroot}/lib/editor/tinymce/jscripts/tiny_mce/plugins/moodlelink/link.php?id={$course}",
+            file: "{$CFG->httpswwwroot}/lib/editor/tinymce/jscripts/tiny_mce/plugins/moodlelink/link.php?id={$courseid}",
             width: 480,  
             height: 380,
             resizable: "yes",
index 67f9ae7950e447c2ce871319001ff12a25e54021..e36cac5c7c43f1c8b4971ea2af76e4325293da66 100644 (file)
@@ -44,11 +44,6 @@ tinyMCEPopup.onInit.add(FileBrowserDialogue.init, FileBrowserDialogue);
 \r
 //<![CDATA[\r
 \r
-function onCancel() {\r
-  window.close();\r
-  return false;\r
-}\r
-\r
 function checkvalue(elm,formname) {\r
     var el = document.getElementById(elm);\r
     if(!el.value) {\r
@@ -142,7 +137,7 @@ form { margin-bottom: 0px; margin-top: 0px; }
     </table>\r
   </td>\r
   <td>\r
-    <button type="button" name="close" onclick="return onCancel();"><?php print_string("close","editor");?></button>\r
+    <button type="button" name="close" onclick="tinyMCEPopup.close();"><?php print_string("close","editor");?></button>
   </td>\r
   </tr>\r
   </table>\r
@@ -166,8 +161,6 @@ form { margin-bottom: 0px; margin-top: 0px; }
           <input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />\r
           <input type="file" name="userfile" id="userfile" size="35" />\r
           <input name="save" type="submit" id="save" onclick="return checkvalue('userfile','uploader');" value="<?php print_string("upload","editor");?>" />\r
-          \r
-          <input name="save" type="submit" id="save" onclick="return checkvalue('userfile','uploader');" value="Browse" />\r
           </form>\r
           <?php\r
           } else {\r