diff --git a/lib/editor/popups/insert_image_std.php b/lib/editor/popups/insert_image_std.php index 8e3ad1c2cd8..352d98d4820 100644 --- a/lib/editor/popups/insert_image_std.php +++ b/lib/editor/popups/insert_image_std.php @@ -2,12 +2,12 @@ include("../../../config.php"); - require_variable($id); + require_variable($id); if (!$course = get_record("course", "id", $id)) { $course->fullname = ""; // Just to keep display happy, though browsing may fail } - + ?> @@ -23,6 +23,15 @@ var preview_window = null; function Init() { __dlg_init(); + var param = window.dialogArguments; + if (param) { + var alt = param["f_url"].substring(param["f_url"].lastIndexOf('/') + 1); + document.getElementById("f_url").value = param["f_url"]; + document.getElementById("f_alt").value = param["f_alt"] ? param["f_alt"] : alt; + document.getElementById("f_border").value = parseInt(param["f_border"] || 0); + document.getElementById("f_vert").value = param["f_vert"] != -1 ? param["f_vert"] : 0; + document.getElementById("f_horiz").value = param["f_horiz"] != -1 ? param["f_horiz"] : 0; + } document.getElementById("f_url").focus(); };