mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
MDL-31429 enrol: added db/messages.php for enrolment plugins and added some smarts to messaging so it won't display message settings for disabled enrolment plugins
This commit is contained in:
parent
b804a56d2c
commit
1218879656
29
enrol/authorize/db/messages.php
Normal file
29
enrol/authorize/db/messages.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// 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/>.
|
||||
|
||||
/**
|
||||
* Defines message providers (types of message sent) for the PayPal enrolment plugin.
|
||||
*
|
||||
* @package enrol_authorize
|
||||
* @copyright 2012 Andrew Davis
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$messageproviders = array(
|
||||
'authorize_enrolment' => array(),
|
||||
);
|
@ -26,7 +26,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2011112900; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2011112901; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011112900; // Requires this Moodle version
|
||||
$plugin->component = 'enrol_authorize'; // Full name of the plugin (used for diagnostics)
|
||||
$plugin->cron = 180;
|
||||
|
29
enrol/flatfile/db/messages.php
Normal file
29
enrol/flatfile/db/messages.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// 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/>.
|
||||
|
||||
/**
|
||||
* Defines message providers (types of message sent) for the PayPal enrolment plugin.
|
||||
*
|
||||
* @package enrol_flatfile
|
||||
* @copyright 2012 Andrew Davis
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$messageproviders = array(
|
||||
'flatfile_enrolment' => array(),
|
||||
);
|
@ -30,6 +30,7 @@ $string['location'] = 'File location';
|
||||
$string['mailadmin'] = 'Notify admin by email';
|
||||
$string['mailstudents'] = 'Notify students by email';
|
||||
$string['mailteachers'] = 'Notify teachers by email';
|
||||
$string['messageprovider:flatfile_enrolment'] = 'Flat file enrolment messages';
|
||||
$string['mapping'] = 'Flat file mapping';
|
||||
$string['pluginname'] = 'Flat file (CSV)';
|
||||
$string['pluginname_desc'] = 'This method will repeatedly check for and process a specially-formatted text file in the location that you specify.
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2011112900; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2011112901; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011112900; // Requires this Moodle version
|
||||
$plugin->component = 'enrol_flatfile'; // Full name of the plugin (used for diagnostics)
|
||||
$plugin->cron = 60;
|
||||
|
29
enrol/imsenterprise/db/messages.php
Normal file
29
enrol/imsenterprise/db/messages.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// 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/>.
|
||||
|
||||
/**
|
||||
* Defines message providers (types of message sent) for the PayPal enrolment plugin.
|
||||
*
|
||||
* @package enrol_imsenterprise
|
||||
* @copyright 2012 Andrew Davis
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$messageproviders = array(
|
||||
'imsenterprise_enrolment' => array(),
|
||||
);
|
@ -54,6 +54,7 @@ $string['location'] = 'File location';
|
||||
$string['logtolocation'] = 'Log file output location (blank for no logging)';
|
||||
$string['mailadmins'] = 'Notify admin by email';
|
||||
$string['mailusers'] = 'Notify users by email';
|
||||
$string['messageprovider:imsenterprise_enrolment'] = 'IMS Enterprise enrolment messages';
|
||||
$string['miscsettings'] = 'Miscellaneous';
|
||||
$string['processphoto'] = 'Add user photo data to profile';
|
||||
$string['processphotowarning'] = 'Warning: Image processing is likely to add a significant burden to the server. You are recommended not to activate this option if large numbers of students are expected to be processed.';
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2011112900; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2011112901; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011112900; // Requires this Moodle version
|
||||
$plugin->component = 'enrol_imsenterprise'; // Full name of the plugin (used for diagnostics)
|
||||
$plugin->cron = 60;
|
||||
|
29
enrol/paypal/db/messages.php
Normal file
29
enrol/paypal/db/messages.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// 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/>.
|
||||
|
||||
/**
|
||||
* Defines message providers (types of message sent) for the PayPal enrolment plugin.
|
||||
*
|
||||
* @package enrol_paypal
|
||||
* @copyright 2012 Chris Follin
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$messageproviders = array(
|
||||
'paypal_enrolment' => array(),
|
||||
);
|
@ -26,6 +26,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2011112900; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2011112901; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2011112900; // Requires this Moodle version
|
||||
$plugin->component = 'enrol_paypal'; // Full name of the plugin (used for diagnostics)
|
||||
|
@ -396,11 +396,23 @@ function message_get_providers_for_user($userid) {
|
||||
if (!empty($provider->capability)) {
|
||||
if (!has_capability($provider->capability, $systemcontext, $userid)) {
|
||||
unset($providers[$providerid]); // Not allowed to see this
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure user is not allowed to configure instantmessage if it is globally disabled.
|
||||
if (!$CFG->messaging && $provider->name == 'instantmessage') {
|
||||
unset($providers[$providerid]);
|
||||
continue;
|
||||
}
|
||||
|
||||
// If the component is an enrolment plugin, check it is enabled
|
||||
list($type, $name) = normalize_component($provider->component);
|
||||
if ($type == 'enrol') {
|
||||
if (!enrol_is_enabled($name)) {
|
||||
unset($providers[$providerid]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user