Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/enrol/paypal/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 
00028 defined('MOODLE_INTERNAL') || die();
00029 
00030 if ($ADMIN->fulltree) {
00031 
00032     //--- settings ------------------------------------------------------------------------------------------
00033     $settings->add(new admin_setting_heading('enrol_paypal_settings', '', get_string('pluginname_desc', 'enrol_paypal')));
00034 
00035     $settings->add(new admin_setting_configtext('enrol_paypal/paypalbusiness', get_string('businessemail', 'enrol_paypal'), get_string('businessemail_desc', 'enrol_paypal'), '', PARAM_EMAIL));
00036 
00037     $settings->add(new admin_setting_configcheckbox('enrol_paypal/mailstudents', get_string('mailstudents', 'enrol_paypal'), '', 0));
00038 
00039     $settings->add(new admin_setting_configcheckbox('enrol_paypal/mailteachers', get_string('mailteachers', 'enrol_paypal'), '', 0));
00040 
00041     $settings->add(new admin_setting_configcheckbox('enrol_paypal/mailadmins', get_string('mailadmins', 'enrol_paypal'), '', 0));
00042 
00043     //--- enrol instance defaults ----------------------------------------------------------------------------
00044     $settings->add(new admin_setting_heading('enrol_paypal_defaults',
00045         get_string('enrolinstancedefaults', 'admin'), get_string('enrolinstancedefaults_desc', 'admin')));
00046 
00047     $options = array(ENROL_INSTANCE_ENABLED  => get_string('yes'),
00048                      ENROL_INSTANCE_DISABLED => get_string('no'));
00049     $settings->add(new admin_setting_configselect('enrol_paypal/status',
00050         get_string('status', 'enrol_paypal'), get_string('status_desc', 'enrol_paypal'), ENROL_INSTANCE_DISABLED, $options));
00051 
00052     $settings->add(new admin_setting_configtext('enrol_paypal/cost', get_string('cost', 'enrol_paypal'), '', 0, PARAM_FLOAT, 4));
00053 
00054     $paypalcurrencies = array('USD' => 'US Dollars',
00055                               'EUR' => 'Euros',
00056                               'JPY' => 'Japanese Yen',
00057                               'GBP' => 'British Pounds',
00058                               'CAD' => 'Canadian Dollars',
00059                               'AUD' => 'Australian Dollars'
00060                              );
00061     $settings->add(new admin_setting_configselect('enrol_paypal/currency', get_string('currency', 'enrol_paypal'), '', 'USD', $paypalcurrencies));
00062 
00063     if (!during_initial_install()) {
00064         $options = get_default_enrol_roles(get_context_instance(CONTEXT_SYSTEM));
00065         $student = get_archetype_roles('student');
00066         $student = reset($student);
00067         $settings->add(new admin_setting_configselect('enrol_paypal/roleid',
00068             get_string('defaultrole', 'enrol_paypal'), get_string('defaultrole_desc', 'enrol_paypal'), $student->id, $options));
00069     }
00070 
00071     $settings->add(new admin_setting_configtext('enrol_paypal/enrolperiod',
00072         get_string('enrolperiod', 'enrol_paypal'), get_string('enrolperiod_desc', 'enrol_paypal'), 0, PARAM_INT));
00073 }
 All Data Structures Namespaces Files Functions Variables Enumerations