It just seems to never call the WYSIWYGGenerateHeader() function, which is stupid, because it calls the one in TinyMCE every time. The textarea itself gets output correctly, just not the header.




This is the whole module (with a few things omitted for clarity)
Code: Select all
<?php
//removed stuff here
class WYMeditor extends CMSModule
{
function GetName()
{
return 'WYMeditor';
}
function IsPluginModule()
{
return true;
}
function HasAdmin()
{
return false;
}
function GetVersion()
{
return '1.0';
}
function IsWYSIWYG()
{
return true;
}
function VisibleToAdminUser()
{
return true;
}
function WYSIWYGTextarea($name='textarea',$columns='80',$rows='15',$encoding='',$content='',$stylesheet='/modules/WYMeditor/css/basic.css')
{
global $gCms;
$rows = $rows + 10;
if ($stylesheet != '') {
$gCms->variables['WYMeditor_stylesheet'] = $stylesheet;
}
if (!array_key_exists('WYMeditor_textareas', $gCms->variables)) {
$gCms->variables['WYMeditor_textareas'] = array();
}
array_push($gCms->variables['WYMeditor_textareas'], $name);
return '<textarea id="'.$name.'" name="'.$name.'" columns="'.$columns.'" rows="'.$rows.'" class="wymeditor">'.cms_htmlentities($content,ENT_NOQUOTES,get_encoding($encoding)).'</textarea>
';
}
function WYSIWYGGenerateHeader()
{
global $gCms;
$output = '
<link rel="stylesheet" type="text/css" media="screen" href="'.$gCms->config['root_url'].'/modules/WYMeditor/wymeditor/skins/default/screen.css" />
<__script__ type="text/javascript" src="'.$gCms->config['root_url'].'/modules/WYMeditor/jquery/jquery.js"></__script>
<__script__ type="text/javascript" src="'.$gCms->config['root_url'].'/modules/WYMeditor/wymeditor/jquery.wymeditor.pack.js"></__script>
<__script__ type="text/javascript" src="'.$gCms->config['root_url'].'/modules/WYMeditor/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js"></__script>
<__script__ type="text/javascript">
jQuery(function() {
jQuery(\'.wymeditor\').wymeditor({
postInit: function(wym) {
jQuery(".pagebutton").click( function() {
wym.update();
});
}
});
});
</__script>
';
return $output;
}
function GetHelp($lang='en_US')
{
return "
<h3>What does this do?</h3>
<p>This is a wrapper for the WYMeditor (What You Mean)</p>
";
}
function GetAuthor()
{
}
function GetAuthorEmail()
{
}
function GetChangeLog()
{
//blah blah blah
}
}
?>