DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:event:infoutil_msg_show

INFOUTIL_MSG_SHOW

Description:
catch calls to msg() to record the message or modify output
DefaultAction:
the new message is inserted into display queue and triggers html_msgarea() in certain cases
Preventable:
yes
Added:
2020-06-01

This event is signalled by msg() in inc/infoutils.php. Handlers can use it to record message data, modify it, or suppress the default output to implement their own HTML output.

Passed Data

The passed Doku_Event object has the field: $data.

The $data field is an array with the entries:

  • $data['msg']: $message variable of msg(). The message content. May include HTML.
  • $data['lvl']: $lvl variable of msg(). A number that represent message level (-1 error, 0 info, 1 success, 2 notify).
  • $data['allow']: $allow variable of msg(). The user that allows to see the message, MSG_PUBLIC, MSG_USERS_ONLY, MSG_MANAGERS_ONLY, or MSG_ADMINS_ONLY.
  • $data['line']: $line variable of msg. The default behavior will append this to the end of the message.
  • $data['file']: $file variable of msg. The default behavior will append this to the end of the message.

The BEFORE event let you prevent the default behavior of appending the message to $MSG and displaying it (so you can implement your own), and modifying the data.

The AFTER event happens after the message is saved in $MSG array, and conditionally displayed.

See also

devel/event/infoutil_msg_show.txt · Last modified: 2020-06-07 07:02 by phy25

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki