summaryrefslogtreecommitdiff
path: root/plugins/KanboardSearchPlugin/Controller
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/Controller
parent2a43146236fd8fb16f84398d85720ad84aa0a0b1 (diff)
Plugins directory and local modifications
Diffstat (limited to 'plugins/KanboardSearchPlugin/Controller')
-rw-r--r--plugins/KanboardSearchPlugin/Controller/AdvancedSearchController.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/plugins/KanboardSearchPlugin/Controller/AdvancedSearchController.php b/plugins/KanboardSearchPlugin/Controller/AdvancedSearchController.php
new file mode 100644
index 00000000..73930fec
--- /dev/null
+++ b/plugins/KanboardSearchPlugin/Controller/AdvancedSearchController.php
@@ -0,0 +1,54 @@
+<?php
+
+namespace Kanboard\Plugin\KanboardSearchPlugin\Controller;
+
+
+use Kanboard\Controller\BaseController;
+
+
+class AdvancedSearchController extends BaseController
+{
+ /**
+ * Display the ASF settings page
+ *
+ * @access public
+ */
+ public function index()
+ {
+ $this->response->html($this->helper->layout->config('KanboardSearchPlugin:config/advanced-search-filter', array(
+ 'db_size' => $this->configModel->getDatabaseSize(),
+ 'db_version' => $this->db->getDriver()->getDatabaseVersion(),
+ 'user_agent' => $this->request->getServerVariable('HTTP_USER_AGENT'),
+ 'title' => t('Settings').' &gt; '.t('Advanced Search Filter'),
+ )));
+ }
+
+ /**
+ * Save settings
+ *
+ */
+ public function save()
+ {
+ $values = $this->request->getValues();
+ $redirect = $this->request->getStringParam('redirect', 'index');
+ switch ($redirect) {
+ case 'index':
+ $values += array(
+ 'comment_search' => 0,
+ 'title_search' => 0,
+ 'description_search' => 0,
+ 'subtask_search' => 0,
+ 'attachment_search' => 0
+ );
+ break;
+ }
+
+ if ($this->configModel->save($values)) {
+ $this->languageModel->loadCurrentLanguage();
+ $this->flash->success(t('Settings saved successfully.'));
+ } else {
+ $this->flash->failure(t('Unable to save your settings.'));
+ }
+ $this->response->redirect($this->helper->url->to('AdvancedSearchController', 'index', array('plugin' => 'KanboardSearchPlugin')));
+ }
+}