mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Another setting to allow a default URL in webpage and weblink
This commit is contained in:
parent
6e980cfa80
commit
5e91dd3f36
4 changed files with 21 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
$string['addresource'] = 'Add resource';
|
$string['addresource'] = 'Add resource';
|
||||||
$string['chooseafile'] = 'Choose or upload a file';
|
$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['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['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';
|
$string['editingaresource'] = 'Editing a resource';
|
||||||
|
|
|
@ -19,6 +19,15 @@
|
||||||
<?php print_string("configwebsearch", "resource") ?>
|
<?php print_string("configwebsearch", "resource") ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</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>
|
<tr>
|
||||||
<td colspan=3 align=center>
|
<td colspan=3 align=center>
|
||||||
<input type="submit" value="<?php print_string("savechanges") ?>"></td>
|
<input type="submit" value="<?php print_string("savechanges") ?>"></td>
|
||||||
|
|
|
@ -70,6 +70,9 @@
|
||||||
case WEBPAGE:
|
case WEBPAGE:
|
||||||
$strexampleurl = get_string("exampleurl", "resource");
|
$strexampleurl = get_string("exampleurl", "resource");
|
||||||
$strsearch = get_string("search");
|
$strsearch = get_string("search");
|
||||||
|
if (empty($form->reference)) {
|
||||||
|
$form->reference = $CFG->resource_defaulturl;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<td align="right" nowrap>
|
<td align="right" nowrap>
|
||||||
|
@ -103,6 +106,10 @@
|
||||||
$strnewwindowopen = get_string("newwindowopen", "resource");
|
$strnewwindowopen = get_string("newwindowopen", "resource");
|
||||||
$strsearch = get_string("search");
|
$strsearch = get_string("search");
|
||||||
|
|
||||||
|
if (empty($form->reference)) {
|
||||||
|
$form->reference = $CFG->resource_defaulturl;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($RESOURCE_WINDOW_OPTIONS as $optionname) {
|
foreach ($RESOURCE_WINDOW_OPTIONS as $optionname) {
|
||||||
$stringname = "str$optionname";
|
$stringname = "str$optionname";
|
||||||
$$stringname = get_string("new$optionname", "resource");
|
$$stringname = get_string("new$optionname", "resource");
|
||||||
|
|
|
@ -26,6 +26,10 @@ if (!isset($CFG->resource_websearch)) {
|
||||||
set_config("resource_websearch", "http://google.com/");
|
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",
|
$RESOURCE_WINDOW_OPTIONS = array("resizable", "scrollbars", "directories", "location",
|
||||||
"menubar", "toolbar", "status", "height", "width");
|
"menubar", "toolbar", "status", "height", "width");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue