From c1137f58c7408e2ab6052a501d3329c142467d36 Mon Sep 17 00:00:00 2001 From: julmis Date: Fri, 27 Aug 2004 06:58:53 +0000 Subject: [PATCH] Enabling image edit also in student view (Bug #1792) --- lib/editor/popups/insert_image_std.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/editor/popups/insert_image_std.php b/lib/editor/popups/insert_image_std.php index 8e3ad1c2cd..352d98d482 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(); }; -- 2.39.5