1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
3 | # |
---|
4 | # This file is part of Dotclear 2. |
---|
5 | # |
---|
6 | # Copyright (c) 2003-2014 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 | |
---|
13 | if (!defined('DC_CONTEXT_ADMIN')) { return; } |
---|
14 | |
---|
15 | $dcckeditor_was_actived = $dcckeditor_active; |
---|
16 | |
---|
17 | if (!empty($_POST['saveconfig'])) { |
---|
18 | try { |
---|
19 | $dcckeditor_active = (empty($_POST['dcckeditor_active']))?false:true; |
---|
20 | $core->blog->settings->dcckeditor->put('active', $dcckeditor_active, 'boolean'); |
---|
21 | |
---|
22 | // change other settings only if they were in html page |
---|
23 | if ($dcckeditor_was_actived) { |
---|
24 | $dcckeditor_alignement_buttons = (empty($_POST['dcckeditor_alignment_buttons']))?false:true; |
---|
25 | $core->blog->settings->dcckeditor->put('alignment_buttons', $dcckeditor_alignement_buttons, 'boolean'); |
---|
26 | |
---|
27 | $dcckeditor_list_buttons = (empty($_POST['dcckeditor_list_buttons']))?false:true; |
---|
28 | $core->blog->settings->dcckeditor->put('list_buttons', $dcckeditor_list_buttons, 'boolean'); |
---|
29 | |
---|
30 | $dcckeditor_textcolor_button = (empty($_POST['dcckeditor_textcolor_button']))?false:true; |
---|
31 | $core->blog->settings->dcckeditor->put('textcolor_button', $dcckeditor_textcolor_button, 'boolean'); |
---|
32 | |
---|
33 | $dcckeditor_cancollapse_button = (empty($_POST['dcckeditor_cancollapse_button']))?false:true; |
---|
34 | $core->blog->settings->dcckeditor->put('cancollapse_button', $dcckeditor_cancollapse_button, 'boolean'); |
---|
35 | |
---|
36 | $dcckeditor_format_select = (empty($_POST['dcckeditor_format_select']))?false:true; |
---|
37 | $core->blog->settings->dcckeditor->put('format_select', $dcckeditor_format_select, 'boolean'); |
---|
38 | |
---|
39 | $dcckeditor_table_button = (empty($_POST['dcckeditor_table_button']))?false:true; |
---|
40 | $core->blog->settings->dcckeditor->put('table_button', $dcckeditor_table_button, 'boolean'); |
---|
41 | |
---|
42 | $dcckeditor_clipboard_buttons = (empty($_POST['dcckeditor_clipboard_buttons']))?false:true; |
---|
43 | $core->blog->settings->dcckeditor->put('clipboard_buttons', $dcckeditor_clipboard_buttons, 'boolean'); |
---|
44 | } |
---|
45 | |
---|
46 | dcPage::addSuccessNotice(__('The configuration has been updated.')); |
---|
47 | http::redirect($p_url); |
---|
48 | } catch(Exception $e) { |
---|
49 | $core->error->add($e->getMessage()); |
---|
50 | } |
---|
51 | } |
---|
52 | |
---|
53 | include dirname(__FILE__).'/../tpl/index.tpl'; |
---|