moodle/admin/message.php

75 lines
2.5 KiB
PHP
Raw Normal View History

<?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/>.
/**
* 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
*/
require_once(__DIR__ . '/../config.php');
require_once($CFG->dirroot . '/message/lib.php');
require_once($CFG->libdir.'/adminlib.php');
// This is an admin page
admin_externalpage_setup('managemessageoutputs');
// Require site configuration capability
require_capability('moodle/site:config', context_system::instance());
// Get the submitted params
$disable = optional_param('disable', 0, PARAM_INT);
$enable = optional_param('enable', 0, PARAM_INT);
$headingtitle = get_string('managemessageoutputs', 'message');
if (!empty($disable) && confirm_sesskey()) {
if (!$processor = $DB->get_record('message_processors', array('id'=>$disable))) {
print_error('outputdoesnotexist', 'message');
}
\core_message\api::update_processor_status($processor, 0); // Disable output.
core_plugin_manager::reset_caches();
}
if (!empty($enable) && confirm_sesskey()) {
if (!$processor = $DB->get_record('message_processors', array('id'=>$enable))) {
print_error('outputdoesnotexist', 'message');
}
\core_message\api::update_processor_status($processor, 1); // Enable output.
core_plugin_manager::reset_caches();
}
if ($disable || $enable) {
$url = new moodle_url('message.php');
redirect($url);
}
// Page settings
$PAGE->set_context(context_system::instance());
// 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();
echo $OUTPUT->heading($headingtitle);
echo $messageoutputs;
echo $OUTPUT->footer();