diff options
| author | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2022-05-11 07:19:42 +0000 |
|---|---|---|
| committer | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2022-05-11 07:19:42 +0000 |
| commit | 20240b2aacb15ab3264afbfbbc9dae952db4bb63 (patch) | |
| tree | 597cae73c5ae7ab9eda6d066d45430c3f17a4560 /public/plugins.php | |
| parent | c054faf90288a75fc3680480434ba93b7f5b287b (diff) | |
convert old core plugins to new model, re #814
Merge request studip/studip!440
Diffstat (limited to 'public/plugins.php')
| -rw-r--r-- | public/plugins.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/public/plugins.php b/public/plugins.php index 97aee03..1488118 100644 --- a/public/plugins.php +++ b/public/plugins.php @@ -27,9 +27,15 @@ try { require_once 'lib/seminar_open.php'; // get plugin class from request - $dispatch_to = isset($_SERVER['PATH_INFO']) ?$_SERVER['PATH_INFO'] : ''; + $dispatch_to = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : ''; list($plugin_class, $unconsumed) = PluginEngine::routeRequest($dispatch_to); + // handle legacy forum plugin URLs + if ($plugin_class === 'coreforum') { + header('Location: ' . URLHelper::getURL('dispatch.php/course/forum/' . $unconsumed)); + die(); + } + // retrieve corresponding plugin info $plugin_manager = PluginManager::getInstance(); $plugin_info = $plugin_manager->getPluginInfo($plugin_class); @@ -46,8 +52,9 @@ try { // set default page title PageLayout::setTitle($plugin->getPluginName()); + // deprecated, the plugin should override perform() instead if (is_callable([$plugin, 'initialize'])) { - $plugin->initialize(); + $plugin->initialize(); } // let the show begin |
