Permalink
Browse files

Merged branch 'ou-messaging-release' of git://git.luns.net.uk/moodle …

…with conflict resolution for MDL-27171
  • Loading branch information...
2 parents 7bff544 + 8e26531 commit 9186cb7e984f9fe8f23012c62efe9a0dc4a9a666 Sam Hemelryk committed Jun 8, 2011
View
@@ -355,7 +355,6 @@
}
// login user and let him set password and admin details
$adminuser->newadminuser = 1;
- message_set_default_message_preferences($adminuser);
complete_user_login($adminuser, false);
redirect("$CFG->wwwroot/user/editadvanced.php?id=$adminuser->id"); // Edit thyself
View
@@ -0,0 +1,70 @@
+<?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/>.
+
+/**
+ * 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(dirname(__FILE__) . '/../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', get_context_instance(CONTEXT_SYSTEM));
+
+// Get the submitted params
+$disable = optional_param('disable', 0, PARAM_INT);
+$enable = optional_param('enable', 0, PARAM_INT);
+
+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
+}
+
+if (!empty($enable) && confirm_sesskey() ) {
+ 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
+}
+
+if ($disable || $enable) {
+ $url = new moodle_url('message.php');
+ redirect($url);
+}
+// Page settings
+$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
+
+// 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(get_string('managemessageoutputs', 'message'));
+echo $messageoutputs;
+echo $OUTPUT->footer();
View
@@ -46,6 +46,27 @@
}
}
+ // message outputs
+ $ADMIN->add('modules', new admin_category('messageoutputs', get_string('messageoutputs', 'message')));
+ $ADMIN->add('messageoutputs', new admin_page_managemessageoutputs());
+ $ADMIN->add('messageoutputs', new admin_page_defaultmessageoutputs());
+ require_once($CFG->dirroot.'/message/lib.php');
+ $processors = get_message_processors();
+ foreach ($processors as $processor) {
+ $processorname = $processor->name;
+ if (!$processor->available) {
+ continue;
+ }
+ if ($processor->hassettings) {
+ $strprocessorname = get_string('pluginname', 'message_'.$processorname);
+ $settings = new admin_settingpage('messagesetting'.$processorname, $strprocessorname, 'moodle/site:config', !$processor->enabled);
+ include($CFG->dirroot.'/message/output/'.$processor->name.'/settings.php');
+ if ($settings) {
+ $ADMIN->add('messageoutputs', $settings);
+ }
+ }
+ }
+
// authentication plugins
$ADMIN->add('modules', new admin_category('authsettings', get_string('authentication', 'admin')));
View
@@ -17,46 +17,8 @@
-// "email" settingpage
-$temp = new admin_settingpage('mail', get_string('mail','admin'));
-$temp->add(new admin_setting_configtext('smtphosts', get_string('smtphosts', 'admin'), get_string('configsmtphosts', 'admin'), '', PARAM_RAW));
-$temp->add(new admin_setting_configtext('smtpuser', get_string('smtpuser', 'admin'), get_string('configsmtpuser', 'admin'), '', PARAM_NOTAGS));
-$temp->add(new admin_setting_configpasswordunmask('smtppass', get_string('smtppass', 'admin'), get_string('configsmtpuser', 'admin'), ''));
-$temp->add(new admin_setting_configtext('smtpmaxbulk', get_string('smtpmaxbulk', 'admin'), get_string('configsmtpmaxbulk', 'admin'), 1, PARAM_INT));
-$temp->add(new admin_setting_configtext('noreplyaddress', get_string('noreplyaddress', 'admin'), get_string('confignoreplyaddress', 'admin'), 'noreply@' . get_host_from_url($CFG->wwwroot), PARAM_NOTAGS));
-$temp->add(new admin_setting_configselect('digestmailtime', get_string('digestmailtime', 'admin'), get_string('configdigestmailtime', 'admin'), 17, array('00' => '00',
- '01' => '01',
- '02' => '02',
- '03' => '03',
- '04' => '04',
- '05' => '05',
- '06' => '06',
- '07' => '07',
- '08' => '08',
- '09' => '09',
- '10' => '10',
- '11' => '11',
- '12' => '12',
- '13' => '13',
- '14' => '14',
- '15' => '15',
- '16' => '16',
- '17' => '17',
- '18' => '18',
- '19' => '19',
- '20' => '20',
- '21' => '21',
- '22' => '22',
- '23' => '23')));
-$charsets = get_list_of_charsets();
-unset($charsets['UTF-8']); // not needed here
-$options = array();
-$options['0'] = 'UTF-8';
-$options = array_merge($options, $charsets);
-$temp->add(new admin_setting_configselect('sitemailcharset', get_string('sitemailcharset', 'admin'), get_string('configsitemailcharset','admin'), '0', $options));
-$temp->add(new admin_setting_configcheckbox('allowusermailcharset', get_string('allowusermailcharset', 'admin'), get_string('configallowusermailcharset', 'admin'), 0));
-$options = array('LF'=>'LF', 'CRLF'=>'CRLF');
-$temp->add(new admin_setting_configselect('mailnewline', get_string('mailnewline', 'admin'), get_string('configmailnewline','admin'), 'LF', $options));
+// "supportcontact" settingpage
+$temp = new admin_settingpage('supportcontact', get_string('supportcontact','admin'));
if (isloggedin()) {
global $USER;
$primaryadminemail = $USER->email;
@@ -73,17 +35,6 @@
$ADMIN->add('server', $temp);
-// Jabber settingpage
-$temp = new admin_settingpage('jabber', get_string('jabber', 'admin'));
-$temp->add(new admin_setting_configtext('jabberhost', get_string('jabberhost', 'admin'), get_string('configjabberhost', 'admin'), '', PARAM_RAW));
-$temp->add(new admin_setting_configtext('jabberserver', get_string('jabberserver', 'admin'), get_string('configjabberserver', 'admin'), '', PARAM_RAW));
-$temp->add(new admin_setting_configtext('jabberusername', get_string('jabberusername', 'admin'), get_string('configjabberusername', 'admin'), '', PARAM_RAW));
-$temp->add(new admin_setting_configpasswordunmask('jabberpassword', get_string('jabberpassword', 'admin'), get_string('configjabberpassword', 'admin'), ''));
-$temp->add(new admin_setting_configtext('jabberport', get_string('jabberport', 'admin'), get_string('configjabberport', 'admin'), 5222, PARAM_INT));
-$ADMIN->add('server', $temp);
-
-
-
// "sessionhandling" settingpage
$temp = new admin_settingpage('sessionhandling', get_string('sessionhandling', 'admin'));
$temp->add(new admin_setting_configcheckbox('dbsessions', get_string('dbsessions', 'admin'), get_string('configdbsessions', 'admin'), 1));
Oops, something went wrong.

0 comments on commit 9186cb7

Please sign in to comment.