From 86ce32b3596c75ff0f3145df3734f9b2a8c402de Mon Sep 17 00:00:00 2001 From: Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> Date: Fri, 12 Aug 2022 12:23:26 +0200 Subject: [PATCH] work around bug in Opencast plugin 2.x, fixes #137 (1.8 branch only) --- VipsPlugin.php | 12 ++++++------ lib/CoursewarePlugin.php | 18 ------------------ 2 files changed, 6 insertions(+), 24 deletions(-) delete mode 100644 lib/CoursewarePlugin.php diff --git a/VipsPlugin.php b/VipsPlugin.php index 2bff189..d48e609 100644 --- a/VipsPlugin.php +++ b/VipsPlugin.php @@ -39,8 +39,12 @@ if (!interface_exists('PrivacyPlugin')) { // this is included for Stud.IP >= 5.0 if (interface_exists('Courseware\CoursewarePlugin')) { require_once 'lib/VipsCoursewarePlugin.php'; + + class _VipsPlugin extends StudIPPlugin implements Courseware\CoursewarePlugin { + use VipsCoursewarePlugin; + } } else { - require_once 'lib/CoursewarePlugin.php'; + class _VipsPlugin extends StudIPPlugin {} } StudipAutoloader::addClassLookups([ @@ -62,19 +66,15 @@ StudipAutoloader::addClassLookups([ 'VipsTest' => __DIR__ . '/lib/VipsTest.php' ]); -use Courseware\CoursewarePlugin; - /** * Vips plugin class for Stud.IP */ -class VipsPlugin extends StudIPPlugin implements StandardPlugin, SystemPlugin, PrivacyPlugin, CoursewarePlugin +class VipsPlugin extends _VipsPlugin implements StandardPlugin, SystemPlugin, PrivacyPlugin { public static $exam_mode; public static $instance; public static $template_factory; - use VipsCoursewarePlugin; - public function __construct() { global $perm, $user; diff --git a/lib/CoursewarePlugin.php b/lib/CoursewarePlugin.php deleted file mode 100644 index 5012d6f..0000000 --- a/lib/CoursewarePlugin.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/* - * CoursewarePlugin.php - Vips copy of the CoursewarePlugin interface - * Copyright (c) 2022 Elmar Ludwig - * - * This program 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 2 of - * the License, or (at your option) any later version. - */ - -namespace Courseware { - interface CoursewarePlugin {} -} - -namespace { - trait VipsCoursewarePlugin {} -} -- GitLab