-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugin.php
76 lines (62 loc) · 2.22 KB
/
Plugin.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
71
72
73
74
75
76
<?php
namespace Kanboard\Plugin\TodoNotes;
use Kanboard\Core\Plugin\Base;
use Kanboard\Core\Translator;
class Plugin extends Base
{
const NAME = 'TodoNotes';
public function initialize()
{
//HELPER
$this->helper->register('translationsExportToJSHelper', '\Kanboard\Plugin\TodoNotes\Helper\TranslationsExportToJSHelper');
//HOOKS
$this->template->hook->attach('template:dashboard:sidebar', 'TodoNotes:dashboard/sidebar');
$this->template->hook->attach('template:project:dropdown', 'TodoNotes:project/dropdown');
$this->template->hook->attach('template:project-header:view-switcher', 'TodoNotes:project/header');
// ROUTES
$this->route->addRoute('todonotes/:project_id', 'TodoNotesController', 'ShowProject', 'TodoNotes');
$this->route->addRoute('todonotes/:project_id/:use_cached', 'TodoNotesController', 'ShowProject', 'TodoNotes');
$this->route->addRoute('todonotes/:project_id/user/:user_id', 'TodoNotesController', 'ShowProject', 'TodoNotes');
$this->route->addRoute('dashboard/:user_id/todonotes', 'TodoNotesController', 'ShowDashboard', 'TodoNotes');
$this->route->addRoute('dashboard/:user_id/todonotes/:tab_id', 'TodoNotesController', 'ShowDashboard', 'TodoNotes');
}
public function onStartup()
{
$path = __DIR__ . '/Locale';
$language = $this->languageModel->getCurrentLanguage();
$filename = implode(DIRECTORY_SEPARATOR, array($path, $language, 'translations.php'));
if (file_exists($filename)) {
Translator::load($language, $path);
} else {
Translator::load('en_US', $path);
}
}
public function getClasses()
{
return array(
'Plugin\TodoNotes\Model' => array(
'TodoNotesModel'
)
);
}
public function getPluginName()
{
return self::NAME;
}
public function getPluginAuthor()
{
return 'Im[F(x)]';
}
public function getPluginVersion()
{
return '0.0.6';
}
public function getPluginDescription()
{
return t('TodoNotes__PLUGIN_DESCRIPTION');
}
public function getPluginHomepage()
{
return '';
}
}