Index: branches/5.3.x/core/ckeditor/ckeditor_php5.php =================================================================== diff -u -N -r15483 -r15946 --- branches/5.3.x/core/ckeditor/ckeditor_php5.php (.../ckeditor_php5.php) (revision 15483) +++ branches/5.3.x/core/ckeditor/ckeditor_php5.php (.../ckeditor_php5.php) (revision 15946) @@ -186,12 +186,15 @@ $_config = $this->configSettings($config, $events); $js = $this->returnGlobalEvents(); - if (!empty($_config)) { - $js .= "CKEDITOR.replace('".$id."', ".$this->jsEncode($_config).");"; + $json_config = !empty($_config) ? $this->jsEncode($_config) : '{}'; + + if ($this->lateLoad) { + $js .= "\$CKEditors[ '".$id."' ] = ".$json_config.";"; } else { - $js .= "CKEDITOR.replace('".$id."');"; + $js .= "CKEDITOR.replace('".$id."', ".$json_config.");"; } + $out .= $this->script($js); if (!$this->returnOutput) { @@ -203,6 +206,40 @@ } /** + * Creates inline instance of editor. + * + * @param string $id The id or name of textarea element. + * @param array $config The specific configurations to apply to this editor instance (optional). + * @param array $events Event listeners for this editor instance (optional). + * + * @return string + */ + public function inline($id, $config = array(), $events = array()) + { + $out = ""; + if (!$this->initialized) { + $out .= $this->init(); + } + + $_config = $this->configSettings($config, $events); + + $js = $this->returnGlobalEvents(); + $json_config = !empty($_config) ? $this->jsEncode($_config) : '{}'; + + $js .= "CKEDITOR.disableAutoInline = true;\n"; + $js .= "CKEDITOR.inline('".$id."', ".$json_config.");"; + + $out .= $this->script($js); + + if (!$this->returnOutput) { + print $out; + $out = ""; + } + + return $out; + } + + /** * Replace all <textarea> elements available in the document with editor instances. * * @param $className (string) If set, replace all textareas with class className in the page.