plainblack.com
Username Password
search
Bookmark and Share

HTML filter macro

In response to djs' question if anybody had ever written a macro that can stip HTML from a template-variable.

Here it is: filter.pm. 

I use it in the recovery template like this:

<tmpl_if recoverMessage>^filter(<tmpl_var recoverMessage>);</tmpl_if>

I don't expect it to work well always, since macro's in general don't handle quotes well. I've not used or tested this macro in any other other way than above.  

 usage:

process ( html, [filter] )

       I use this macro in the Password Recovery Template. Here the variable <tmpl_var recoverMessage> returns
       <ul><li><li> which produces empty bullets. The reason for this is that line 73 of Auth/WebGUI.pm adds
       list-tags ($error .= ’<li>’.$i18n->get(3).’</li>’;) and line 727 of the same module too. ($self->recov‐
       erPassword(’<ul><li>’.$self->error.’</li></ul>’); The real solution would be to change Auth/WebGUI.pm. (In fact I now see this has happend.)

      This macro is in fact an interface to WebGUI::HTML::filter.

       The filter chosen is "all" from the following in HTML::filter: Choose from "all", "none", "macros",
       "javascript", or "most". Defaults to "most". "all" removes all HTML tags and macros; "none" removes no
       HTML tags; "javascript" removes all references to javacript and macros; "macros" removes all macros, but
       nothing else; and "most" removes all but simple formatting tags like bold and italics.

System RequirementsPlease be advised: this contribution was tested with something older than WebGUI 7.5. When this contribution was uploaded there was no field for the author to fill out regarding it's requirements.
Comments
Downloadfilter.pm.txt filter.pm.txt
LinksNo Support Offered
Statistics Downloads: 502
Views: 2460
Rating: 0
Updated: 10/18/2007
Keywords macros
NavigationBack to the Bazaar
© 2018 Plain Black Corporation | All Rights Reserved