summaryrefslogtreecommitdiff
path: root/plugins/KanboardSearchPlugin/Plugin.php
diff options
context:
space:
mode:
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