Helix:MCE
From HelixCore
Contents |
Setup
The TinyMCE WYSIWYG editor is disabled by default in any Helix installation. It is disabled to make room for the FCK editor. You can enable or disable it by editing the core/config.php file. Be sure to disable the FCK editor if you plan on enabling the MCE editor.
NB: The FCK editor is used over the MCE editor as the FCK editor produces much cleaner code in a lighter interface that loads MUCH quicker. MCE is more feature rich and can restrict certain HTML elements as well as provide better layering and object support, but it comes at a price. MCE will also modify the original HTML code and format it the way it would prefer to accomplish the same.
The FCK editor is linked to the MCE File and Image managers via the FCK to MCE Connector.
File & Image Manager
The TinyMCE File and Image Managers can be configured via PHP scripts core/api/tiny_mce/plugins/filemanager/config.php and core/api/tiny_mce/plugins/imagemanager/config.php respectively. Both the file and image managers are installed in a default Helix installation via the fckmce_connector API, in a user-based setup. This means that the default installation allows each Helix user to have their own repository to upload files to, and will not be able to see other users files within the tools. This also mean, that with a default installation anonymous clients can not use these tools.
The default user repository for both tools is userfiles/[username]/. This directory is not automatically created, if you want it to you need to use the site_onLogin() function in the core/site/siteEngine.php file. An example for such a function to automatically create user directories follows:
function site_onLogin($username, $password, $remember, $newPage) {
// Make sure user has a home directory
global $site;
$homeDir = $site->fileRoot.'/userfiles/'.$username;
if (!file_exists($homeDir)) @mkdir($homeDir, 0777, true);
}
Authentication Methods
By default, the tools use the 'SessionAuthenticator', which uses the username and login status to define access to the file repositories. Another common method is the 'BaseAuthenticator', which if used will allow anyone to use the tools and will use a common repository. This may be preferred for public sites.
To Change the Authenticator, edit the respective config.php file and change
$mcImageManagerConfig['authenticator'] = "SessionAuthenticator";
to
$mcImageManagerConfig['authenticator'] = "BaseAuthenticator";
NB: Upon changing to the base authenticator, the common repository becomes userfiles/ which will include any previously made user directories.
Root Path
When using the base authenticator, you can easily change the path to the common repository by changing the following keys in the config.php files.
$mcImageManagerConfig['filesystem.path'] = ; $mcImageManagerConfig['filesystem.rootpath'] = $_SERVER['DOCUMENT_ROOT'].'/userfiles';
Both are absolute or relative from this script path. A 'path' is not required, it is the "default" location to place the user in when opening the tool. The 'rootpath' is the root of the repository, so the path must be either blank, identical to the rootpath, or a child directory of the rootpath.
