====== CKEditor ======
---- plugin ----
description: This plugin provides CKEditor, an HTML text editor, for editing messages and templates. This is for phplist 3.x.
author : Duncan Cameron
type : editor
compatible : 3.x
tags : editor
sourcerepo : https://github.com/bramley/phplist-plugin-ckeditor
----
This plugin provides CKEditor 4 for editing messages and templates. It also integrates the KCFinder file manager to provide file uploading and browsing.
Both CKEditor 4 and KCFinder are "end of life", which means they do not receive any code fixes or security updates. The plugin uses the last freely available version of CKEditor 4, version 4.22.1. There is a paid-for version that does have security patches, see [[https://ckeditor.com/ckeditor-4/download/]]
===== Installation =====
This plugin is now included in phplist, but see the README file on the GitHub page https://github.com/bramley/phplist-plugin-ckeditor for how to install or upgrade the plugin.
===== Configuration =====
==== config.php ====
The UPLOADIMAGES_DIR value in config.php must be set to the location of a directory where KCFinder can store uploaded images. The directory must be writable by the web server. Note that the value is relative to the web root and must not contain a leading '/'.
define('UPLOADIMAGES_DIR', 'upload');
If the UPLOADIMAGES_DIR value in config.php is set to ''false'' then KCFinder will be disabled and image uploading will not be possible.
The upload directory will be shared by all admins. You can give each admin their own private directory using
define('IMAGE_DIR_PER_ADMIN', true);
KCFinder will use a subdirectory of UPLOADIMAGES_DIR named after the admin login id (1, 2, 3 etc.), creating the subdirectory on first-use. The subdirectory is private to the admin, and there is no sharing of image files.
=== SELINUX configuration for images dir ===
To make this work with selinux enforced on centos7 with apache and phplist installed in ''/var/www/html/lists''
Edit config.php adding the following to the end of the file;
''define ('UPLOADIMAGES_DIR', 'lists/uploadimages');''
cd lists
mkdir uploadimages uploadimages/image uploadimages/flash uploadimages/files
chown -R apache:apache uploadimages/
semanage fcontext -a -t httpd_sys_rw_content_t /var/www/html/lists/uploadimages
chcon -Rv --type=httpd_sys_rw_content_t /var/www/html/lists/uploadimages
==== Settings page ====
The Settings page has a CKEditor group where you can configure the plugin.
* The URL of ckeditor.js
* The path to a custom configuration file. This is the path from the web root.
* You can select to generate a full HTML page when editing a message. The message will then include '''', ''