Just for giggles (cuz I did one for Syntax Hilighters in 2.0 yesterday).
I created a trivial example of how to create a WYWISYG module for CMSMS.
This example uses a cdn for tinymce. and enables no plugins, sets no options, has no admin panel of it's own, has no file browser, no cmsms linker, etc. but it works.
Adding all of those plugins and options is of course very time consuming.
Anyways... here's the code.
Code: Select all
<?php
class TinyTest extends CMSModule
{
public function GetName() { return basename(__CLASS__); }
public function GetVersion() { return 0.1; }
public function HasCapability($capability, $params = array())
{
if( $capability == CmsCoreCapabilities::WYSIWYG_MODULE ) return TRUE;
return FALSE;
}
public function WYSIWYGGenerateHeader($selector = null,$cssname = null)
{
if( !$selector ) $selector = 'textarea.TinyTest';
$out = '<__script__ src="//cdn.tinymce.com/4/tinymce.min.js"></__script>';
$out .= "<__script__>tinymce.init({ selector:'{$selector}' });</__script>";
return $out;
}
}
This code of course has to be in a file named: <site root>/modules/TinyTest/TinyTest.module.php