[dokuwiki] Handler::status['section']

  • From: Guillaume Turri <guillaume.turri@xxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 11 Aug 2011 15:33:11 +0200

Hi,

After looking at the code and the documentation, I have some questions
regarding the use of the $status['section'] of the Doku_Handler.

More precisely, I have a syntax (substition) plugin[1] which mainly puts
text in a div (so that this div may be hidden).  It accepts several modes,
so that, in particular, titles may be rendered in this foldenable div.

I notice that there is an issue if this div contains a title and the
$status['section'] of the handler is true. Indeed, the processing of this
title will close my div prematurely.

I seems to have a couple of solutions to avoid this, but I don't know which
are good practices and which are dirty hacks:
- if I brutally set $handler->status['section'] = false in my plugin's
handle(), the display is correct. However, this $status attribute isn't
documented, so I'm not sure I'm not breaking anything when I tweak with it
- I may also consider that I don't accept titles mode and use a preg_match
in my plugin's render function to trigger myself $renderer->header(), but I
would feel like duplicating a bit of the handler's code...
- finally, I tried to use something like $handler->_addCall('section_open',
...) at the beginning of the processing of my plugin, but it doesn't seems
to work at all.

To put it in a nutshell:
Is it possible to tell the Handler that the current section should not be
closed while in my plugin's mode (and what would be the proper way to do
it)?

Thank you in advance for your answers,

Regards,
Guillaume

[1]: http://www.dokuwiki.org/plugin:hidden

Other related posts: