openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 109aca9955478501c41d4af7cf92fa21e8c924c4
parent c60ce9eb861f16b455a9b71a9b8039277a544d77
Author: dankert <devnull@localhost>
Date:   Tue, 27 Nov 2007 22:10:35 +0100

Verschieben von "replaceHtmlChars()" nach Klasse Text.

Diffstat:
serviceClasses/Text.class.php | 22++++++++++++++++++++++
textClasses/DocumentElement.class.php | 26+++-----------------------
2 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/serviceClasses/Text.class.php b/serviceClasses/Text.class.php @@ -20,6 +20,9 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // --------------------------------------------------------------------------- // $Log$ +// Revision 1.8 2007-11-27 21:10:35 dankert +// Verschieben von "replaceHtmlChars()" nach Klasse Text. +// // Revision 1.7 2007-11-24 13:22:04 dankert // Neue Methode "encodeHtmlSpecialChars()" // @@ -141,6 +144,25 @@ class Text + /** + * Ersetzt Sonderzeichen durch HTML-Äquivalente.<br> + * Z.B. Ersetzt "(c)" durch "&copy;". + */ + function replaceHtmlChars( $text ) + { + global $conf; + + foreach( explode(' ',$conf['editor']['html']['replace']) as $repl ) + { + list( $ersetze, $mit ) = explode(':',$repl.':'); + $text = str_replace($ersetze, $mit, $text); + } + + return $text; + } + + + /** * HTML-Entitaeten fuer HTML-Tags verwenden * diff --git a/textClasses/DocumentElement.class.php b/textClasses/DocumentElement.class.php @@ -801,10 +801,10 @@ class DocumentElement extends AbstractElement $tag = ''; // $tag = 'span'; - $val = $this->replaceHtmlChars( $child->text ); + $val = $child->text; if ( ! $this->element->html ) - $val = Text::encodeHtml( $child->text ); - + $val = Text::encodeHtml( $val ); + $val = Text::replaceHtmlChars( $val ); break; case 'footnoteelement': @@ -1156,26 +1156,6 @@ class DocumentElement extends AbstractElement /** - * Ersetzt Sonderzeichen durch HTML-Äquivalente.<br> - * Z.B. Ersetzt "(c)" durch "&copy;". - */ - function replaceHtmlChars( $text ) - { - global $conf; - - foreach( explode(' ',$conf['editor']['html']['replace']) as $repl ) - { - list( $ersetze, $mit ) = explode(':',$repl); - $text = str_replace($ersetze, $mit, $text); - } - - return $text; - } - - - - - /** * Rendering des Dokumentes.<br> * Die Art und Weise des Renderns ist in Abhängigkeit zum * übergebenen Mime-Type.