﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
8965	creating ckeditor via PHP through AJAX to load an error	Alexsandr		"creating ckeditor via PHP through AJAX to load an error
propose the following fix
fix to the file ""fckeditor_php5.php"" function editor

{{{
public function editor($name, $value = """", $config = array(), $events = array())
	{
		$attr = """";
		foreach ($this->textareaAttributes as $key => $val) {
			$attr.= "" "" . $key . '=""' . str_replace('""', '&quot;', $val) . '""';
		}
		$out = ""<textarea name=\"""" . $name . ""\"""" . $attr . "">"" . htmlspecialchars($value) . ""</textarea>\n"";
		if (!$this->initialized) {
			$out .= $this->init();
		}

		$_config = $this->configSettings($config, $events);

		$js = $this->returnGlobalEvents();

        //FIX
                $js .= "" if (CKEDITOR.instances['"".$name.""']) {"";
                $js .= "" delete CKEDITOR.instances['"".$name.""'];"";
                $js .= ""}"";

		if (!empty($_config))
			$js .= ""CKEDITOR.replace('"".$name.""', "".$this->jsEncode($_config)."");"";
		else
			$js .= ""CKEDITOR.replace('"".$name.""');"";

		$out .= $this->script($js);

		if (!$this->returnOutput) {
			print $out;
			$out = """";
		}

		return $out;
	}
}}}"	Bug	closed	Normal		Server : PHP		expired		
