MDL-32009 message: Small changes before integration

This commit is contained in:
Sam Hemelryk
2012-04-04 14:20:07 +12:00
parent f1b06f6d54
commit e96b10b121
2 changed files with 20 additions and 9 deletions
+2 -3
View File
@@ -24,7 +24,6 @@
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->dirroot . '/message/lib.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/messagelib.php');
// This is an admin page
admin_externalpage_setup('managemessageoutputs');
@@ -35,8 +34,8 @@ 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);
$uninstall = optional_param('uninstall', '', PARAM_INT);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$uninstall = optional_param('uninstall', 0, PARAM_INT);
$confirm = optional_param('confirm', false, PARAM_BOOL);
$headingtitle = get_string('managemessageoutputs', 'message');
+18 -6
View File
@@ -1530,8 +1530,14 @@ class plugintype_enrol extends plugintype_base implements plugin_information {
*/
class plugintype_message extends plugintype_base implements plugin_information {
/**
* @var array An array of processor objects
*/
private $processors;
/**
* Constructs a plugintype_message instance
*/
protected function __construct() {
global $CFG;
require_once($CFG->dirroot . '/message/lib.php');
@@ -1539,23 +1545,27 @@ class plugintype_message extends plugintype_base implements plugin_information {
}
/**
* Returns a URL to the settings page for the plugin if there is one
*
* @see plugin_information::get_settings_url()
* @return moodle_url|null
*/
public function get_settings_url() {
if (isset($this->processors[$this->name])) {
$processor = $this->processors[$this->name];
} else {
return parent::get_settings_url();
}
if ($processor->available && $processor->hassettings) {
return new moodle_url('settings.php', array('section' => 'messagesetting'.$processor->name));
if ($processor->available && $processor->hassettings) {
return new moodle_url('settings.php', array('section' => 'messagesetting'.$processor->name));
}
}
return parent::get_settings_url();
}
/**
* Returns true if this plugin is enabled
*
* @see plugintype_interface::is_enabled()
* @return bool
*/
public function is_enabled() {
if (isset($this->processors[$this->name])) {
@@ -1566,6 +1576,8 @@ class plugintype_message extends plugintype_base implements plugin_information {
}
/**
* Returns the URL used to uninstall the plugin if there is one.
*
* @see plugintype_interface::get_uninstall_url()
*/
public function get_uninstall_url() {