Translations of this page:

TinyMCE

—- plugin —-

description: This plugin provides TinyMCE 4, 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-tinymce


This plugin provides TinyMCE 4 for editing messages and templates. It also integrates the elFinder file manager to provide file uploading and browsing.

Installation

Dependencies

This plugin is for phpList 3.

Install through phpList

Install on the Plugins page (menu Config > Manage Plugins) using the package URL https://github.com/bramley/phplist-plugin-tinymce/archive/master.zip

Install manually

Download the plugin zip file from https://github.com/bramley/phplist-plugin-tinymce/archive/master.zip

Expand the zip file, then copy the contents of the plugins directory to your phpList plugins directory. This should contain

  • the file TinyMCEPlugin.php
  • the directory TinyMCEPlugin

Enable the plugin

Click the Enable button to enable the plugin. Note that only one editor can be enabled.

Location of the elFinder directory

The elFinder directory must be within the web root. If you have the default plugin location, define('PLUGIN_ROOTDIR', 'plugins') in config.php, then the plugin will use the correct path automatically, e.g.

/lists/admin/plugins/TinyMCEPlugin/elfinder

If you have placed the plugin directory outside of the web root then you must move or copy the `elfinder` directory from the plugin's directory to somewhere within the web root. Then use the Settings page (menu Config > Settings) to specify the path to the elFinder directory. The path should be from the web root, such as /elFinder, not the filesystem path.

Also, if you move or rename the phpList directory or the plugin directory after installing the plugin, then you will need to modify the path because it will not change automatically.

Configuration

config.php

The UPLOADIMAGES_DIR value in config.php must be set to the location of a directory where elFinder 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 elFinder will be disabled and image uploading will not be possible.

The upload directory will be shared by all admins. You can give each ordinary admin their own private directory by adding

define('IMAGE_DIR_PER_ADMIN', true);

elFinder will use a subdirectory of UPLOADIMAGES_DIR named after the admin login id (1, 2, 3 etc.). The subdirectory is private to the admin, and there is no sharing of image files with other ordinary admins. The URL of an image will therefore be something like this for admin id 2

https://mysite.com/upload/2/funny_cat.jpg

To give all admins, including super admins, their own subdirectory use

define('IMAGE_DIR_PER_ADMIN', 'all');

Settings page

The Settings page has a TinyMCE group where you can configure the plugin.

  • The URL of tinymce.min.js
  • Custom configuration settings.
  • The width and height of the editor window. The default width is 0 so that the editor fills the surrounding element.
  • You can select to generate a full HTML page when editing a message template. The template will then include <html>, <head> and <body> elements. This setting defaults to Yes.
  • Similarly you can select to generate a full HTML page when editing a message. This is useful only when you do not use templates, otherwise the template and the message will both contain <html>, <head> and <body> elements. The default value is No. If this field is set to Yes then it is ignored if Allow templates to be edited as full HTML pages is also set to Yes.
  • The website path to elFinder.

Custom configuration

Other settings for the editor are entered directly on the Settings page.
A default toolbar and plugin configuration have been copied from the Basic Example page.

See http://www.tinymce.com/wiki.php/Configuration for how to specify configuration settings.

Location of TinyMCE

URL of tinymce.min.js

Starting in version 2.2.0 the plugin includes a copy of TinyMCE instead of loading from its Content Delivery Network. This is due to TinyMCE 4 no longer being supported.

If the default plugin directory has been used then the URL should be set correctly, e.g.

/lists/admin/plugins/TinyMCEPlugin/tinymce/js/tinymce/tinymce.min.js

But if you have changed the location of the plugin directory then you will probably have to amend this value. It needs to be the URL to the tinymce.min.js file.

Upgrade elFinder

The plugin includes elFinder 2.1.6 but will not automatically upgrade to a new release. You can download a new release of elFinder from http://studio-42.github.io/elFinder/#elf_l1_Lw.

To install the build, expand the zip file, copy the elfinder_xxx directory to your web site, and specify the path to the directory on the Settings page. It is recommended to use a new directory rather than overwriting the elFinder version in the plugin's directory so that it will not be affected if you upgrade the plugin.

Upgrade from phplist 2.10.x with FCKEditor

In phplist 2.10 the FCKIMAGES_DIR value in config.php defines the directory into which images will be uploaded. The value is relative to the phplist root directory.

In phplist 3.x a different value, UPLOADIMAGES_DIR, is used to define the directory. This value is relative to the web root, not to the phplist root directory. To continue using the same upload directory you must set UPLOADIMAGES_DIR correctly. So, for example, if the existing image upload directory is /lists/uploadimages then the FCKIMAGES_DIR would be uploadimages but the value for UPLOADIMAGES_DIR would be lists/uploadimages.

Support

Please raise any questions or problems in the user forum https://discuss.phplist.org/