Added two new site-wide settings for the resource module so that the

admin can deternine the default state of the collapsible panes on the
resource creation screen.
This commit is contained in:
moodler
2004-08-28 16:29:20 +00:00
parent e8ef939008
commit b4ad8b3d24
6 changed files with 43 additions and 4 deletions
+3
View File
@@ -7,6 +7,7 @@ $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['configfilterexternalpages'] = 'Enabling this setting will cause all external resources (web pages, uploaded HTML files) to be processed by the currently defined site filters (such as glossary autolinks, for example). Turning this option on may cause your course pages to slow down significantly - use with caution and only if you really need it.';
$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['configparametersettings'] = 'This sets the default value for the parameter settings pane in the form when adding some new resources. After the first time, this becomes an individual user preference.';
$string['configpopup'] = 'When adding a new resource which is able to be shown in a popup window, should this option be enabled by default?';
$string['configpopupdirectories'] = 'Should popup windows show directory links by default?';
$string['configpopupheight'] = 'What height should be the default height for new popup windows?';
@@ -17,7 +18,9 @@ $string['configpopupscrollbars'] = 'Should popup windows be scrollable by defaul
$string['configpopupstatus'] = 'Should popup windows show the status bar by default?';
$string['configpopuptoolbar'] = 'Should popup windows show the tool bar by default?';
$string['configpopupwidth'] = 'What width should be the default width for new popup windows?';
$string['configsecretphrase'] = 'This secret phrase is used to produce the encrypted code value that can be sent to some resources as a parameter. The encrypted code is produced by an md5 value of the current_users IP address concatenated with your secret phrase. ie code = md5(IP.secretphrase). This allows the destination resource to verify the connection for extra security.';
$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['configwindowsettings'] = 'This sets the default value for the windows settings pane in the form when adding some new resources. After the first time, this becomes an individual user preference.';
$string['directlink'] = 'Direct link to this file';
$string['directoryinfo'] = 'All the files in the chosen directory will be displayed.';
$string['display'] = 'Display';
+28
View File
@@ -82,6 +82,34 @@
echo "</tr>";
}
?>
<tr valign=top>
<td align=right><p>resource_windowsettings:</td>
<td>
<?php
unset($choices);
$choices["0"] = get_string("hidesettings");
$choices["1"] = get_string("showsettings");
choose_from_menu ($choices, "resource_windowsettings", $CFG->resource_windowsettings, "");
?>
</td>
<td>
<?php print_string("configwindowsettings", "resource") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>resource_parametersettings:</td>
<td>
<?php
unset($choices);
$choices["0"] = get_string("hidesettings");
$choices["1"] = get_string("showsettings");
choose_from_menu ($choices, "resource_parametersettings", $CFG->resource_parametersettings, "");
?>
</td>
<td>
<?php print_string("configparametersettings", "resource") ?>
</td>
</tr>
<tr>
<td colspan=3 align=center>
<input type="submit" value="<?php print_string("savechanges") ?>"></td>
+8
View File
@@ -24,6 +24,14 @@ if (!isset($CFG->resource_popup)) {
set_config("resource_popup", "");
}
if (!isset($CFG->resource_windowsettings)) {
set_config("resource_windowsettings", "0");
}
if (!isset($CFG->resource_parametersettings)) {
set_config("resource_parametersettings", "0");
}
$RESOURCE_WINDOW_OPTIONS = array("resizable", "scrollbars", "directories", "location",
"menubar", "toolbar", "status", "height", "width");
+2 -2
View File
@@ -49,7 +49,7 @@
<td>
<input type="button" value="hide settings" id="windowsettingsbutton" onClick="javascript: return showhide('windowsettings');" />
<input type="hidden" name="windowsettingspref" id="windowsettingspref"
value="<?php echo get_user_preferences('resource_windowsettingspref', 0); ?>" />
value="<?php echo get_user_preferences('resource_windowsettingspref', $CFG->resource_windowsettings); ?>" />
</td>
</tr>
<tr><td colspan="2">
@@ -133,7 +133,7 @@
<td>
<input type="button" value="hide settings" id="parametersettingsbutton" onClick="javascript: return showhide('parametersettings');" />
<input type="hidden" name="parametersettingspref" id="parametersettingspref"
value="<?php echo get_user_preferences('resource_parametersettingspref', 0); ?>" />
value="<?php echo get_user_preferences('resource_parametersettingspref', $CFG->resource_parametersettings); ?>" />
<?php helpbutton("parameters", get_string("parameters", "resource"), "resource", true) ?>
</td>
</tr>
+1 -1
View File
@@ -47,7 +47,7 @@
<td>
<input type="button" value="hide settings" id="windowsettingsbutton" onClick="javascript: return showhide('windowsettings');" />
<input type="hidden" name="windowsettingspref" id="windowsettingspref"
value="<?php echo get_user_preferences('resource_windowsettingspref', 0); ?>" />
value="<?php echo get_user_preferences('resource_windowsettingspref', $CFG->resource_windowsettings); ?>" />
</td>
</tr>
<tr><td colspan="2">
+1 -1
View File
@@ -59,7 +59,7 @@
<td>
<input type="button" value="hide settings" id="windowsettingsbutton" onClick="javascript: return showhide('windowsettings');" />
<input type="hidden" name="windowsettingspref" id="windowsettingspref"
value="<?php echo get_user_preferences('resource_windowsettingspref', 0); ?>" />
value="<?php echo get_user_preferences('resource_windowsettingspref', $CFG->resource_windowsettings); ?>" />
</td>
</tr>
<tr><td colspan="2">