function is_commerce_configured() { global $CFG; // Confirm commerce admin has been defined if (!$CFG->commerce_admin_firstname || !$CFG->commerce_admin_lastname || !$CFG->commerce_admin_email) { return false; } // Confirm that there are some payment providers configured $pp = get_payment_providers(); if (!$pp) { return false; } // Looks ok return true; }
// Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * iomad - admin settings * * @package iomad * @copyright 2011 onwards E-Learn Design Limited * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die; if ($ADMIN->fulltree) { $dir = dirname(__FILE__); require_once $dir . '/lib.php'; $settings->add(new admin_setting_configtext('commerce_admin_firstname', get_string('commerce_admin_firstname', 'block_iomad_commerce'), get_string('commerce_admin_firstname_help', 'block_iomad_commerce'), '', PARAM_TEXT)); $settings->add(new admin_setting_configtext('commerce_admin_lastname', get_string('commerce_admin_lastname', 'block_iomad_commerce'), get_string('commerce_admin_lastname_help', 'block_iomad_commerce'), '', PARAM_TEXT)); $settings->add(new admin_setting_configtext('commerce_admin_email', get_string('commerce_admin_email', 'block_iomad_commerce'), get_string('commerce_admin_email_help', 'block_iomad_commerce'), '', PARAM_EMAIL)); $pp = get_payment_providers(); foreach ($pp as $p) { $pname = get_string('pp_' . $p . '_name', 'block_iomad_commerce'); $settings->add(new admin_setting_configcheckbox($p . '_enabled', get_string('paymentprovider_enabled', 'block_iomad_commerce', $pname), get_string('paymentprovider_enabled_help', 'block_iomad_commerce', $pname), 0)); $phpname = "{$dir}/checkout/{$p}/settings.php"; if (file_exists($phpname)) { require_once $phpname; } } }
// // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. // Load payment provider strings. require_once dirname(__FILE__) . '/../../lib.php'; foreach (get_payment_providers() as $p) { $path = dirname(__FILE__) . "/../../checkout/{$p}/lang/en/{$p}.php"; if (file_exists($path)) { require_once $path; } } $string['add_course_to_shop'] = 'Add course to shop'; $string['add_more_license_blocks'] = 'Add another license block'; $string['addnewcourse'] = 'Add course to shop'; $string['allow_license_blocks'] = 'Allow license blocks'; $string['allow_license_blocks_help'] = 'When enabled a client administrator can purchase blocks of courses'; $string['allow_single_purchase'] = 'Allow single purchase'; $string['allow_single_purchase_help'] = 'When single purchase is enabled individual users can purchase their own access to the course'; $string['amount'] = 'Amount'; $string['blocktitle'] = 'E-Commerce'; $string['basket'] = 'Basket';