1 | <?php |
---|
2 | # ***** BEGIN LICENSE BLOCK ***** |
---|
3 | # |
---|
4 | # This file is part of clean:config, a plugin for Dotclear 2 |
---|
5 | # Copyright (C) 2007-2016 Moe (http://gniark.net/) |
---|
6 | # |
---|
7 | # clean:config is free software; you can redistribute it and/or |
---|
8 | # modify it under the terms of the GNU General Public License v2.0 |
---|
9 | # as published by the Free Software Foundation. |
---|
10 | # |
---|
11 | # clean:config is distributed in the hope that it will be useful, |
---|
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | # GNU General Public License for more details. |
---|
15 | # |
---|
16 | # You should have received a copy of the GNU General Public |
---|
17 | # License along with this program. If not, see |
---|
18 | # <http://www.gnu.org/licenses/>. |
---|
19 | # |
---|
20 | # Icon (icon.png) and images are from Silk Icons : |
---|
21 | # <http://www.famfamfam.com/lab/icons/silk/> |
---|
22 | # |
---|
23 | # ***** END LICENSE BLOCK ***** |
---|
24 | |
---|
25 | if (!defined('DC_CONTEXT_ADMIN')) {exit;} |
---|
26 | |
---|
27 | l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/admin'); |
---|
28 | |
---|
29 | $page_title = __('clean:config'); |
---|
30 | |
---|
31 | require_once(dirname(__FILE__).'/php-xhtml-table/class.table.php'); |
---|
32 | require_once(dirname(__FILE__).'/inc/lib.cleanconfig.php'); |
---|
33 | |
---|
34 | $default_tab = 'blog_settings'; |
---|
35 | |
---|
36 | $msg = (string)''; |
---|
37 | |
---|
38 | # actions |
---|
39 | $limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : ''; |
---|
40 | |
---|
41 | if ((isset($_POST['delete'])) AND (($limit == 'blog') OR ($limit == 'global'))) |
---|
42 | { |
---|
43 | if (count($_POST['settings']) == 0) |
---|
44 | { |
---|
45 | $msg = __('No setting deleted.'); |
---|
46 | $default_tab = $limit.'_settings'; |
---|
47 | } |
---|
48 | else |
---|
49 | { |
---|
50 | foreach ($_POST['settings'] as $setting) |
---|
51 | { |
---|
52 | $id = explode('|',$setting); |
---|
53 | cleanconfig::delete($id[0],$id[1],$limit); |
---|
54 | } |
---|
55 | $msg = '<div class="message"><p>'. |
---|
56 | |
---|
57 | http::redirect($p_url.'&settingsdeleted=1&limit='.$limit); |
---|
58 | } |
---|
59 | } |
---|
60 | |
---|
61 | if (isset($_GET['settingsdeleted'])) |
---|
62 | { |
---|
63 | $msg = __('The selected settings have been deleted.'); |
---|
64 | |
---|
65 | $default_tab = $limit.'_settings'; |
---|
66 | } |
---|
67 | |
---|
68 | ?> |
---|
69 | <html> |
---|
70 | <head> |
---|
71 | <title><?php echo $page_title; ?></title> |
---|
72 | <?php echo dcPage::jsPageTabs($default_tab); ?> |
---|
73 | <style type="text/css"> |
---|
74 | .ns-name { background: #ccc; color: #000; padding-top: 0.3em; padding-bottom: 0.3em; font-size: 1.1em; } |
---|
75 | </style> |
---|
76 | <!-- from /dotclear/plugins/widgets --> |
---|
77 | <script type="text/javascript"> |
---|
78 | //<![CDATA[ |
---|
79 | <?php echo dcPage::jsVar('dotclear.msg.confirm_cleanconfig_delete', |
---|
80 | __('Are you sure you want to delete settings?')); ?> |
---|
81 | $(document).ready(function() { |
---|
82 | $('.checkboxes-helpers').each(function() { |
---|
83 | dotclear.checkboxesHelpers(this); |
---|
84 | }); |
---|
85 | $('input[name="delete"]').click(function() { |
---|
86 | return window.confirm(dotclear.msg.confirm_cleanconfig_delete); |
---|
87 | }); |
---|
88 | $('td[class="ns-name"]').css({ cursor:"pointer" }); |
---|
89 | $('td[class="ns-name"]').click(function() { |
---|
90 | $("."+$(this).children().filter("strong").text()).toggleCheck(); |
---|
91 | return false; |
---|
92 | }); |
---|
93 | }); |
---|
94 | //]]> |
---|
95 | </script> |
---|
96 | </head> |
---|
97 | <body> |
---|
98 | <?php |
---|
99 | echo dcPage::breadcrumb( |
---|
100 | array( |
---|
101 | html::escapeHTML($core->blog->name) => '', |
---|
102 | '<span class="page-title">'.$page_title.'</span>' => '' |
---|
103 | )); |
---|
104 | if (!empty($msg)) { |
---|
105 | dcPage::success($msg); |
---|
106 | } |
---|
107 | ?> |
---|
108 | |
---|
109 | <div class="multi-part" id="blog_settings" title="<?php echo __('Blog settings'); ?>"> |
---|
110 | <?php echo(cleanconfig::settings('blog')); ?> |
---|
111 | </div> |
---|
112 | |
---|
113 | <div class="multi-part" id="global_settings" title="<?php echo __('Global settings'); ?>"> |
---|
114 | <?php echo(cleanconfig::settings('global')); ?> |
---|
115 | </div> |
---|
116 | |
---|
117 | <div class="multi-part" id="versions" title="<?php echo __('Versions'); ?>"> |
---|
118 | <p><?php printf(__('This function has been moved to the %s plugin.'), |
---|
119 | '<a href="http://plugins.dotaddict.org/dc2/details/versionsManager">'. |
---|
120 | __('Versions Manager').'</a>'); ?></p> |
---|
121 | </div> |
---|
122 | |
---|
123 | </body> |
---|
124 | </html> |
---|