<?

App::import('Vendor', 'fckeditor');

class FckHelper extends AppHelper { 
               
    /**
    * creates an fckeditor textarea
    * 
    * @param array $namepair - used to build textarea name for views, array('Model', 'fieldname')
    * @param string $content
	 * @param int $width
	 * @param int $height 
	 */
    function fckeditor($namepair, $content, $width=600, $height=600){
        $editor_name = 'data';
        foreach ($namepair as $name){
            $editor_name .= "[" . $name . "]";
        }

        $oFCKeditor = new FCKeditor($editor_name) ;
        $oFCKeditor->BasePath = '/quotenik1.2/js/fckeditor/' ;
        $oFCKeditor->Value = $content ;
		  $oFCKeditor->Width = $width;
			$oFCKeditor->Height = $height;
		  $oFCKeditor->Create() ;            
    }      
} 

?>
