summaryrefslogtreecommitdiff
path: root/plugins/Calendar/Controller/ConfigController.php
blob: 61c67f9dc8edbd8f90de4d9c7554a19200afe5a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

namespace Kanboard\Plugin\Calendar\Controller;

/**
 * Class ConfigController
 *
 * @package Kanboard\Plugin\Calendar\Controller
 */
class ConfigController extends \Kanboard\Controller\ConfigController
{
    public function show()
    {
        $this->response->html($this->helper->layout->config('Calendar:config/calendar', array(
            'title' => t('Settings').' &gt; '.t('Calendar settings'),
        )));
    }

    public function save()
    {
        $values =  $this->request->getValues();

        if ($this->configModel->save($values)) {
            $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' => 'Calendar')));
    }
}