From 52f1b496201087266346e703ea6f078a0f64fa08 Mon Sep 17 00:00:00 2001 From: moodler Date: Sun, 15 Feb 2004 08:04:33 +0000 Subject: [PATCH] When searching for resources, use button instead of link. --- lib/weblib.php | 19 +++++++++++++++++++ mod/resource/details.php | 18 ++++++------------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 0f6645eac1..0019069266 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -295,6 +295,25 @@ function link_to_popup_window ($url, $name="popup", $linkname="click here", } +function button_to_popup_window ($url, $name="popup", $linkname="click here", + $height=400, $width=500, $title="Popup window", $options="none") { +/// This will create a HTML link that will work on both +/// Javascript and non-javascript browsers. +/// Relies on the Javascript function openpopup in javascript.php +/// $url must be relative to home page eg /mod/survey/stuff.php + + global $CFG; + + if ($options == "none") { + $options = "menubar=0,location=0,scrollbars,resizable,width=$width,height=$height"; + } + $fullscreen = 0; + + echo "\n"; +} + + function close_window_button() { /// Prints a simple button to close a window diff --git a/mod/resource/details.php b/mod/resource/details.php index a67694472b..108e2bce69 100644 --- a/mod/resource/details.php +++ b/mod/resource/details.php @@ -84,10 +84,8 @@ "; - echo "resource_websearch\" ". - "onClick=\"return window.open('$CFG->resource_websearch', 'websearch', 'menubar=1,location=1,directories=1,toolbar=1,scrollbars,resizable,width=800,height=600');\">$strsearch\n"; - echo ""; + echo "resource_websearch', 'websearch', 'menubar=1,location=1,directories=1,toolbar=1,scrollbars,resizable,width=800,height=600');\">\n"; ?> @@ -157,10 +155,8 @@ "; - echo "resource_websearch\" ". - "onClick=\"return window.open('$CFG->resource_websearch', 'websearch', 'menubar=1,location=1,directories=1,toolbar=1,scrollbars,resizable,width=800,height=600');\">$strsearch\n"; - echo ""; + echo "resource_websearch', 'websearch', 'menubar=1,location=1,directories=1,toolbar=1,scrollbars,resizable,width=800,height=600');\">\n"; ?> @@ -269,10 +265,8 @@ reference\"> "; - echo ""; - link_to_popup_window ("/mod/resource/coursefiles.php?id=$course->id", - "coursefiles", $strchooseafile, 500, 750, $strchooseafile); - echo ""; + button_to_popup_window ("/mod/resource/coursefiles.php?id=$course->id", + "coursefiles", $strchooseafile, 500, 750, $strchooseafile); ?> -- 2.39.5