source: extensions/FCKEditor/main.inc.php @ 12153

Last change on this file since 12153 was 4630, checked in by patdenice, 14 years ago

[Plugin][FCK Editor]
Add editor to page banner edition.
Allow to add FCK Editor instance in any plugin.

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