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 * Page module admin settings and defaults
22 * @copyright 2009 Petr Skoda (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_OPEN
, RESOURCELIB_DISPLAY_POPUP
));
32 $defaultdisplayoptions = array(RESOURCELIB_DISPLAY_OPEN
);
34 //--- general settings -----------------------------------------------------------------------------------
35 $settings->add(new admin_setting_configcheckbox('page/requiremodintro',
36 get_string('requiremodintro', 'admin'), get_string('configrequiremodintro', 'admin'), 1));
37 $settings->add(new admin_setting_configmultiselect('page/displayoptions',
38 get_string('displayoptions', 'page'), get_string('configdisplayoptions', 'page'),
39 $defaultdisplayoptions, $displayoptions));
41 //--- modedit defaults -----------------------------------------------------------------------------------
42 $settings->add(new admin_setting_heading('pagemodeditdefaults', get_string('modeditdefaults', 'admin'), get_string('condifmodeditdefaults', 'admin')));
44 $settings->add(new admin_setting_configcheckbox('page/printheading',
45 get_string('printheading', 'page'), get_string('printheadingexplain', 'page'), 1));
46 $settings->add(new admin_setting_configcheckbox('page/printintro',
47 get_string('printintro', 'page'), get_string('printintroexplain', 'page'), 0));
48 $settings->add(new admin_setting_configselect('page/display',
49 get_string('displayselect', 'page'), get_string('displayselectexplain', 'page'), RESOURCELIB_DISPLAY_OPEN
, $displayoptions));
50 $settings->add(new admin_setting_configtext('page/popupwidth',
51 get_string('popupwidth', 'page'), get_string('popupwidthexplain', 'page'), 620, PARAM_INT
, 7));
52 $settings->add(new admin_setting_configtext('page/popupheight',
53 get_string('popupheight', 'page'), get_string('popupheightexplain', 'page'), 450, PARAM_INT
, 7));