Dotclear

source: plugins/previewpost/_admin.php @ 459

Revision 459, 1.5 KB checked in by sacha, 15 years ago (diff)

Ajout des vérifications pour éviter l'exécution des plugins en dehors de Dotclear

RevLine 
[356]1<?php
2# ***** BEGIN LICENSE BLOCK *****
3# This file is part of DotClear Preview plugin.
4# Copyright (c) 2008 Bruno Hondelatte,  and contributors.
5# Many, many thanks to Olivier Meunier and the Dotclear Team.
6# All rights reserved.
7#
8# Preview plugin for DC2 is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2 of the License, or
11# (at your option) any later version.
12#
13# DotClear is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with DotClear; if not, write to the Free Software
20# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21#
22# ***** END LICENSE BLOCK *****
[459]23if (!defined('DC_CONTEXT_ADMIN')) { return; }
24
[361]25require dirname(__FILE__).'/_widgets.php';
[356]26
27$core->addBehavior('adminPostHeaders',array('previewBehaviors','postHeaders'));
28
29
30class previewBehaviors {
31     public static function postHeaders()
32     {
33          global $post_url,$core;
[361]34          return '<script type="text/javascript" src="index.php?pf=preview/js/post.js"></script>'.
[356]35          '<script type="text/javascript">'."\n".
36          "//<![CDATA[\n".
37          "dotclear.preview_url = '".$core->blog->url.'preview/'.html::sanitizeURL($post_url)."';\n".
38          "dotclear.msg.preview = '".__('Preview post')."';".
39          "\n//]]>\n".
40          "</script>\n";
41     }
42}
[459]43?>
Note: See TracBrowser for help on using the repository browser.

Sites map