[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/ckeditor/ -> README.txt (source)

   1  TABLE OF CONTENTS
   2  -----------------
   3   * Overview
   4   * More Information and License
   5   * Requirements
   6   * Installation Paths
   7   * Installation / Configuration
   8   * Installation Troubleshooting
   9   * Uploading Images and Files
  10   * Installing CKFinder
  11   * Managing Plugins
  12   * Installing Additional Plugins
  13   * Integrating a Plugin with the CKEditor Module (for Plugin Developers)
  14   * Setting up Filters
  15   * Upgrading Instructions (Migration from FCKeditor)
  16   * Upgrading Instructions (CKEditor)
  17   * Help & Contribution
  18   * Credits
  19  
  20  Overview
  21  --------
  22  This module allows Drupal to replace textarea fields with CKEditor.
  23  CKEditor is an online rich text editor that can be embedded inside web pages.
  24  It is a WYSIWYG (What You See Is What You Get) editor which means that the
  25  text edited in it looks as similar as possible to the results end users will
  26  see after the document gets published. It brings to the Web popular editing
  27  features found in desktop word processors such as Microsoft Word and
  28  OpenOffice.org Writer. CKEditor is truly lightweight and does not require any
  29  kind of installation on the client computer.
  30  
  31  More Information and License
  32  ----------------------------
  33  CKEditor - The text editor for the Internet
  34  Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
  35  
  36  Licensed under the terms of the GNU Lesser General Public License:
  37      http://www.opensource.org/licenses/lgpl-license.php
  38  
  39  For further information visit:
  40      http://ckeditor.com/
  41  
  42  Requirements
  43  ------------
  44    - Drupal 6.x,
  45    - PHP 4.4.0 or greater (5.2 recommended),
  46    - CKEditor 3.4 or greater.
  47      You will need to download CKEditor from the official download site: http://ckeditor.com/download.
  48      It is recommended to always use the latest CKEditor version available.
  49  
  50  Installation Paths
  51  ------------------
  52  It is recommended to install the CKEditor for Drupal module in the "sites/all/modules" directory.
  53  
  54  When adding the files for standalone CKEditor and CKFinder, you can use one of the following directories:
  55  - "sites/all/modules/ckeditor/"
  56  - "sites/all/libraries/"
  57  and create a "ckeditor" or "ckfinder" directory inside.
  58  
  59  The CKEditor module will automatically recognize the proper path to the editor and the file browser.
  60  
  61  All installation and configuration instructions in this README file assume that you use the first option and place the CKEditor and CKFinder files in the "sites/all/modules/ckeditor/" directory. If you want to use the "sites/all/libraries/" directory, you will need to adjust the paths given in the instructions accordingly.
  62  
  63  Installation / Configuration
  64  ----------------------------
  65  Note: these instructions assume that you install the CKEditor for Drupal module in the
  66        "sites/all/modules" directory (recommended).
  67  
  68     1. Unzip the module files to the "sites/all/modules" directory. It should now
  69        contain a "ckeditor" directory.
  70     2. Download standalone CKEditor from http://ckeditor.com/download. Unzip the
  71        contents of the "ckeditor" directory from the installation package to the
  72        "sites/all/modules/ckeditor/ckeditor" (or "sites/all/libraries/ckeditor") directory.
  73        Note: you can skip uploading the "_samples" and "_source" folders.
  74     3. Enable the module in the "Administration panel > Modules > User Interface" section.
  75     4. Grant permissions for using CKEditor in the
  76        "Administer > User Management > Permissions" section.
  77        Note: In order to enable the file browser, refer to the
  78              "Installing CKFinder" section.
  79     5. Adjust CKEditor profiles in the
  80        "Administer > Site configuration > CKEditor" section.
  81        Profiles determine which options are available to users based on the input format system.      
  82        NOTE: User 1 must be assigned a system role that corresponds to the privileges required.
  83        If no role is assigned to User 1, they will have the privileges of "authenticated user".
  84     6. For the Rich Text Editing to work you also need to configure your filters
  85        for the users that may access Rich Text Editing.
  86        Either grant those users Full HTML access or use the following tags:
  87        <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr>
  88        <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong>
  89        <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code>
  90        <cite> <embed> <object> <param> <strike> <caption> <tbody>
  91        To make copying the list easier, below all tags were placed in one line:
  92        <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <param> <strike> <caption> <tbody>
  93        If you are going to use CKEditor with the Filtered HTML input format,
  94        please refer to the "Setting up Filters" section.
  95     7. To have better control over line breaks, you may disable the line break converter
  96        for a given text format in the "Administer > Site configuration > Input formats" section (recommended).
  97     8. Modify the ckeditor.config.js file to adjust it to your needs (optional).
  98        Configuration options are described here:
  99        http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html
 100        Developer's documentation for CKEditor:
 101        http://docs.cksource.com/CKEditor_3.x/Developers_Guide
 102        WARNING: Remember to clear the browser cache after you have modified any of the JavaScript files.
 103        If you skip this step, you may notice that the browser is ignoring your changes.
 104  
 105  Installation Troubleshooting
 106  ----------------------------
 107  If CKEditor does not appear on the page, check if all files were extracted correctly.
 108  
 109  The "sites/all/modules/ckeditor/ckeditor/" directory should contain the following files:
 110  ckeditor.js, config.js, contents.css
 111  and directories: "skins", "themes", "lang", "images".
 112  
 113  The correct directory structure is as follows:
 114  modules               <dir>
 115     ckeditor           <dir>
 116        ckeditor.module
 117        ckeditor.admin.inc
 118        ...
 119        ckeditor        <dir>
 120           _source      <dir>
 121           images       <dir>
 122           lang         <dir>
 123           plugins      <dir>
 124           skins        <dir>
 125           themes       <dir>
 126           COPY_HERE.txt
 127           ckeditor.js
 128           ...
 129  
 130  As noted above, alternatively the "sites/all/libraries/ckeditor" directory can be used.
 131  The "libraries" directory is the default path when drush is used to download the editor JavaScript code.
 132  
 133  If you are still experiencing problems with your CKEditor installation, scroll down to the "Help & Contribution" section.
 134  
 135  Uploading images and files
 136  --------------------------
 137  There are three ways for uploading files:
 138  - by using a commercial file browser like CKFinder (http://ckfinder.com), an advanced Ajax file manager;
 139  - by using modules like IMCE, WebFM, Image Browser;
 140  - by using the core upload module.
 141  
 142  To select a preferred file browser, adjust CKEditor profiles in the
 143  "Administer > Site configuration > CKEditor" section.
 144  In the "File browser settings" section you can choose which file browser will be used for each profile.
 145  Note: in order to choose an upload module other than CKFinder, you should install an appropriate Drupal module first.
 146  
 147  Installing CKFinder
 148  -------------------
 149  CKFinder is an Ajax-based file manager created by CKEditor developers: http://ckfinder.com/.
 150  
 151     1. Download CKFinder for PHP: http://ckfinder.com/download
 152     2. Unpack CKFinder to the directory containing the CKEditor module and place it in the
 153        "sites/all/modules/ckeditor/ckfinder" (or "sites/all/libraries/ckfinder") folder.
 154        The correct directory structure is as follows:
 155  
 156        modules               <dir>
 157           ckeditor           <dir>
 158              ckeditor.module
 159              ckeditor.admin.inc
 160              ...
 161              ckeditor        <dir>
 162                 _source      <dir>
 163                 images       <dir>
 164                 ckeditor.js
 165                 ...
 166              ckfinder        <dir>
 167                 core         <dir>
 168                 ckfinder.php
 169                 config.php
 170                 ...
 171  
 172     3. Grant the "allow CKFinder file uploads" permission in "Administer > User Management > Permissions" section.
 173        Note: if you do not see this permission, it means that CKEditor did not find CKFinder
 174        and you have probably uploaded CKFinder into a wrong directory.
 175     4. Open the CKFinder configuration file (ckfinder/config.php) and do the following:
 176  
 177        I) Remove the CheckAuthentication() function:
 178          (do not worry, this function is defined in filemanager.config.php, see below)
 179  
 180          function CheckAuthentication()       <- remove it
 181          {                                    <- remove it
 182             //WARNING : DO NOT simply...      <- remove it
 183             ...                               <- remove it
 184             return false;                     <- remove it
 185          }                                    <- remove it
 186  
 187        II) Add:
 188  
 189          - for CKFinder installed in the "sites/all/modules/ckeditor/ckfinder" directory:
 190          require_once '../../../../includes/filemanager.config.php';
 191  
 192          - for CKFinder installed in the "sites/all/libraries/ckfinder" directory:
 193          require_once '../../../includes/filemanager.config.php';
 194  
 195          straight below the following line:
 196  
 197          $baseDir = resolveUrl($baseUrl);
 198  
 199     5. Open the Drupal settings file (sites/default/settings.php) and do the following:
 200  
 201        I) Uncomment the $cookie_domain variable and set the domain name of your website.
 202  
 203        II) For Drupal 6.17 and greater: uncomment the $base_url variable and set the base URL
 204            of your website (without the trailing slash).
 205  
 206     6. Select CKFinder as a preferred file browser in the
 207        "Administer > Site configuration > CKEditor" section
 208        (for a selected CKEditor profile scroll down to the "File browser settings" section).
 209        In the "File browser settings" section you may also change destination folders for files uploaded with CKFinder.
 210  
 211  Managing Plugins
 212  ----------------
 213  If you want to manage CKEditor plugins for a profile, go to the "Administer > Site configuration > CKEditor" section.
 214  This section lets you choose plugins relevant for each CKEditor profile from a list.
 215  In order to activate a plugin, go to the "Editor appearance > Plugins" section and select the checkbox next to a required plugin name.
 216  
 217  If a plugin contains toolbar buttons, you will need to drag and drop them to an appropriate toolbar position by using the toolbar wizard. If this is the case, the button should be added to the CKEditor toolbar by using the method described below:
 218  - Enter the "Editor appearance > Toolbar" section.
 219  - Check whether the plugin button that you want to use is present in the "Used buttons" sections. If not, find it in the "All buttons" section and drag and drop to the toolbar configuration from the "Used buttons" section.
 220  
 221  Alternatively, if you turned off the toolbar wizard and prefer to enter the toolbar configuration manually, you will need to add the plugin button by yourself by appending it to your toolbar definition code.
 222  
 223  Please note that some plugins require installing additional modules to work correctly.
 224  
 225  Installing Additional Plugins
 226  -----------------------------
 227  The installation process is based on placing the plugin folder in the "plugins" directory of the CKEditor module (usually "sites/all/modules/ckeditor").
 228  The plugin folder should contain at least the plugin.js file that is responsible for the plugin logic.
 229  The plugin description will be displayed in the "Administration panel" if it is added to the plugin.js file by using the following special comment:
 230  /**
 231   * @file Plugin description
 232   */
 233  Hint: The "Administration panel" automatically detects the toolbar buttons available in the plugin and adds them to the toolbar wizard.
 234  
 235  A plugin can be enabled by using the same method as described above - see the "Managing Plugins" section.
 236  
 237  Integrating a Plugin with the CKEditor Module (for Plugin Developers)
 238  ---------------------------------------------------------------------
 239  Integrating your application with the CKEditor module by adding a plugin works through a special hook.
 240  An example of the hook is shown below:
 241  
 242  function MODULENAME_ckeditor_plugin() {
 243    return array(
 244          'plugin_name' => array(
 245              // Plugin name.
 246              'name' => 'plugin_name',
 247              // Plugin description - it will be displayed in the plugins management section of the profile settings.
 248              'desc' => t('Plugin description'),
 249              // The full path to the CKEditor plugin directory, trailing slash included.
 250              'path' => drupal_get_path('module', 'my_module') . '/plugin_dir/',
 251              // Plugin buttons definition (optional).
 252              'buttons' => array(
 253                'button_name' => array('label' => 'Button label', 'icon' => '/path/to/icon/image'),
 254                'button_name' => array('label' => 'Button label', 'icon' => '/path/to/icon/image'),
 255                ...
 256              )
 257          )
 258      );
 259  }
 260  Please note that MODULENAME in the code above is the name of the module.
 261  
 262  After the hook is used the plugin will automatically appear on the plugin list for each CKEditor profile where you will be able to enable it as described in the "Managing Plugins" section.
 263  
 264  Setting up Filters
 265  ------------------
 266  In the "Administer > Site configuration > Input formats" section, Filtered HTML is the default filter.
 267  Due to security reasons enabling Full HTML is only an option for trusted users.
 268  
 269  To take full advantage of using CKEditor you can extend the list of allowed tags in the HTML filter that is enabled in the Filtered HTML input format. If you do not do this, you may notice that a page created in CKEditor looks different after saving.
 270  
 271  Unfortunately, even if you extend the list of allowed tags, one problem still remains: Filtered HTML not only strips disallowed tags, but also strips inline style definitions. It basically means that you are unable to apply a different font color, size or family, align images etc. using CKEditor out of the box.
 272  
 273  You can solve this problem by creating another input format that will work in a similar way as Filtered HTML (will only allow specified tags), but in a much better way - i.e. it will not strip inline styles that CKEditor is using when
 274  formatting text or images after the page is saved. To create such an input format, you will need an HTML filter. The list below presents three modules that provide HTML filters:
 275  
 276   - HTML Purifier - http://drupal.org/project/htmlpurifier
 277   - htmLawed - http://drupal.org/project/htmLawed
 278   - WYSIWYG Filter - http://drupal.org/project/wysiwyg_filter
 279  
 280  It is up to you to decide which one to use. Just make sure that you will only allow to use proper inline styles, tags, and attributes.
 281  
 282  Upgrading Instructions (Migration from FCKeditor)
 283  -------------------------------------------------
 284     During the installation process CKEditor will check for the existence of the FCKeditor module and
 285     copy all FCKeditor settings, profiles etc. (to save your time, just disable the FCKeditor module
 286     during the CKEditor installation. If you uninstall the FCKeditor module before installing CKEditor,
 287     all FCKeditor settings will be deleted from the database and CKEditor will not copy them).
 288     After installing CKEditor you may uninstall the FCKeditor module.
 289  
 290     If both modules are enabled (CKEditor and FCKeditor), you may get JavaScript errors when both editors
 291     will try to attach to the same textarea. If you are having problems after upgrading, make sure that this
 292     situation did not occur.
 293  
 294     Apart from the information above, installing CKEditor is just like installing a new module,
 295     so be sure to follow the installation instructions listed above.
 296  
 297  Upgrading Instructions (CKEditor)
 298  ---------------------------------
 299  This instruction assumes that you are upgrading the CKEditor module [M] and CKEditor (the editor) [E] at the same time.
 300  Instructions specific for module upgrades are tagged with [M]. Steps that must be taken when upgrading CKEditor (the editor) are marked with [E].
 301  
 302     1. [M] Download the latest version of the CKEditor module from http://drupal.org/project/ckeditor (it is advised to read the release notes before going further).
 303     2. [E] Download the latest version of CKEditor from http://ckeditor.com/download (it is advised to read the "What's New" page before going further: http://ckeditor.com/whatsnew).
 304     3. [M] Back up your database.
 305     4. [EM] Place the site in the "Off-line" mode to let the database updates run without interruption and to avoid displaying errors to end users of the site.
 306     5. [E] If you are using CKFinder, make sure you will not delete it, and move it to a safe place.
 307     6. [E] If you introduced any changes (e.g. custom toolbar definitions etc.) in the sites/all/modules/ckeditor/ckeditor.config.js file (or sites/all/modules/ckeditor/ckeditor/config.js), write down your changes and add them again after uploading new files.
 308            In general, try to avoid making any changes to CKEditor's config.js file and add everything to ckeditor.config.js.
 309     7. Delete old files:
 310        [EM]* Simply remove the "modules/ckeditor" directory if upgrading both the editor and the module.
 311        [M] If you are upgrading the module only, remember to leave the "modules/ckeditor/ckeditor" directory untouched.
 312        [E] When upgrading the editor, remove the contents of the "modules/ckeditor/ckeditor" directory only.
 313        WARNING: If you do not remove old files and just rename the "ckeditor" directory instead (e.g. to "ckeditor_old"), Drupal may use the module from the renamed "ckeditor_old" directory.
 314     8. [M] Upload the CKEditor module (extracted files and folders) to the "sites/all/modules" directory.
 315     9. [E] Upload standalone CKEditor (extracted files and folders from the "ckeditor" directory) to the "sites/modules/ckeditor/ckeditor" directory (i.e. where the COPY HERE.txt file exists).
 316     10. [E] Restore the CKFinder  files from where you copied them (see step 5).
 317     11. [E] Apply your modifications to default configuration in the ckeditor.config.js file (see step 6).
 318     12. [M] Run update.php.
 319     13. [EM] Put the site back online.
 320  
 321  Help & Contribution
 322  -------------------
 323  If you are looking for more information, have any trouble with the configuration of the module
 324  or if you found an issue, please visit the official project page:
 325    http://drupal.org/project/ckeditor
 326  
 327  Having problems? Take a look at the list of common problems when installing CKEditor:
 328    http://docs.cksource.com/CKEditor_for_Drupal/Troubleshooting
 329  
 330  Learn how to adjust CKEditor to your theme and configure the spellchecker:  
 331    http://docs.cksource.com/CKEditor_for_Drupal/Tricks
 332  
 333  If you would like to help in the development of the module, we encourage you to join our team.
 334  Any help will be greatly appreciated!
 335  
 336  Credits
 337  -------
 338   - CKEditor for Drupal is currently maintained by the CKEditor team and Jorrit Schippers.
 339       http://ckeditor.com/
 340  
 341   - CKEditor - The text editor for the Internet
 342       Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
 343       http://cksource.com/


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7