Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set page context in Handler #3267

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

set page context in Handler #3267

wants to merge 1 commit into from

Commits on Sep 28, 2020

  1. set page context in Handler

    Under some circumstances it is useful to know if the current parsing
    process is running in a page context or not.
    
    One of the examples is the struct plugin's use of the PARSER_HANDLER_DONE
    event to automatically inject its own output instruction. Currently this
    instruction is injected in each and every processing and only on rendering
    is decided if there is anything to output.
    
    This patch injects a page hint into the Handler when the handler was
    created from our p_wiki_xhtml() method (and only then). Plugins can use
    the getPage() method to check the context if needed.
    
    Note: currently p_wiki_xhtml() also modifies the global $ID variable
    which might also used as context hint (but will also be set during
    on-the-fly renders, eg. the preview intro text).
    
    It would probably be a good idea to check if it would be better when all
    handle methods rely on getPage() instead of global $ID instead. This
    would be a major change in parsing though and needs serious testing
    while this addition has basically no consequences currently.
    splitbrain committed Sep 28, 2020
    Configuration menu
    Copy the full SHA
    bdf0912 View commit details
    Browse the repository at this point in the history