Line | |
---|
1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: FCK Editor |
---|
4 | Version: auto |
---|
5 | Description: WYSIWYG editor. |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=264 |
---|
7 | Author: P@t |
---|
8 | Author URI: http://www.gauchon.com |
---|
9 | */ |
---|
10 | |
---|
11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
12 | |
---|
13 | define('FCK_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); |
---|
14 | |
---|
15 | add_event_handler('loading_lang', 'FCK_loading_lang'); |
---|
16 | function FCK_loading_lang(){ |
---|
17 | load_language('plugin.lang', FCK_PATH); |
---|
18 | } |
---|
19 | |
---|
20 | |
---|
21 | if (script_basename() == 'admin') |
---|
22 | { |
---|
23 | include(FCK_PATH.'fckeditor.php'); |
---|
24 | } |
---|
25 | |
---|
26 | function set_fckeditor_instance($areas=array(), $toolbar='Basic', $width='750px', $height='200px') |
---|
27 | { |
---|
28 | global $template, $conf; |
---|
29 | |
---|
30 | if (is_string($areas)) |
---|
31 | { |
---|
32 | $areas = array($areas); |
---|
33 | } |
---|
34 | if (!($config = unserialize($conf['FCKEditor']))) |
---|
35 | { |
---|
36 | $config = array(); |
---|
37 | } |
---|
38 | $template->set_filename('fckeditor', realpath(FCK_PATH.'fckeditor.tpl')); |
---|
39 | $template->assign( |
---|
40 | array( |
---|
41 | 'FCK_PATH' => FCK_PATH, |
---|
42 | 'FCK_config' => $config, |
---|
43 | 'FCK_areas' => $areas, |
---|
44 | 'FCK_WIDTH' => $width, |
---|
45 | 'FCK_HEIGHT' => $height, |
---|
46 | 'FCK_TOOLBAR' => $toolbar, |
---|
47 | ) |
---|
48 | ); |
---|
49 | $template->parse('fckeditor'); |
---|
50 | } |
---|
51 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.