summaryrefslogtreecommitdiff
path: root/plugins/Boardcustomizer/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/Boardcustomizer/Controller
parent2a43146236fd8fb16f84398d85720ad84aa0a0b1 (diff)
Plugins directory and local modifications
Diffstat (limited to 'plugins/Boardcustomizer/Controller')
-rw-r--r--plugins/Boardcustomizer/Controller/SettingsController.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/plugins/Boardcustomizer/Controller/SettingsController.php b/plugins/Boardcustomizer/Controller/SettingsController.php
new file mode 100644
index 00000000..e98ffbde
--- /dev/null
+++ b/plugins/Boardcustomizer/Controller/SettingsController.php
@@ -0,0 +1,62 @@
+<?php
+
+namespace Kanboard\Plugin\BoardCustomizer\Controller;
+
+use Kanboard\Controller\BaseController;
+
+class SettingsController extends BaseController
+{
+
+ public function showSettings()
+ {
+ $user = $this->getUser();
+
+ $options = [
+ t('Board: only show first column header') => 'boardcustomizer_onlyfirstcolumnheaders',
+ t('Board: top selection without scollbar') => 'boardcustomizer_topnavhiddenscrollbar',
+ t('Card: material design') => 'boardcustomizer_materialcard',
+ t('Card: white background') => 'boardcustomizer_whitebackground',
+ t('Card: hide owner name') => 'boardcustomizer_hideownername',
+ t('Card: hide category') => 'boardcustomizer_hidecategory',
+ t('Card: hide tags') => 'boardcustomizer_hidetags',
+ t('Card: hide all footer icons') => 'boardcustomizer_hidefooter',
+ t('Card: hide task priority') => 'boardcustomizer_hidetaskpriority',
+ t('Card: hide task age') => 'boardcustomizer_hidetaskage',
+ t('Card: hide reference') => 'boardcustomizer_hidereference',
+ t('Card: hide score') => 'boardcustomizer_hidescore',
+ t('Card: hide time estimated') => 'boardcustomizer_hidetimeestimated',
+ t('Card: hide task date') => 'boardcustomizer_hidetaskdate'
+ ];
+
+ // additional options is other plugin is installed
+ $pluginFGroupAssign = PLUGINS_DIR . DIRECTORY_SEPARATOR . basename('Group_assign');
+ if (file_exists($pluginFGroupAssign)) {
+ $plugin_groupassign = [
+ t('Card: hide group labels') => 'boardcustomizer_groupassign_hidecardlabels'
+ ];
+ $options = array_merge($options, $plugin_groupassign);
+ }
+
+ $this->response->html($this->helper->layout->user('boardcustomizer:user/settings', [
+ 'title' => t('My display settings'),
+ 'user' => $user,
+ 'options' => $options,
+ ]));
+ }
+
+ public function disable()
+ {
+ $user = $this->getUser();
+ $key = $this->request->getStringParam('key');
+ $this->userMetadataModel->remove($user['id'], $key);
+ return $this->response->redirect($this->helper->url->to('SettingsController', 'showSettings', ['plugin' => 'boardcustomizer']), true);
+ }
+
+ public function enable()
+ {
+ $user = $this->getUser();
+ $key = $this->request->getStringParam('key');
+ $this->userMetadataModel->save($user['id'], [$key => true]);
+ return $this->response->redirect($this->helper->url->to('SettingsController', 'showSettings', ['plugin' => 'boardcustomizer']), true);
+ }
+}