f2 comment icon always on, v0.3

This commit is contained in:
2026-07-05 10:20:45 -03:00
parent d47809c713
commit 230982dd4c
7 changed files with 104 additions and 3 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace Kanboard\Plugin\OrganonTweaks\Controller;
use Kanboard\Controller\BaseController;
/**
* Settings page for the OrganonTweaks plugin: one toggle per tweak.
*/
class ConfigController extends BaseController
{
public function show()
{
$this->response->html($this->helper->layout->config('organonTweaks:config/show', array(
'title' => t('Settings').' &gt; '.t('Organon Tweaks'),
'values' => array(
'organon_tweaks_always_comment_icon' => (int) $this->configModel->get('organon_tweaks_always_comment_icon', 1),
),
'errors' => array(),
)));
}
public function save()
{
$values = $this->request->getValues();
$alwaysCommentIcon = isset($values['organon_tweaks_always_comment_icon']) ? 1 : 0;
if ($this->configModel->save(array('organon_tweaks_always_comment_icon' => $alwaysCommentIcon))) {
$this->flash->success(t('Settings saved successfully.'));
} else {
$this->flash->failure(t('Unable to save your settings.'));
}
$this->response->redirect($this->helper->url->to('ConfigController', 'show', array('plugin' => 'OrganonTweaks')));
}
}