From: moodler Date: Wed, 26 Nov 2003 11:47:51 +0000 (+0000) Subject: Another setting to allow a default URL in webpage and weblink X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5e91dd3f36d5aedc2faa99af6169a044f9fa3621;p=moodle.git Another setting to allow a default URL in webpage and weblink --- diff --git a/lang/en/resource.php b/lang/en/resource.php index e608063774..a41815c8c1 100644 --- a/lang/en/resource.php +++ b/lang/en/resource.php @@ -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'; diff --git a/mod/resource/config.html b/mod/resource/config.html index a9f865d8d8..41b9234e7d 100644 --- a/mod/resource/config.html +++ b/mod/resource/config.html @@ -19,6 +19,15 @@ + +

resource_defaulturl: + + + + + + + "> diff --git a/mod/resource/details.php b/mod/resource/details.php index 9d3e94fe7d..e0b88cf1fc 100644 --- a/mod/resource/details.php +++ b/mod/resource/details.php @@ -70,6 +70,9 @@ case WEBPAGE: $strexampleurl = get_string("exampleurl", "resource"); $strsearch = get_string("search"); + if (empty($form->reference)) { + $form->reference = $CFG->resource_defaulturl; + } ?> @@ -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"); diff --git a/mod/resource/lib.php b/mod/resource/lib.php index 328e8b9010..85b7345d79 100644 --- a/mod/resource/lib.php +++ b/mod/resource/lib.php @@ -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");