Location: PHPKode > projects > HikaShop > back/helpers/editor.php
<?php
/**
 * @package		HikaShop for Joomla!
 * @version		1.4.3
 * @author		hikashop.com
 * @copyright	(C) 2010 HIKARI SOFTWARE. All rights reserved.
 * @license		GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>
<?php
class hikashopEditorHelper{
	var $width = '100%';
	var $height = '500';
	var $cols = 100;
	var $rows = 20;
	var $editor = null;
	var $name = '';
	var $content = '';
	function hikashopEditorHelper(){
		$config =& hikashop::config();
		$this->editor = $config->get('editor',null);
		if(empty($this->editor)) $this->editor = null;
		$this->myEditor =& JFactory::getEditor($this->editor);
		$this->myEditor->initialise();
	}
	function setDescription(){
		$this->width = 700;
		$this->height = 200;
		$this->cols = 80;
		$this->rows = 10;
	}
	function setContent($var){
		$name = $this->myEditor->get('_name');
		if(!empty($name)){
			if($name == 'jce'){
				return " try{JContentEditor.setContent('".$this->name."', $var ); }catch(err){".$this->myEditor->setContent($this->name,$var)."} ";
			}
			if($name == 'fckeditor'){
				return " try{FCKeditorAPI.GetInstance('".$this->name."').SetHTML( $var ); }catch(err){".$this->myEditor->setContent($this->name,$var)."} ";
			}
		}
		return $this->myEditor->setContent($this->name,$var);
	}
	function getContent(){
		return $this->myEditor->getContent($this->name);
	}
	function display(){
		$options = array('pagebreak');
		$config =& hikashop::config();
		$readmore = $config->get('readmore',0);
		if(!$readmore){
			$options[]='readmore';
		}
		return $this->myEditor->display( $this->name,  $this->content ,$this->width, $this->height, $this->cols, $this->rows,$options ) ;
	}
	function jsCode(){
		return $this->myEditor->save( $this->name );
	}
}
Return current item: HikaShop