Page 2 of 2
Re: What do we think about MicroTiny in CMSMS 2?
Posted: Tue Dec 08, 2015 7:11 pm
by calguy1000
I thinking about optie 4, learning to create my own module and maybe I manage to add the editor I want to CMSMS (if thats allowed by CMSMS otherwise let me know please).
You can do whatever you want. CMSMS does not restrict you.
If however you want to share it.... then you need to be aware of licensing.
The license of your editor must be compatible with the GPL, and your license must be GPL (because CMSMS is GPL).
Re: What do we think about MicroTiny in CMSMS 2?
Posted: Tue Dec 08, 2015 7:47 pm
by calguy1000
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
Re: What do we think about MicroTiny in CMSMS 2?
Posted: Tue Dec 08, 2015 8:00 pm
by musicscore
Thank you very much Calguy1000. It's my first start and I'm thankfull for your help/tip.