Last change
on this file since 4094 was
3609,
checked in by patdenice, 15 years ago
|
Convert all php and tpl files in Unix format for my plugins.
|
File size:
1.3 KB
|
Line | |
---|
1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: FCK Editor |
---|
4 | Version: 2.0.a |
---|
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 | if (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"> |
---|
41 | window.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.