-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCampusConnectLink.class.php
executable file
·70 lines (62 loc) · 2.28 KB
/
CampusConnectLink.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
64
65
66
67
68
69
70
<?php
/*
* Copyright (c) 2012 Rasmus Fuhse <[email protected]>
*
* 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.
*/
class CampusConnectLink extends StudIPPlugin implements StandardPlugin, SystemPlugin
{
public function __construct()
{
StudipAutoloader::addAutoloadPath(__DIR__ . '/lib');
parent::__construct();
}
public function getDisplayName()
{
return _("Direktlink");
}
public function getTabNavigation($course_id)
{
$navigation = new Navigation($this->getDisplayName(), PluginEngine::getURL($this, array(), "courselink/link"));
return array('link' => $navigation);
}
public function getIconNavigation($course_id, $last_visit, $user_id) {
$navigation = new Navigation($this->getDisplayName(), PluginEngine::getURL($this, array(), "courselink/link"));
return $navigation;
}
public function getInfoTemplate($course_id)
{
return null;
}
public function getNotificationObjects($course_id, $since, $user_id)
{
return null;
}
/**
* This method dispatches and displays all actions. It uses the template
* method design pattern, so you may want to implement the methods #route
* and/or #display to adapt to your needs.
*
* @param string the part of the dispatch path, that were not consumed yet
*
* @return void
*/
public function perform($unconsumed_path)
{
if(!$unconsumed_path) {
header("Location: " . PluginEngine::getUrl($this), 302);
return false;
}
if (Config::get()->CAMPUSCONNECT_LOGFILE) {
CampusConnectLog::get()->setHandler($GLOBALS['TMP_PATH']."/".Config::get()->CAMPUSCONNECT_LOGFILE);
}
CampusConnectLog::get()->setLogLevel(CampusConnectLog::DEBUG);
$trails_root = $this->getPluginPath();
$dispatcher = new Trails_Dispatcher($trails_root, null, 'show');
$dispatcher->current_plugin = $this;
$dispatcher->dispatch($unconsumed_path);
}
}