3 // This file is part of Moodle - http://moodle.org/
5 // Moodle is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // Moodle is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
19 * Resource module admin settings and defaults
21 * @package mod_resource
22 * @copyright 2009 Petr Skoda {@link http://skodak.org}
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26 defined('MOODLE_INTERNAL') ||
die;
28 if ($ADMIN->fulltree
) {
29 require_once("$CFG->libdir/resourcelib.php");
31 $displayoptions = resourcelib_get_displayoptions(array(RESOURCELIB_DISPLAY_AUTO
,
32 RESOURCELIB_DISPLAY_EMBED
,
33 RESOURCELIB_DISPLAY_FRAME
,
34 RESOURCELIB_DISPLAY_DOWNLOAD
,
35 RESOURCELIB_DISPLAY_OPEN
,
36 RESOURCELIB_DISPLAY_NEW
,
37 RESOURCELIB_DISPLAY_POPUP
,
39 $defaultdisplayoptions = array(RESOURCELIB_DISPLAY_AUTO
,
40 RESOURCELIB_DISPLAY_EMBED
,
41 RESOURCELIB_DISPLAY_DOWNLOAD
,
42 RESOURCELIB_DISPLAY_OPEN
,
43 RESOURCELIB_DISPLAY_POPUP
,
46 //--- general settings -----------------------------------------------------------------------------------
47 $settings->add(new admin_setting_configtext('resource/framesize',
48 get_string('framesize', 'resource'), get_string('configframesize', 'resource'), 130, PARAM_INT
));
49 $settings->add(new admin_setting_configcheckbox('resource/requiremodintro',
50 get_string('requiremodintro', 'admin'), get_string('configrequiremodintro', 'admin'), 1));
51 $settings->add(new admin_setting_configmultiselect('resource/displayoptions',
52 get_string('displayoptions', 'resource'), get_string('configdisplayoptions', 'resource'),
53 $defaultdisplayoptions, $displayoptions));
55 //--- modedit defaults -----------------------------------------------------------------------------------
56 $settings->add(new admin_setting_heading('resourcemodeditdefaults', get_string('modeditdefaults', 'admin'), get_string('condifmodeditdefaults', 'admin')));
58 $settings->add(new admin_setting_configcheckbox('resource/printintro',
59 get_string('printintro', 'resource'), get_string('printintroexplain', 'resource'), 1));
60 $settings->add(new admin_setting_configselect('resource/display',
61 get_string('displayselect', 'resource'), get_string('displayselectexplain', 'resource'), RESOURCELIB_DISPLAY_AUTO
,
63 $settings->add(new admin_setting_configcheckbox('resource/showsize',
64 get_string('showsize', 'resource'), get_string('showsize_desc', 'resource'), 0));
65 $settings->add(new admin_setting_configcheckbox('resource/showtype',
66 get_string('showtype', 'resource'), get_string('showtype_desc', 'resource'), 0));
67 $settings->add(new admin_setting_configtext('resource/popupwidth',
68 get_string('popupwidth', 'resource'), get_string('popupwidthexplain', 'resource'), 620, PARAM_INT
, 7));
69 $settings->add(new admin_setting_configtext('resource/popupheight',
70 get_string('popupheight', 'resource'), get_string('popupheightexplain', 'resource'), 450, PARAM_INT
, 7));
71 $options = array('0' => get_string('none'), '1' => get_string('allfiles'), '2' => get_string('htmlfilesonly'));
72 $settings->add(new admin_setting_configselect('resource/filterfiles',
73 get_string('filterfiles', 'resource'), get_string('filterfilesexplain', 'resource'), 0, $options));