Dotclear

source: plugins/dcLegacyEditor/index.php @ 3730:5c45a5df9a59

Revision 3730:5c45a5df9a59, 1.1 KB checked in by franck <carnet.franck.paul@…>, 8 years ago (diff)

Code formatting (PSR-2)

RevLine 
[2614]1<?php
2# -- BEGIN LICENSE BLOCK ---------------------------------------
3#
4# This file is part of Dotclear 2.
5#
6# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
7# Licensed under the GPL version 2.0 license.
8# See LICENSE file or
9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10#
11# -- END LICENSE BLOCK -----------------------------------------
12
[3730]13if (!defined('DC_CONTEXT_ADMIN')) {return;}
[2614]14
[2855]15$is_admin = $core->auth->check('admin,contentadmin', $core->blog->id) || $core->auth->isSuperAdmin();
16
[2614]17$core->blog->settings->addNameSpace('dclegacyeditor');
18$dclegacyeditor_active = $core->blog->settings->dclegacyeditor->active;
19
20if (!empty($_POST['saveconfig'])) {
21    try {
[3730]22        $dclegacyeditor_active = (empty($_POST['dclegacyeditor_active'])) ? false : true;
[2614]23        $core->blog->settings->dclegacyeditor->put('active', $dclegacyeditor_active, 'boolean');
24
25        dcPage::addSuccessNotice(__('The configuration has been updated.'));
26        http::redirect($p_url);
[3730]27    } catch (Exception $e) {
28        $core->error->add($e->getMessage());
[2614]29    }
30}
31
[3730]32include dirname(__FILE__) . '/tpl/index.tpl';
Note: See TracBrowser for help on using the repository browser.

Sites map