X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FPresenter.pm;h=61ddab4082922064730bfc1fec7efd780715042a;hb=3ce4cab393c398fe802d4d5cef08b7ad64773294;hp=f328cce9e1c10ddac7082f3a3b1c9a5f7b668f0d;hpb=942a5b2c128ebf03d181aef47e42b08f7971c0ee;p=kivitendo-erp.git diff --git a/SL/Presenter.pm b/SL/Presenter.pm index f328cce9e..61ddab408 100644 --- a/SL/Presenter.pm +++ b/SL/Presenter.pm @@ -14,6 +14,8 @@ use SL::Presenter::Invoice; use SL::Presenter::Order; use SL::Presenter::Project; use SL::Presenter::Record; +use SL::Presenter::Text; +use SL::Presenter::Tag; sub get { return $::request->presenter; @@ -124,6 +126,16 @@ sub escaped_text { return SL::Presenter::EscapedText->new(text => $text, is_escaped => 1); } +sub escape_js { + my ($self, $text) = @_; + + $text =~ s|\\|\\\\|g; + $text =~ s|\"|\\\"|g; + $text =~ s|\n|\\n|g; + + return SL::Presenter::EscapedText->new(text => $text, is_escaped => 1); +} + 1; __END__ @@ -290,6 +302,16 @@ It is safe to call C on an instance of L. This is a no-op (the same instance will be returned). +=item C + +Returns a JavaScript-escaped version of C<$text>. Instead of a string +an instance of the thin proxy-object L is +returned. + +It is safe to call C on an instance of +L. This is a no-op (the same instance will +be returned). + =item C Returns the global instance of L