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');
// 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');
*/
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');
}
/**
+ * 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])) {
}
/**
+ * Returns the URL used to uninstall the plugin if there is one.
+ *
* @see plugintype_interface::get_uninstall_url()
*/
public function get_uninstall_url() {