1 | <?php |
---|
2 | # ***** BEGIN LICENSE BLOCK ***** |
---|
3 | # |
---|
4 | # This file is part of TinyMCE, a plugin for Dotclear 2 |
---|
5 | # Copyright 2010 Moe (http://gniark.net/) |
---|
6 | # |
---|
7 | # TinyMCE 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 | # TinyMCE 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 | # ***** END LICENSE BLOCK ***** |
---|
21 | |
---|
22 | if (!defined('DC_CONTEXT_ADMIN')) {exit;} |
---|
23 | |
---|
24 | # post |
---|
25 | $core->addBehavior('adminPostNavLinks', |
---|
26 | array('tinyMceAdmin','adminPostNavLinks')); |
---|
27 | |
---|
28 | # page |
---|
29 | $core->addBehavior('adminPageNavLinks', |
---|
30 | array('tinyMceAdmin','adminPageNavLinks')); |
---|
31 | |
---|
32 | class tinyMceAdmin |
---|
33 | { |
---|
34 | public static function adminPostNavLinks($post) |
---|
35 | { |
---|
36 | # don't display anything if this is a new post |
---|
37 | $post_title = $post->post_title; |
---|
38 | if (!isset($post_title)) {return;} |
---|
39 | |
---|
40 | echo('<p>'. |
---|
41 | '<a href="plugin.php?p=tinyMce&type=post&id='.$post->post_id.'"'. |
---|
42 | ' class="button" id="tinyMce">'.__('Edit this post with TinyMCE').'</a>'. |
---|
43 | '</p>'); |
---|
44 | } |
---|
45 | |
---|
46 | public static function adminPageNavLinks($post) |
---|
47 | { |
---|
48 | # don't display anything if this is a new page |
---|
49 | $post_title = $post->post_title; |
---|
50 | if (!isset($post_title)) {return;} |
---|
51 | |
---|
52 | echo('<p>'. |
---|
53 | '<a href="plugin.php?p=tinyMce&type=page&id='.$post->post_id.'"'. |
---|
54 | ' class="button" id="tinyMce">'.__('Edit this post with TinyMCE').'</a>'. |
---|
55 | '</p>'); |
---|
56 | } |
---|
57 | } |
---|
58 | |
---|
59 | ?> |
---|