Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/resource/settings.php
Go to the documentation of this file.
00001 <?php
00002 
00003 // This file is part of Moodle - http://moodle.org/
00004 //
00005 // Moodle is free software: you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation, either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // Moodle is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00017 
00027 defined('MOODLE_INTERNAL') || die;
00028 
00029 if ($ADMIN->fulltree) {
00030     require_once("$CFG->libdir/resourcelib.php");
00031 
00032     $displayoptions = resourcelib_get_displayoptions(array(RESOURCELIB_DISPLAY_AUTO,
00033                                                            RESOURCELIB_DISPLAY_EMBED,
00034                                                            RESOURCELIB_DISPLAY_FRAME,
00035                                                            RESOURCELIB_DISPLAY_DOWNLOAD,
00036                                                            RESOURCELIB_DISPLAY_OPEN,
00037                                                            RESOURCELIB_DISPLAY_NEW,
00038                                                            RESOURCELIB_DISPLAY_POPUP,
00039                                                           ));
00040     $defaultdisplayoptions = array(RESOURCELIB_DISPLAY_AUTO,
00041                                    RESOURCELIB_DISPLAY_EMBED,
00042                                    RESOURCELIB_DISPLAY_DOWNLOAD,
00043                                    RESOURCELIB_DISPLAY_OPEN,
00044                                    RESOURCELIB_DISPLAY_POPUP,
00045                                   );
00046 
00047     //--- general settings -----------------------------------------------------------------------------------
00048     $settings->add(new admin_setting_configtext('resource/framesize',
00049         get_string('framesize', 'resource'), get_string('configframesize', 'resource'), 130, PARAM_INT));
00050     $settings->add(new admin_setting_configcheckbox('resource/requiremodintro',
00051         get_string('requiremodintro', 'admin'), get_string('configrequiremodintro', 'admin'), 1));
00052     $settings->add(new admin_setting_configmultiselect('resource/displayoptions',
00053         get_string('displayoptions', 'resource'), get_string('configdisplayoptions', 'resource'),
00054         $defaultdisplayoptions, $displayoptions));
00055 
00056     //--- modedit defaults -----------------------------------------------------------------------------------
00057     $settings->add(new admin_setting_heading('resourcemodeditdefaults', get_string('modeditdefaults', 'admin'), get_string('condifmodeditdefaults', 'admin')));
00058 
00059     $settings->add(new admin_setting_configcheckbox_with_advanced('resource/printheading',
00060         get_string('printheading', 'resource'), get_string('printheadingexplain', 'resource'),
00061         array('value'=>0, 'adv'=>false)));
00062     $settings->add(new admin_setting_configcheckbox_with_advanced('resource/printintro',
00063         get_string('printintro', 'resource'), get_string('printintroexplain', 'resource'),
00064         array('value'=>1, 'adv'=>false)));
00065     $settings->add(new admin_setting_configselect_with_advanced('resource/display',
00066         get_string('displayselect', 'resource'), get_string('displayselectexplain', 'resource'),
00067         array('value'=>RESOURCELIB_DISPLAY_AUTO, 'adv'=>false), $displayoptions));
00068     $settings->add(new admin_setting_configtext_with_advanced('resource/popupwidth',
00069         get_string('popupwidth', 'resource'), get_string('popupwidthexplain', 'resource'),
00070         array('value'=>620, 'adv'=>true), PARAM_INT, 7));
00071     $settings->add(new admin_setting_configtext_with_advanced('resource/popupheight',
00072         get_string('popupheight', 'resource'), get_string('popupheightexplain', 'resource'),
00073         array('value'=>450, 'adv'=>true), PARAM_INT, 7));
00074     $options = array('0' => get_string('none'), '1' => get_string('allfiles'), '2' => get_string('htmlfilesonly'));
00075     $settings->add(new admin_setting_configselect_with_advanced('resource/filterfiles',
00076         get_string('filterfiles', 'resource'), get_string('filterfilesexplain', 'resource'),
00077         array('value'=>0, 'adv'=>true), $options));
00078 }
 All Data Structures Namespaces Files Functions Variables Enumerations