
Thank you in advance.
Code: Select all
/**
* Returns the xhtml equivalent of a FCK wysiwyg editor.
*
* @param string The id given to the module on execution
* @param string The text to display in the textarea's content
* @param string The html name of the textarea
* @param string The CSS class to associate this textarea to
* @param string The html id to give to this textarea
* @param string The encoding to use for the content
* @param string The text of the stylesheet associated to this content. Only used for certain WYSIWYGs
* @param string The number of characters wide (columns) the resulting textarea should be
* @param string The number of characters high (rows) the resulting textarea should be
*/
function create_fe_wysiwyg($mid, $text, $name, $classname='', $id='', $encoding='', $stylesheet='', $width='', $height='')
{
global $gCms;
$result = '';
$wysiwyg = $this->GetModuleInstance('FCKeditorX');
if( $wysiwyg )
{
$enablewysiwyg = true;
}
else
{
$enablewysiwyg = false;
}
if ($enablewysiwyg == true)
{
foreach($gCms->modules as $key=>$value)
{
if ($gCms->modules[$key]['installed'] == true &&
$gCms->modules[$key]['active'] == true &&
$gCms->modules[$key]['object']->IsWYSIWYG())
{
$result = '';
ob_start();
echo $gCms->modules[$key]['object']->WYSIWYGTextarea($mid.$name,$width,$height,$encoding,$text,$stylesheet);
$result = ob_get_contents();
ob_end_clean();
}
}
}
if ($result == '')
{
$result = '<textarea name="'.$name.'" cols="'.$width.'" rows="'.$height.'"';
if ($classname != '')
{
$result .= ' class="'.$classname.'"';
}
if ($mid != '')
{
$result .= ' id="'.$mid.'"';
}
$result .= '>'.cms_htmlentities($text,ENT_NOQUOTES,get_encoding($encoding)).'</textarea>';
}
return $result;
}