generated from aljawaid/KanboardSkeletonPlugin
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlugin.php
77 lines (62 loc) · 3.13 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
77
<?php
namespace Kanboard\Plugin\KanboardSupport;
use Kanboard\Core\Plugin\Base;
use Kanboard\Core\Translator;
use Kanboard\Model\UserModel;
use Kanboard\Controller\UserViewController;
class Plugin extends Base
{
public function initialize()
{
// Template Override
// - Override name should be camelCase e.g. pluginNameExampleCamelCase
$this->template->setTemplateOverride('config/webhook', 'kanboardSupport:config/webhook');
// CSS - Asset Hook - keep filename lowercase
$this->hook->on('template:layout:css', array('template' => 'plugins/KanboardSupport/Assets/css/kanboard-support.css'));
if (!file_exists('plugins/ContentCleaner') || !file_exists('plugins/PluginManager')) {
$this->hook->on('template:layout:css', array('template' => 'plugins/KanboardSupport/Assets/css/messages.css'));
}
// JS - Asset Hook
// - Keep filename lowercase
$this->hook->on('template:layout:js', array('template' => 'plugins/KanboardSupport/Assets/js/kanboard-support.js'));
// SETTINGS SIDEBAR - Template Hook - Override name should start lowercase e.g. pluginNameExampleCamelCase
$this->template->hook->attach('template:config:sidebar', 'kanboardSupport:config/sidebar');
// TOP RIGHT MENU
$this->template->hook->attach('template:header:dropdown', 'kanboardSupport:header/user_dropdown');
// SUPPORT PAGE - Routes
$this->route->addRoute('/settings/configuration', 'TechnicalSupportController', 'show', 'KanboardSupport');
$this->route->addRoute('/settings/webhook/information', 'TechnicalSupportController', 'showWebhookInformation', 'KanboardSupport');
// HELPER
$this->helper->register('supportHelper', '\Kanboard\Plugin\KanboardSupport\Helper\SupportHelper');
}
public function onStartup()
{
Translator::load($this->languageModel->getCurrentLanguage(), __DIR__ . '/Locale');
}
public function getPluginName()
{
return 'KanboardSupport';
}
public function getPluginDescription()
{
return t('Display the environment and configuration settings of your Kanboard instance all from one dedicated page. View and compare all options from the config file directly from the interface. Users will benefit from identifying problems caused by missing extensions and server misconfigurations without needing backend access to the server. Made for both regular users and administrators, this privacy and user friendly plugin provides a range of features including integrated webhook documentation, downloading backup copies of the config file and displaying, downloading or deleting the debug log file.');
}
public function getPluginAuthor()
{
return 'aljawaid';
}
public function getPluginVersion()
{
return '4.5.0';
}
public function getCompatibleVersion()
{
// Examples: '>=1.0.37' '<1.0.37' '<=1.0.37'
// Tested on KB v1.2.20 upto plugin v2.8.0, then KB v1.2.32+
return '>=1.2.20';
}
public function getPluginHomepage()
{
return 'https://github.com/aljawaid/KanboardSupport';
}
}