}
+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 "<input type=\"button\" name=\"popupwindow\" title=\"$title\" value=\"$linkname ...\" ".
+ "onClick=\"return openpopup('$url', '$name', '$options', $fullscreen);\">\n";
+}
+
+
function close_window_button() {
/// Prints a simple button to close a window
<td>
<input name="reference" size="80" value="<?php p($form->reference) ?>">
<?php
- echo "<font size=\"-1\">";
- echo "<a target=\"websearch\" href=\"$CFG->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</a>\n";
- echo "</font>";
+ echo "<input type=button name=searchbutton value=\"$strsearch ...\" ".
+ "onClick=\"return window.open('$CFG->resource_websearch', 'websearch', 'menubar=1,location=1,directories=1,toolbar=1,scrollbars,resizable,width=800,height=600');\">\n";
?>
</td>
</tr>
<td>
<input name="reference" size="80" value="<?php p($form->reference) ?>">
<?php
- echo "<font size=\"-1\">";
- echo "<a target=\"websearch\" href=\"$CFG->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</a>\n";
- echo "</font>";
+ echo "<input type=button name=searchbutton value=\"$strsearch ...\" ".
+ "onClick=\"return window.open('$CFG->resource_websearch', 'websearch', 'menubar=1,location=1,directories=1,toolbar=1,scrollbars,resizable,width=800,height=600');\">\n";
?>
</td>
</tr>
<td>
<?php
echo "<input name=\"reference\" size=\"50\" value=\"$form->reference\"> ";
- echo "<font size=\"-1\">";
- link_to_popup_window ("/mod/resource/coursefiles.php?id=$course->id",
- "coursefiles", $strchooseafile, 500, 750, $strchooseafile);
- echo "</font>";
+ button_to_popup_window ("/mod/resource/coursefiles.php?id=$course->id",
+ "coursefiles", $strchooseafile, 500, 750, $strchooseafile);
?>
</td>
</tr>