root / drupal7 / sites / all / modules / ckeditor / ckeditor.api.php @ 0695d136
1 |
<?php
|
---|---|
2 |
|
3 |
/**
|
4 |
* CKEditor - The text editor for the Internet - http://ckeditor.com
|
5 |
* Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
6 |
*
|
7 |
* == BEGIN LICENSE ==
|
8 |
*
|
9 |
* Licensed under the terms of any of the following licenses of your
|
10 |
* choice:
|
11 |
*
|
12 |
* - GNU General Public License Version 2 or later (the "GPL")
|
13 |
* http://www.gnu.org/licenses/gpl.html
|
14 |
*
|
15 |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
16 |
* http://www.gnu.org/licenses/lgpl.html
|
17 |
*
|
18 |
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
19 |
* http://www.mozilla.org/MPL/MPL-1.1.html
|
20 |
*
|
21 |
* == END LICENSE ==
|
22 |
*
|
23 |
* @file
|
24 |
* CKEditor Module for Drupal 7.x
|
25 |
*
|
26 |
* This module allows Drupal to replace textarea fields with CKEditor.
|
27 |
*
|
28 |
* CKEditor is an online rich text editor that can be embedded inside web pages.
|
29 |
* It is a WYSIWYG (What You See Is What You Get) editor which means that the
|
30 |
* text edited in it looks as similar as possible to the results end users will
|
31 |
* see after the document gets published. It brings to the Web popular editing
|
32 |
* features found in desktop word processors such as Microsoft Word and
|
33 |
* OpenOffice.org Writer. CKEditor is truly lightweight and does not require any
|
34 |
* kind of installation on the client computer.
|
35 |
*/
|
36 |
|
37 |
/**
|
38 |
* Hook to register the CKEditor plugin - it would appear in the plugins list on the profile setting page.
|
39 |
*/
|
40 |
function hook_ckeditor_plugin() { |
41 |
return array( |
42 |
'plugin_name' => array( |
43 |
// Name of the plugin used to write it.
|
44 |
'name' => 'plugin_name', |
45 |
// Description of the plugin - it would be displayed in the plugins management section of profile settings.
|
46 |
'desc' => t('Plugin description'), |
47 |
// The full path to the CKEditor plugins directory, with the trailing slash.
|
48 |
'path' => drupal_get_path('module', 'my_module') . '/plugin_dir/', |
49 |
'buttons' => array( |
50 |
'button_name' => array( |
51 |
'icon' => 'path to button icon', |
52 |
'label' => 'Button Label', |
53 |
) |
54 |
) |
55 |
) |
56 |
); |
57 |
} |
58 |
|
59 |
/**
|
60 |
* Hook to register the CKEditor security filter - it would appear in the security filters list on the profile setting page.
|
61 |
*/
|
62 |
function hook_ckeditor_security_filter() { |
63 |
return array( |
64 |
'security_filter_name' => array( |
65 |
// Title of the security filter - it would be displayed in the security filters section of profile settings.
|
66 |
'title' => t('Security filter title'), |
67 |
// Description of the security filter - it would be displayed in the security filters section of profile settings.
|
68 |
'description' => t('Security filter description'), |
69 |
) |
70 |
); |
71 |
} |
72 |
|
73 |
/**
|
74 |
* Hook to alter CKEditor security filters.
|
75 |
*/
|
76 |
function hook_ckeditor_security_filter_alter(&$security_filters) { |
77 |
// Modify a $security_filter.
|
78 |
} |
79 |
|
80 |
/**
|
81 |
* Hook to extend/change the ckeditor settings.
|
82 |
*
|
83 |
* This hook is invoked from ckeditor_profile_settings_compile(). The settings
|
84 |
* may be customized or enhanced; typically with options that cannot be
|
85 |
* controlled though the administrative UI from the ckeditor module.
|
86 |
*
|
87 |
* @param $settings
|
88 |
* An associative array of settings.
|
89 |
* @param $conf
|
90 |
* An associative array with access to raw profile settings that might be helpful to alter the real $settings.
|
91 |
*/
|
92 |
function hook_ckeditor_settings_alter(&$settings, $conf) { |
93 |
// Change the ckeditor config path.
|
94 |
$settings['customConfig'] = drupal_get_path('module', 'ckeditor') . '/ckeditor.config.js'; |
95 |
} |
96 |
|
97 |
/**
|
98 |
* Hook that allows to alter the user default settings.
|
99 |
*
|
100 |
* @param $settings
|
101 |
* An associative array of settings.
|
102 |
*/
|
103 |
function hook_ckeditor_default_settings_alter(&$settings) { |
104 |
$settings['show_toggle'] = 'f'; |
105 |
} |
106 |
|
107 |
/**
|
108 |
* Hook to extend CKEditor security allowed tags list.
|
109 |
*
|
110 |
* This hook is invoked from ckeditor_filter_xss() where text is filtered from potentially insecure tags.
|
111 |
*/
|
112 |
function hook_ckeditor_filter_xss_allowed_tags() { |
113 |
// Return an array of additional allowed tags
|
114 |
} |