public function replaceAll($className = null)
    {
        $out = '';
        if (!$this->initialized) {
            $out .= $this->init();
        }

        $_config = $this->configSettings();

        $js = $this->returnGlobalEvents();
        if (empty($_config)) {
            if (empty($className)) {
                $js .= 'CKEDITOR.replaceAll();';
            } else {
                $js .= "CKEDITOR.replaceAll('".$className."');";
            }
        } else {
            $classDetection = '';
            $js .= "CKEDITOR.replaceAll( function (textarea, config) {\n";
            if (!empty($className)) {
                $js .= "	var classRegex = new RegExp('(?:^| )' + '".$className."' + '(?:$| )');\n";
                $js .= "	if (!classRegex.test(textarea.className))\n";
                $js .= "		return false;\n";
            }
            $js .= '	CKEDITOR.tools.extend(config, '.$this->jsEncode($_config).', true);';
            $js .= '} );';
        }

        $out .= $this->script($js);

        if (!$this->returnOutput) {
            echo $out;
            $out = '';
        }

        return $out;
    }