https://bugzilla.wikimedia.org/show_bug.cgi?id=2257
neph...@skyhighway.com changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #576 is|0 |1 obsolete| | Attachment #577 is|0 |1 obsolete| | Attachment #753 is|0 |1 obsolete| | Attachment #2550 is|0 |1 obsolete| | Attachment #3602 is|0 |1 obsolete| | Attachment #4519 is|0 |1 obsolete| | --- Comment #80 from neph...@skyhighway.com 2009-04-24 17:03:25 UTC --- Created an attachment (id=6056) --> (https://bugzilla.wikimedia.org/attachment.cgi?id=6056) Allow PPFrames to be used to truly make template variables available With the introduction of Preprocessor frames to the parsing process, a completely different approach to fixing this issue becomes available -- one which truly fixes the problem, instead of simply bypassing the problem through parser hooks (which do not provide identical functionality to extension tags). The attached patch works by: 1) Passing the current $frame to the extension tag-calling hook ($frame is also passed to the getVariableValue hook, too, in case extension writers have a need for $frame. there. too) $frame is added as an extra parameter, and therefore this change is transparent to existing extensions (which simply won't realize that there's an extra parameter available). 2) Passing the $frame back to the parser through recursiveTagParse Again, $frame is an extra, optional parameter, so there is no effect of this patch on any existing uses of recursiveTagParse; it simply makes additional functionality available to anyone who wishes to use it. 3) Assorted other code tweaks to pass the $frame variable as an optional argument to all necessary parser functions. In terms of usage, it means that all existing tag extensions will continue to work they way they always have. However, tag extensions that wish to expand template variables now have the option to do so, simply by 1) changing the argument list of the extension's implementation function, e.g. change: function efSampleRender( $input, $args, $parser ) to: function efSampleRender( $input, $args, $parser, $frame ) 2) add $frame to any recursiveTagParse calls, e.g., change: $output = $parser->recursiveTagParse( $text ); to: $output = $parser->recursiveTagParse( $text, $frame ); -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l