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

Last change on this file since 3417 was 3295, checked in by patdenice, 15 years ago

New extension added:
FCK Editor (2.0.a)

File size: 1.3 KB
Line 
1<?php
2/*
3Plugin Name: FCK Editor
4Version: 2.0.a
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  add_event_handler('loc_begin_page_header', 'load_fckeditor_script');
18 
19  function load_fckeditor_script()
20  {
21    global $page, $template, $sections;
22   
23    if (!isset($page['page']) or $page['page'] != 'plugin') return;
24    $section = implode('/', $sections);
25
26    // Additional pages
27    if ($section == 'AdditionalPages/admin/add_page.php')
28    {
29      $area = 'ap_content';
30    }
31    // PWG Stuffs
32    elseif ($section == 'PWG_Stuffs/admin/add_module.php' and $_GET['type'] == 'Personal')
33    {
34      $area = 'personal_content';
35    }
36    else return;
37
38    $template->append('head_elements', '
39<script type="text/javascript" src="'.FCK_PATH.'/fckeditor.js"></script>
40<script type="text/javascript">
41window.onload = function()
42{
43  var oFCKeditor = new FCKeditor( \''.$area.'\' ) ;
44  oFCKeditor.BasePath = "'.FCK_PATH.'" ;
45  oFCKeditor.Height = 400;
46  oFCKeditor.Width = \'100%\';
47  oFCKeditor.ReplaceTextarea() ;
48}
49</script>');
50  }
51}
52
53?>
Note: See TracBrowser for help on using the repository browser.