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 | class blocNotes |
---|
25 | { |
---|
26 | public static function adminDashboardIcons(&$core, &$icons) |
---|
27 | { |
---|
28 | $icons['blocNotes'] = array(__('Notebook'),'plugin.php?p=blocNotes', |
---|
29 | 'index.php?pf=blocNotes/icon-big.png'); |
---|
30 | } |
---|
31 | |
---|
32 | public static function form() |
---|
33 | { |
---|
34 | global $core; |
---|
35 | |
---|
36 | echo '<p class="area" id="blocNotes_personal">'. |
---|
37 | '<label for="blocNotes_personal_text">'. |
---|
38 | __('Personal notebook (other users can\'t edit it) :'). |
---|
39 | '</label>'. |
---|
40 | form::textarea('blocNotes_personal_text',80,5, |
---|
41 | html::escapeHTML($core->blog->settings->{'blocNotes_text_'.$core->auth->userID()})). |
---|
42 | '</p>'. |
---|
43 | '<p class="area" id="blocNotes">'. |
---|
44 | '<label for="blocNotes_text">'. |
---|
45 | __('Blog-specific notebook (users of the blog can edit it) :'). |
---|
46 | '</label>'. |
---|
47 | form::textarea('blocNotes_text',80,5, |
---|
48 | html::escapeHTML($core->blog->settings->blocNotes_text)). |
---|
49 | '</p>'. |
---|
50 | '<p>'. |
---|
51 | __('These notes may be read by anyone, don\'t write some sensitive information (password, personal information, etc.)'). |
---|
52 | '</p>'; |
---|
53 | } |
---|
54 | |
---|
55 | public static function putSettings() |
---|
56 | { |
---|
57 | global $core; |
---|
58 | |
---|
59 | if (isset($_POST['blocNotes_text'])) |
---|
60 | { |
---|
61 | $core->blog->settings->setNameSpace('blocnotes'); |
---|
62 | # Bloc-Notes' text |
---|
63 | $core->blog->settings->put('blocNotes_text_'.$core->auth->userID(), |
---|
64 | $_POST['blocNotes_personal_text'],'text','Bloc-Notes\' personal text',true,true); |
---|
65 | $core->blog->settings->put('blocNotes_text', |
---|
66 | $_POST['blocNotes_text'],'text','Bloc-Notes\' text'); |
---|
67 | } |
---|
68 | } |
---|
69 | |
---|
70 | public static function adminPostHeaders() |
---|
71 | { |
---|
72 | return '<script type="text/javascript" src="index.php?pf=blocNotes/post.js">'. |
---|
73 | '</script>'."\n"; |
---|
74 | } |
---|
75 | } |
---|
76 | |
---|
77 | ?> |
---|