Another setting to allow a default URL in webpage and weblink

This commit is contained in:
moodler 2003-11-26 11:47:51 +00:00
parent 6e980cfa80
commit 5e91dd3f36
4 changed files with 21 additions and 0 deletions

View file

@ -4,6 +4,7 @@
$string['addresource'] = 'Add resource';
$string['chooseafile'] = 'Choose or upload a file';
$string['configdefaulturl'] = 'This value is used to prefill the URL form when creating a new URL-based resource.';
$string['configframesize'] = 'When a web page or an uploaded file is displayed within a frame, this value is the size (in pixels) of the top frame (which contains the navigation).';
$string['configwebsearch'] = 'When adding a URL as a webpage or weblink, this location is offered as a site to help the user search for the URL they want.';
$string['editingaresource'] = 'Editing a resource';

View file

@ -19,6 +19,15 @@
<?php print_string("configwebsearch", "resource") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>resource_defaulturl:</td>
<td>
<input name=resource_defaulturl type=text size=30 value="<?php p($CFG->resource_defaulturl) ?>">
</td>
<td>
<?php print_string("configdefaulturl", "resource") ?>
</td>
</tr>
<tr>
<td colspan=3 align=center>
<input type="submit" value="<?php print_string("savechanges") ?>"></td>

View file

@ -70,6 +70,9 @@
case WEBPAGE:
$strexampleurl = get_string("exampleurl", "resource");
$strsearch = get_string("search");
if (empty($form->reference)) {
$form->reference = $CFG->resource_defaulturl;
}
?>
<tr valign="top">
<td align="right" nowrap>
@ -103,6 +106,10 @@
$strnewwindowopen = get_string("newwindowopen", "resource");
$strsearch = get_string("search");
if (empty($form->reference)) {
$form->reference = $CFG->resource_defaulturl;
}
foreach ($RESOURCE_WINDOW_OPTIONS as $optionname) {
$stringname = "str$optionname";
$$stringname = get_string("new$optionname", "resource");

View file

@ -26,6 +26,10 @@ if (!isset($CFG->resource_websearch)) {
set_config("resource_websearch", "http://google.com/");
}
if (!isset($CFG->resource_defaulturl)) {
set_config("resource_defaulturl", "http://");
}
$RESOURCE_WINDOW_OPTIONS = array("resizable", "scrollbars", "directories", "location",
"menubar", "toolbar", "status", "height", "width");