Merge branch 'MDL-38542_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE
[moodle.git] / mod / page / settings.php
blob3c10b23e46ad0119461817f38f17953a3d0b804f
1 <?php
3 // This file is part of Moodle - http://moodle.org/
4 //
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.
9 //
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/>.
18 /**
19 * Page module admin settings and defaults
21 * @package mod
22 * @subpackage page
23 * @copyright 2009 Petr Skoda (http://skodak.org)
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
27 defined('MOODLE_INTERNAL') || die;
29 if ($ADMIN->fulltree) {
30 require_once("$CFG->libdir/resourcelib.php");
32 $displayoptions = resourcelib_get_displayoptions(array(RESOURCELIB_DISPLAY_OPEN, RESOURCELIB_DISPLAY_POPUP));
33 $defaultdisplayoptions = array(RESOURCELIB_DISPLAY_OPEN);
35 //--- general settings -----------------------------------------------------------------------------------
36 $settings->add(new admin_setting_configcheckbox('page/requiremodintro',
37 get_string('requiremodintro', 'admin'), get_string('configrequiremodintro', 'admin'), 1));
38 $settings->add(new admin_setting_configmultiselect('page/displayoptions',
39 get_string('displayoptions', 'page'), get_string('configdisplayoptions', 'page'),
40 $defaultdisplayoptions, $displayoptions));
42 //--- modedit defaults -----------------------------------------------------------------------------------
43 $settings->add(new admin_setting_heading('pagemodeditdefaults', get_string('modeditdefaults', 'admin'), get_string('condifmodeditdefaults', 'admin')));
45 $settings->add(new admin_setting_configcheckbox_with_advanced('page/printheading',
46 get_string('printheading', 'page'), get_string('printheadingexplain', 'page'),
47 array('value'=>1, 'adv'=>false)));
48 $settings->add(new admin_setting_configcheckbox_with_advanced('page/printintro',
49 get_string('printintro', 'page'), get_string('printintroexplain', 'page'),
50 array('value'=>0, 'adv'=>false)));
51 $settings->add(new admin_setting_configselect_with_advanced('page/display',
52 get_string('displayselect', 'page'), get_string('displayselectexplain', 'page'),
53 array('value'=>RESOURCELIB_DISPLAY_OPEN, 'adv'=>true), $displayoptions));
54 $settings->add(new admin_setting_configtext_with_advanced('page/popupwidth',
55 get_string('popupwidth', 'page'), get_string('popupwidthexplain', 'page'),
56 array('value'=>620, 'adv'=>true), PARAM_INT, 7));
57 $settings->add(new admin_setting_configtext_with_advanced('page/popupheight',
58 get_string('popupheight', 'page'), get_string('popupheightexplain', 'page'),
59 array('value'=>450, 'adv'=>true), PARAM_INT, 7));