1 | <?php |
---|
2 | # ***** BEGIN LICENSE BLOCK ***** |
---|
3 | # |
---|
4 | # This file is part of Bloc-Notes. |
---|
5 | # Copyright 2008 Moe (http://gniark.net/) |
---|
6 | # |
---|
7 | # Bloc-Notes is free software; you can redistribute it and/or modify |
---|
8 | # it under the terms of the GNU General Public License as published by |
---|
9 | # the Free Software Foundation; either version 3 of the License, or |
---|
10 | # (at your option) any later version. |
---|
11 | # |
---|
12 | # Bloc-Notes is distributed in the hope that it will be useful, |
---|
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | # GNU General Public License for more details. |
---|
16 | # |
---|
17 | # You should have received a copy of the GNU General Public License |
---|
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
19 | # |
---|
20 | # Icon (icon.png) is from Silk Icons : http://www.famfamfam.com/lab/icons/silk/ |
---|
21 | # |
---|
22 | # ***** END LICENSE BLOCK ***** |
---|
23 | |
---|
24 | if (!defined('DC_CONTEXT_ADMIN')) { exit; } |
---|
25 | |
---|
26 | try |
---|
27 | { |
---|
28 | if (!empty($_POST['saveconfig'])) |
---|
29 | { |
---|
30 | $core->blog->settings->setNameSpace('blocnotes'); |
---|
31 | # Bloc-Notes' text |
---|
32 | $core->blog->settings->put('blocNotes_text', |
---|
33 | $_POST['blocNotes_text'],'text','Bloc-Notes\' text'); |
---|
34 | http::redirect($p_url.'&saveconfig=1'); |
---|
35 | } |
---|
36 | } |
---|
37 | catch (Exception $e) |
---|
38 | { |
---|
39 | $core->error->add($e->getMessage()); |
---|
40 | } |
---|
41 | |
---|
42 | if (isset($_GET['saveconfig'])) |
---|
43 | { |
---|
44 | $msg = __('Configuration successfully updated.'); |
---|
45 | } |
---|
46 | |
---|
47 | ?> |
---|
48 | <html> |
---|
49 | <head> |
---|
50 | <title><?php echo __('Bloc-notes'); ?></title> |
---|
51 | <?php echo dcPage::jsPageTabs($default_tab); ?> |
---|
52 | <style type="text/css"> |
---|
53 | textarea {width:100%;} |
---|
54 | </style> |
---|
55 | </head> |
---|
56 | <body> |
---|
57 | |
---|
58 | <h2><?php echo html::escapeHTML($core->blog->name).' > '.__('Bloc-notes'); ?></h2> |
---|
59 | |
---|
60 | <?php |
---|
61 | if (!empty($msg)) {echo '<div class="message">'.$msg.'</div><p></p>';} |
---|
62 | ?> |
---|
63 | |
---|
64 | <div id="settings" title="<?php echo __('settings'); ?>"> |
---|
65 | <form method="post" action="<?php echo http::getSelfURI(); ?>"> |
---|
66 | <fieldset> |
---|
67 | <legend><?php echo(__('Personal text, writable by you only')); ?></legend> |
---|
68 | <?php echo(blocNotes::textarea()); ?> |
---|
69 | </fieldset> |
---|
70 | <?php /* |
---|
71 | <fieldset> |
---|
72 | <legend><?php echo(__('Personal text, writable by you only')); ?></legend> |
---|
73 | <?php echo(blocNotes::textarea('personal')); ?> |
---|
74 | </fieldset> |
---|
75 | <fieldset> |
---|
76 | <legend><?php echo(__('Blog-specific text, all the users can edit it')); ?></legend> |
---|
77 | <?php echo(blocNotes::textarea('blog')); ?> |
---|
78 | </fieldset> |
---|
79 | <p><?php echo __('These texts will be readable by all the users, don't write some'); ?></p> |
---|
80 | */ ?> |
---|
81 | |
---|
82 | <p><?php echo $core->formNonce(); ?></p> |
---|
83 | <p><input type="submit" name="saveconfig" value="<?php echo __('Save configuration'); ?>" /></p> |
---|
84 | </form> |
---|
85 | </div> |
---|
86 | |
---|
87 | </body> |
---|
88 | </html> |
---|