Updated the 19 build version to 20080928
[moodle.git] / mod / resource / settings.php
blob242f49389f777243dcdbdfd3b3f688c0a0cb5601
1 <?php //$Id$
3 require_once($CFG->dirroot.'/mod/resource/lib.php');
5 global $RESOURCE_WINDOW_OPTIONS; // make sure we have the pesky global
7 $checkedyesno = array(''=>get_string('no'), 'checked'=>get_string('yes')); // not nice at all
9 $settings->add(new admin_setting_configtext('resource_framesize', get_string('framesize', 'resource'),
10 get_string('configframesize', 'resource'), 130, PARAM_INT));
12 $settings->add(new admin_setting_configtext('resource_websearch', get_string('websearchdefault', 'resource'),
13 get_string('configwebsearch', 'resource'), 'http://google.com/'));
15 $settings->add(new admin_setting_configtext('resource_defaulturl', get_string('resourcedefaulturl', 'resource'),
16 get_string('configdefaulturl', 'resource'), 'http://'));
18 $settings->add(new admin_setting_configpasswordunmask('resource_secretphrase', get_string('password'),
19 get_string('configsecretphrase', 'resource'), random_string(20)));
21 $settings->add(new admin_setting_configcheckbox('resource_allowlocalfiles', get_string('allowlocalfiles', 'resource'),
22 get_string('configallowlocalfiles', 'resource'), 0));
24 $woptions = array('' => get_string('pagewindow', 'resource'), 'checked' => get_string('newwindow', 'resource'));
25 $settings->add(new admin_setting_configselect('resource_popup', get_string('display', 'resource'),
26 get_string('configpopup', 'resource'), '', $woptions));
28 foreach ($RESOURCE_WINDOW_OPTIONS as $optionname) {
29 $popupoption = "resource_popup$optionname";
30 if ($popupoption == 'resource_popupheight') {
31 $settings->add(new admin_setting_configtext('resource_popupheight', get_string('newheight', 'resource'),
32 get_string('configpopupheight', 'resource'), 450, PARAM_INT));
33 } else if ($popupoption == 'resource_popupwidth') {
34 $settings->add(new admin_setting_configtext('resource_popupwidth', get_string('newwidth', 'resource'),
35 get_string('configpopupwidth', 'resource'), 620, PARAM_INT));
36 } else {
37 $settings->add(new admin_setting_configselect($popupoption, get_string('new'.$optionname, 'resource'),
38 get_string('configpopup'.$optionname, 'resource'), 'checked', $checkedyesno));
42 $settings->add(new admin_setting_configcheckbox('resource_autofilerename', get_string('autofilerename', 'resource'),
43 get_string('configautofilerenamesettings', 'resource'), 1));
45 $settings->add(new admin_setting_configcheckbox('resource_blockdeletingfile', get_string('blockdeletingfile', 'resource'),
46 get_string('configblockdeletingfilesettings', 'resource'), 1));