-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForumPPMigratorPlugin.class.php
executable file
·63 lines (52 loc) · 1.91 KB
/
ForumPPMigratorPlugin.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/*
* ForumPPMigratorPlugin.class.php - ForumPPMigratorPlugin
*
* 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.
*
* @author Till Glöggler <[email protected]>
* @copyright 2011 ELAN e.V. <http://www.elan-ev.de>
* @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
* @category Stud.IP
*/
require_once 'vendor/trails/trails.php';
class ForumPPMigratorPlugin extends StudipPlugin implements StandardPlugin
{
/**
* Initialize a new instance of the plugin.
*/
function __construct()
{
parent::__construct();
// do nothing if plugin is deactivated in this seminar/institute
if (!PluginManager::isPluginActivated($this->getPluginId(), Request::get('cid', $GLOBALS['SessSemName'][1]))) return;
// if there is no forum2-navigation, quit
if (!Navigation::hasItem('course/forum2')) return;
// add navigation for migrator
$navigation = Navigation::getItem('course/forum2');
$navigation->addSubNavigation('migration', new Navigation(_("Migration"), PluginEngine::getLink('forumppmigratorplugin/index')));
}
/**
* This method dispatches all actions.
*
* @param string part of the dispatch path that was not consumed
*/
function perform($unconsumed_path)
{
$trails_root = $this->getPluginPath();
$dispatcher = new Trails_Dispatcher($trails_root .'/app', PluginEngine::getUrl('forumpp/index'), 'index');
$dispatcher->dispatch($unconsumed_path);
}
// implement interface methods
function getIconNavigation($course_id, $last_visit)
{
return null;
}
function getInfoTemplate($course_id)
{
return null;
}
}