summaryrefslogtreecommitdiff
path: root/plugins/Boardcustomizer/Controller
diff options
context:
space:
mode:
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);
+ }
+}