Fix for deprecated usage of menu_set_location (200680)
[project/fckeditor.git] / README.txt
CommitLineData
e44c2389 1$Id$
2
d739bfad
JT
3Overview
4--------
0c87a920
WW
5This module allows Drupal to replace textarea fields with the
6FCKeditor.
7This HTML text editor brings many of the powerful functions of known
8desktop editors like Word to the web. It's relatively lightweight and
9doesn't require any kind of installation on the client computer.
e44c2389 10
11Compatibility
12-------------
0c87a920
WW
13The integrated File Browser needs a bit of manual configuration,
14more information about this in the included in this readme.txt file
ebc6fdec 15
e44c2389 16Required components
17-------------------
18To use FCKeditor in Drupal, you will need to download the FCKeditor
19http://www.fckeditor.net/
f3d88ca0 20
e44c2389 21More information and licence
22----------------------------
d739bfad 23FCKeditor - The text editor for internet
f3d88ca0 24Copyright (C) 2003-2006 Frederico Caldeira Knabben
ebc6fdec 25
d739bfad 26Licensed under the terms of the GNU Lesser General Public License:
e44c2389 27 http://www.opensource.org/licenses/lgpl-license.php
d739bfad
JT
28
29For further information visit:
e44c2389 30 http://www.fckeditor.net/
d739bfad
JT
31
32Requirements
33------------
9b429add 34 - Drupal 5.x
e44c2389 35 - PHP 4.3.0 or greater
0c87a920 36 - FCKeditor 2.3.x or greater (http://www.fckeditor.net/)
63a392a2 37
d739bfad
JT
38Installation
39------------
f3d88ca0 40 1. Copy the module fckeditor folder to modules/.
0c87a920
WW
41 2. Download FCKeditor from http://www.fckeditor.net and copy
42 the distribution files (the contents of the "fckeditor" directory
43 from the FCKeditor distribution file) to
44 modules/fckeditor/fckeditor.
45
46 A quick check to see if it is correct: the files 'COPY_HERE.txt',
47 'fckconfig.js' and also the directory 'editor' must exist in the
48 same directory,
49
50 The correct directory structure is as follows:
51
52 modules
53 |--fckeditor
54 |--fckeditor
55 |--_samples
56 |--editor
57
b683d2b1 58 3. See 'How to enable the File Browser' for additional instructions.
d739bfad 59
0c87a920
WW
60 Also read the security note in this readme
61
62 Alternatives to the built-in file browser are the IMCE module and
63 copying the image url into the url textfield.
64
d739bfad
JT
65Configuration
66-------------
0c87a920
WW
67 1. Modify the fckeditor.config.js file to customize the toolbars to
68 your needs (optional).
69
70 You may also copy the needed configuration lines from the default
71 FCKeditor configuration settings
72 (modules/fckeditor/fckeditor/fckconfig.js), the lines in
73 fckeditor.config.js will override most settings.
74
75 It is not advised to change the default toolbars in the
76 configuration settings (modules/fckeditor/fckeditor/fckconfig.js)
77 because those are included in the FCKeditor package and might
78 change without notice when you update the editor.
79
e44c2389 80 2. Enable the module as usual from Drupal's admin pages.
0c87a920
WW
81
82 3. Grant permissions for use of FCKeditor in
83 Administer > User Management > Access Control
84
85 4. Under Administer > Settings > FCKeditor, create the fckeditor
86 profiles. In each profile you can choose which textareas will be replaced by
87 FCKeditor, select default toolbar and configure some more advanced
88 settings.
ebc6fdec 89
0c87a920
WW
90 5. For the Rich Text Editing to work you also need to configure your
91 filters for the users that may access Rich Text Editing. Either
92 grant those users Full HTML access or use the following:
93
94 <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area>
95 <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em>
96 <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote>
97 <pre> <address> <code> <cite> <embed> <object> <strike> <caption>
98
99 6. To have a better control over line breaks, you may disable "Line break converter"
100 in the chosen filter.
101
102How to enable the File Browser
ebc6fdec 103---------------------------------------------------
0c87a920
WW
104The editor gives the end user the flexibility to create a custom file
105browser that can be integrated on it. The included file browser allows
106users to view the content of a specific directory on the server and
107add new content to that directory (create folders and upload files).
ebc6fdec 108
0c87a920
WW
109To enable the file browser you need to edit the connector
110configuration file in your fckeditor module directory, the file should
111be in:
112/modules/fckeditor/fckeditor/editor/filemanager/browser/default/connectors/php/config.php
113and
114/modules/fckeditor/fckeditor/editor/filemanager/upload/php/config.php
115(FCKeditor 2.3.x - 2.4.x)
ebc6fdec 116
0c87a920 117or
ebc6fdec 118
0c87a920
WW
119/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php
120(FCKeditor 2.5+)
ebc6fdec 121
0c87a920
WW
122In this file you will need to enable the file browser:
123$Config['Enabled'] = true ;
124
125To use the drupal files directory you also need to adjust the following
126variables in the connector configuration:
127 $Config['UserFilesPath']
128and:
129 $Config['UserFilesAbsolutePath']
130
131Furthermore, you will need to create a "File", "Image", "Flash" and
132"Media" subdirectory in your drupal files directory. These directories
133must have the same privileges as the drupal files directory. In some
134cases these directories must be world writable (chmod 0777).
ebc6fdec 135
0c87a920
WW
136Security
137--------
138Note that enabling file uploads is a security risk. That's why there
139is a separate permission in Administer > Access Control for enabling
140the file browser to certain groups.
141
142Making File Browser more secure
143-------------------------------
144Please be aware that enabling file browser simply by setting
145 $Config['Enabled'] = true ;
146theoretically enables it for each user (with a little bit of hackery,
147it is possible to use file browser without appropiate Drupal permissions).
148The more secure way of enabling file browser:
149
150 1. instead of setting
151 $Config['Enabled'] = true ;
152 add the following code:
153
154 $drupal_path = "../../../../../../../../..";
155 if(!file_exists($drupal_path . '/includes/bootstrap.inc')) {
156 $drupal_path = "../..";
157 do {
158 $drupal_path .= "/..";
159 $depth = substr_count($drupal_path, "..");
160 false;
161 }
162 while(!($bootstrapFileFound = file_exists($drupal_path . '/includes/bootstrap.inc')) && $depth<10);
163 }
164 if (!isset($bootstrapFileFound) || $bootstrapFileFound) {
165 $cwd = getcwd();
166 chdir($drupal_path);
167 require_once './includes/bootstrap.inc';
168 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
169 $Config['Enabled'] = user_access('allow fckeditor file uploads');
170 chdir($cwd);
171 }
172
173 straight after
174 $Config['Enabled'] = false ;
175
176 This code enables file browser only to users that have "allow fckeditor file uploads" permission.
177 note: if you don't set $drupal_path correctly, FCKeditor will find it out by itself.
178
179 2. as of Drupal 5.2, additional step is required:
180 locate file named settings.php inside your drupal directory
181 (usually sites/default/settings.php)
182 and set $cookie_domain variable to the appropiate domain.
183 (remember to uncomment that line)
184
185Plugins: Teaser break and Pagebreak
186-----------------------------------
187By default, FCKeditor module comes with two plugins that can handle teaser break (<!--break-->) and pagebreak (<!--pagebreak-->).
188You can enable any (or even both) of them.
189To do this, open fckeditor.config.js and uncomment these three lines:
190
191 FCKConfig.PluginsPath = '../../plugins/' ;
192 FCKConfig.Plugins.Add( 'drupalbreak' ) ;
193 FCKConfig.Plugins.Add( 'drupalpagebreak' )
194
195The second step is to add the buttons to toolbar (in the same file).
196The button names are: DrupalBreak, DrupalPageBreak;
197
198For example if you have a toolbar with an array of buttons defined as follows:
199 ['Image','Flash','Table','Rule','SpecialChar']
200simply add those two buttons at the end of array:
201 ['Image','Flash','Table','Rule','SpecialChar', 'DrupalBreak', 'DrupalPageBreak']
202(remember about single quotes).
203
204Help & Contribution
205-------------------
206If you are looking for more information, have any troubles in configuration or if
207you found an issue, please visit the official project page:
208 http://drupal.org/project/fckeditor
209
210We would like to encourage you to join our team if you can help in any way.
211If you can translate FCKeditor module, please use fckeditor.pot file as a template
212(located in "po" directory) and send us the translated file so that we could attach it.
213Any help is appreciated.
214
d739bfad
JT
215Credits
216-------
9fd81688 217 - FCKeditor for Drupal Core functionality originally written by:
f3d88ca0 218 Frederico Caldeira Knabben
219 Jorge Tite (LatPro Inc.)
220
0c87a920 221 - FCKeditor for Drupal 5.x originally written by:
f3d88ca0 222 Ontwerpwerk (www.ontwerpwerk.nl)
0c87a920
WW
223
224 - FCKeditor for Drupal 5.x is currently maintained by FCKeditor team.
225 http://www.fckeditor.net/
f3d88ca0 226
9fd81688 227 - FCKeditor - The text editor for internet
f3d88ca0 228 Copyright (C) 2003-2006 Frederico Caldeira Knabben
9fd81688 229 http://www.fckeditor.net/