summaryrefslogtreecommitdiff
path: root/plugins/KanboardSearchPlugin/Plugin.php
diff options
context:
space:
mode:
authorDzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl>2019-12-10 11:34:53 +0100
committerDzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl>2019-12-10 11:34:53 +0100
commitb8fa0246803dab40cf57d40b45984c53046f2d55 (patch)
treedc92b167c7542137c385614a1d558e57669a4339 /plugins/KanboardSearchPlugin/Plugin.php
parent2a43146236fd8fb16f84398d85720ad84aa0a0b1 (diff)
Plugins directory and local modifications
Diffstat (limited to 'plugins/KanboardSearchPlugin/Plugin.php')
-rw-r--r--plugins/KanboardSearchPlugin/Plugin.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/plugins/KanboardSearchPlugin/Plugin.php b/plugins/KanboardSearchPlugin/Plugin.php
new file mode 100644
index 00000000..4b041d1a
--- /dev/null
+++ b/plugins/KanboardSearchPlugin/Plugin.php
@@ -0,0 +1,62 @@
+<?php
+
+namespace Kanboard\Plugin\KanboardSearchPlugin;
+
+use Kanboard\Core\Filter\LexerBuilder;
+use Kanboard\Core\Plugin\Base;
+use Kanboard\Core\Translator;
+use Kanboard\Plugin\KanboardSearchPlugin\Filter\AdvancedSearchFilter;
+
+class Plugin extends Base
+{
+ public function initialize()
+ {
+ $this->template->hook->attach("template:config:sidebar",
+ "KanboardSearchPlugin:config/sidebar");
+
+ $this->route->addRoute('settings/advancedsearch', 'AdvancedSearchController', 'index',
+ 'KanboardSearchPlugin');
+
+ $this->container->extend('taskLexer', function ($taskLexer, $c) {
+ /**
+ * @var LexerBuilder $taskLexer
+ */
+ $taskLexer->withFilter(AdvancedSearchFilter::getInstance()
+ ->setDatabase($c['db'])
+ ->setConfigModel($this->configModel)
+ ->setFileModel($this->taskFileModel), true);
+
+ return $taskLexer;
+ });
+ }
+
+ public function onStartup()
+ {
+ Translator::load($this->languageModel->getCurrentLanguage(), __DIR__.'/Locale');
+ }
+
+ public function getPluginName()
+ {
+ return 'KanboardSearchPlugin';
+ }
+
+ public function getPluginDescription()
+ {
+ return t('This plugin is used for advanced fulltext search within all Projects');
+ }
+
+ public function getPluginAuthor()
+ {
+ return 'ipunkt Business Solutions';
+ }
+
+ public function getPluginVersion()
+ {
+ return '1.0.0';
+ }
+
+ public function getPluginHomepage()
+ {
+ return 'https://www.ipunkt.biz/unternehmen/opensource';
+ }
+} \ No newline at end of file