1 | <?php |
---|
2 | # ***** BEGIN LICENSE BLOCK ***** |
---|
3 | # |
---|
4 | # This file is part of Wiki Tables, a plugin for Dotclear 2 |
---|
5 | # Copyright (C) 2009,2010 Moe (http://gniark.net/) |
---|
6 | # |
---|
7 | # Wiki Tables 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 | # Wiki Tables 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 License |
---|
17 | # along with this program; if not, write to the Free Software Foundation, |
---|
18 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
19 | # |
---|
20 | # Icon (icon.png) is from Silk Icons : |
---|
21 | # http://www.famfamfam.com/lab/icons/silk/ |
---|
22 | # |
---|
23 | # ***** END LICENSE BLOCK ***** |
---|
24 | |
---|
25 | if (!defined('DC_CONTEXT_ADMIN')) {return;} |
---|
26 | |
---|
27 | l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/admin'); |
---|
28 | |
---|
29 | $core->addBehavior('adminPostHeaders', |
---|
30 | array('wikiTablesAdmin','postHeaders')); |
---|
31 | |
---|
32 | # modified from the YASH plugin |
---|
33 | $core->addBehavior('coreInitWikiPost', |
---|
34 | array('wikiTablesAdmin','coreInitWikiPost')); |
---|
35 | |
---|
36 | class wikiTablesAdmin |
---|
37 | { |
---|
38 | public static function coreInitWikiPost($wiki2xhtml) |
---|
39 | { |
---|
40 | $wiki2xhtml->registerFunction('macro:table', |
---|
41 | array('wikiTables','transform')); |
---|
42 | } |
---|
43 | |
---|
44 | # /modified from the YASH plugin |
---|
45 | |
---|
46 | public static function postHeaders() |
---|
47 | { |
---|
48 | return('<script type="text/javascript" '. |
---|
49 | 'src="index.php?pf=wikiTables/js/post.js"></script>'. |
---|
50 | |
---|
51 | '<script type="text/javascript">'."\n". |
---|
52 | "//<![CDATA[\n". |
---|
53 | dcPage::jsVar('jsToolBar.prototype.elements.wiki_table.title', |
---|
54 | __('Wiki Table')). |
---|
55 | "\n//]]>\n". |
---|
56 | "</script>\n"); |
---|
57 | } |
---|
58 | } |
---|
59 | |
---|
60 | ?> |
---|