2011-05-11 16:48:04 +01:00
|
|
|
<?php
|
MDL-27171 messages: admin settings reordering
This includes:
* most email settings go from general admin setings to email plugin settings
* digestmailtime goes to mod/forum/settings.php
* supportname, supportemail and supportpage go to Support contact page
* all jabber settings go from general admin setings to jabber plugin settings
AMOS BEGIN
MOV [jabberhost,admin],[jabberhost,message_jabber]
MOV [configjabberhost,admin],[configjabberhost,message_jabber]
MOV [jabberserver,admin],[jabberserver,message_jabber]
MOV [configjabberserver,admin],[configjabberserver,message_jabber]
MOV [jabberusername,admin],[jabberusername,message_jabber]
MOV [configjabberusername,admin],[configjabberusername,message_jabber]
MOV [jabberpassword,admin],[jabberpassword,message_jabber]
MOV [configjabberpassword,admin],[configjabberpassword,message_jabber]
MOV [jabberport,admin],[jabberport,message_jabber]
MOV [configjabberport,admin],[configjabberport,message_jabber]
MOV [digestmailtime,admin],[digestmailtime,forum]
MOV [configdigestmailtime,admin],[configdigestmailtime,forum]
MOV [allowusermailcharset,admin],[allowusermailcharset,message_email]
MOV [configallowusermailcharset,admin],[configallowusermailcharset,message_email]
MOV [mailnewline,admin],[mailnewline,message_email]
MOV [configmailnewline,admin],[configmailnewline,message_email]
MOV [noreplyaddress,admin],[noreplyaddress,message_email]
MOV [confignoreplyaddress,admin],[confignoreplyaddress,message_email]
MOV [sitemailcharset,admin],[sitemailcharset,message_email]
MOV [configsitemailcharset,admin],[configsitemailcharset,message_email]
MOV [smtphosts,admin],[smtphosts,message_email]
MOV [configsmtphosts,admin],[configsmtphosts,message_email]
MOV [smtpmaxbulk,admin],[smtpmaxbulk,message_email]
MOV [configsmtpmaxbulk,admin],[configsmtpmaxbulk,message_email]
MOV [smtpuser,admin],[smtpuser,message_email]
MOV [configsmtpuser,admin],[configsmtpuser,message_email]
MOV [smtppass,admin],[smtppass,message_email]
AMOS END
Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>
2011-05-12 12:11:47 +01:00
|
|
|
// 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/>.
|
2011-05-11 16:48:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Message outputs configuration page
|
|
|
|
*
|
|
|
|
* @package message
|
|
|
|
* @copyright 2011 Lancaster University Network Services Limited
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
|
*/
|
2011-05-31 15:16:17 +01:00
|
|
|
require_once(dirname(__FILE__) . '/../config.php');
|
|
|
|
require_once($CFG->dirroot . '/message/lib.php');
|
2011-05-11 16:48:04 +01:00
|
|
|
require_once($CFG->libdir.'/adminlib.php');
|
|
|
|
|
|
|
|
// This is an admin page
|
|
|
|
admin_externalpage_setup('managemessageoutputs');
|
|
|
|
|
|
|
|
// Require site configuration capability
|
2012-07-23 14:33:02 +08:00
|
|
|
require_capability('moodle/site:config', context_system::instance());
|
2011-05-11 16:48:04 +01:00
|
|
|
|
|
|
|
// Get the submitted params
|
|
|
|
$disable = optional_param('disable', 0, PARAM_INT);
|
|
|
|
$enable = optional_param('enable', 0, PARAM_INT);
|
2012-04-03 14:48:54 +01:00
|
|
|
|
|
|
|
$headingtitle = get_string('managemessageoutputs', 'message');
|
2011-05-11 16:48:04 +01:00
|
|
|
|
|
|
|
if (!empty($disable) && confirm_sesskey()) {
|
|
|
|
if (!$processor = $DB->get_record('message_processors', array('id'=>$disable))) {
|
|
|
|
print_error('outputdoesnotexist', 'message');
|
|
|
|
}
|
|
|
|
$DB->set_field('message_processors', 'enabled', '0', array('id'=>$processor->id)); // Disable output
|
2013-10-04 22:40:44 +02:00
|
|
|
core_plugin_manager::reset_caches();
|
2011-05-11 16:48:04 +01:00
|
|
|
}
|
|
|
|
|
2012-04-03 14:48:54 +01:00
|
|
|
if (!empty($enable) && confirm_sesskey()) {
|
2011-05-11 16:48:04 +01:00
|
|
|
if (!$processor = $DB->get_record('message_processors', array('id'=>$enable))) {
|
|
|
|
print_error('outputdoesnotexist', 'message');
|
|
|
|
}
|
|
|
|
$DB->set_field('message_processors', 'enabled', '1', array('id'=>$processor->id)); // Enable output
|
2013-10-04 22:40:44 +02:00
|
|
|
core_plugin_manager::reset_caches();
|
2011-05-11 16:48:04 +01:00
|
|
|
}
|
|
|
|
|
2013-09-25 09:39:36 +02:00
|
|
|
if ($disable || $enable) {
|
2011-05-11 16:48:04 +01:00
|
|
|
$url = new moodle_url('message.php');
|
|
|
|
redirect($url);
|
|
|
|
}
|
|
|
|
// Page settings
|
2012-07-23 14:33:02 +08:00
|
|
|
$PAGE->set_context(context_system::instance());
|
2011-05-11 16:48:04 +01:00
|
|
|
|
|
|
|
// Grab the renderer
|
|
|
|
$renderer = $PAGE->get_renderer('core', 'message');
|
|
|
|
|
|
|
|
// Display the manage message outputs interface
|
|
|
|
$processors = get_message_processors();
|
|
|
|
$messageoutputs = $renderer->manage_messageoutputs($processors);
|
|
|
|
|
|
|
|
// Display the page
|
|
|
|
echo $OUTPUT->header();
|
2012-04-03 14:48:54 +01:00
|
|
|
echo $OUTPUT->heading($headingtitle);
|
2011-05-11 16:48:04 +01:00
|
|
|
echo $messageoutputs;
|
2013-09-25 09:39:36 +02:00
|
|
|
echo $OUTPUT->footer();
|