Permalink
Browse files

MDL-32009 messaging: Add is_enabled method to plugintype_message

  • Loading branch information...
Ruslan Kabalin
Ruslan Kabalin committed Mar 12, 2012
1 parent 26d859e commit 6f4f0b5228bc9354cc95233806cf11421b4fc098
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/pluginlib.php
View
@@ -1552,6 +1552,17 @@ public function get_settings_url() {
return new moodle_url('settings.php', array('section' => 'messagesetting'.$processor->name));
}
}
+
+ /**
+ * @see plugintype_interface::is_enabled()
+ */
+ public function is_enabled() {
+ if (isset($this->processors[$this->name])) {
+ return $this->processors[$this->name]->configured && $this->processors[$this->name]->enabled;
+ } else {
+ return parent::is_enabled();
+ }
+ }
}
/**

0 comments on commit 6f4f0b5

Please sign in to comment.