My WYSIWYG fails to output header stuff in latest version of

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
User avatar
FantomCircuit
Forum Members
Forum Members
Posts: 75
Joined: Fri Nov 10, 2006 1:34 am
Location: Gold Coast, Australia

My WYSIWYG fails to output header stuff in latest version of

Post by FantomCircuit »

I dont know what the hell is going on, but I can't get this very simple wysiwyg module to output stuff in the header. TinyMCE still works fine and as far as I can tell I am doing the exact same thing. I'm at my wit's end here guys!!!!

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
    }
}

?>
Last edited by FantomCircuit on Sat Feb 19, 2011 1:26 pm, edited 2 times in total.
User avatar
FantomCircuit
Forum Members
Forum Members
Posts: 75
Joined: Fri Nov 10, 2006 1:34 am
Location: Gold Coast, Australia

Re: My WYSIWYG fails to output header stuff in latest version of cmsms

Post by FantomCircuit »

Ok, it appears this is a bug. I can't seem to install any other WYSIWYG editor in the latest version of cmsms 1.2

I tried this on a clean install on ubuntu with fckeditor 1.0.3 and got the same problem - it seems that the  WYSIWYGGenerateHeader()  function simply doesn't get called.  :'(

Assuming this is a bug, how do I submit it as such? I can't seem to find where to do this in the tracker section of cmsms in the forge.
Post Reply

Return to “Developers Discussion”