Commit 33de3a0e authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fix grouptype plugins for new installs

parent 3ac897fc
......@@ -27,6 +27,13 @@
defined('INTERNAL') || die();
class PluginGrouptypeCourse extends PluginGrouptype {
public static function postinst($prevversion) {
if ($prevversion == 0) {
parent::installgrouptype('GroupTypeCourse');
}
}
}
class GroupTypeCourse extends GroupType {
......
......@@ -28,12 +28,9 @@ defined('INTERNAL') || die();
abstract class PluginGrouptype extends Plugin {
public static function postinst($prevversion) {
if ($prevversion == 0) {
$classname = get_class($this);
$type = substr($classname, strlen('PluginGrouptype'));
call_static_method('GroupType'.$type, 'install');
}
public static function installgrouptype($type) {
$grouptype = new $type();
$grouptype->install();
}
}
......
......@@ -27,6 +27,13 @@
defined('INTERNAL') || die();
class PluginGrouptypeStandard extends PluginGrouptype {
public static function postinst($prevversion) {
if ($prevversion == 0) {
parent::installgrouptype('GroupTypeStandard');
}
}
}
class GroupTypeStandard extends GroupType {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment