<?php
defined('ROOT_DIR') or die(__FILE__.' requires egConfig.inc.php');
include_once(ROOT_DIR.'egWindow.class.php');

class egRichText extends egWindow {

	var $name;

	function egRichText($id, $value, $posX = 0, $posY = 0, $width = 0, $height = 0, $name = "") {
	  $this->name = $name;
		$value = htmlspecialchars( $value );
		parent::egWindow($id, $value, $posX, $posY, $width, $height);
	}

	function getClassName() {
		return "egRichText";
	}

	function getHTML($container = null) {
		$html = "var richText_{$this->id} = new egRichText('{$this->id}', '{$this->title}', '{$this->posX}', '{$this->posY}', '{$this->width}', '{$this->height}', '{$container}', '{$this->name}');";
		$html .= "egObjectsArray['richText_{$this->id}'] = richText_{$this->id};";

		return $html;
	}

	/**
   *
   * @static
	 */
	function getScriptsFiles() {
	    $scriptsArray = array();

	    $scriptsArray[ALL] = "egRichText_default.js";

	    $scriptsArray[FIREFOX] = array();
	    $scriptsArray[FIREFOX][ALL] = "egRichText_ff.js";

	    $scriptsArray[SAFARI] = array();
	    $scriptsArray[SAFARI][ALL] = "egRichText_saf.js";

	    return $scriptsArray;
	}

	/**
   *
   * @static
   */
	function getStylesFiles() {
    $stylesArray = array();
    $stylesArray[ALL] = "";
    return $stylesArray;
  }

}

?>