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')) {return;} |
---|
23 | |
---|
24 | if (isset($_GET['tinyMce_file'])) |
---|
25 | { |
---|
26 | $f = dirname(__FILE__).'/js/tiny_mce_jquery/'.$_GET['tinyMce_file']; |
---|
27 | |
---|
28 | if (!is_file($f) || !is_readable($f)) { |
---|
29 | header('Content-Type: text/plain'); |
---|
30 | http::head(404,'Not Found'); |
---|
31 | exit; |
---|
32 | } |
---|
33 | http::$cache_max_age = 7200; |
---|
34 | http::cache(array_merge(array($f),get_included_files())); |
---|
35 | |
---|
36 | header('Content-Type: '.files::getMimeType($f)); |
---|
37 | header('Content-Length: '.filesize($f)); |
---|
38 | readfile($f); |
---|
39 | } |
---|
40 | else |
---|
41 | { |
---|
42 | if (isset($_GET['type']) && ($_GET['type'] == 'page')) |
---|
43 | { |
---|
44 | require_once(dirname(__FILE__).'/admin/page.php'); |
---|
45 | } |
---|
46 | else |
---|
47 | { |
---|
48 | require_once(dirname(__FILE__).'/admin/post.php'); |
---|
49 | } |
---|
50 | } |
---|
51 | |
---|
52 | exit; |
---|
53 | |
---|
54 | ?> |
---|