Recent Changes - Search:

add Extensions page

hide Extensions

Extensions


hide Topics

Topics

show Changed

Changed

Visitor's book Site map pmwiki-2.3.37

Messages Replacement

  • delete this comment
  • change skiwi

MessagesReplacement version 2024-09-16new

Summary: A drop in replacement for the PmWiki (:messages:) directive
Version:2024-09-15
Prerequisites: PmWiki 2.3.37; PHP 8.3; ExtensionHub
Status: beta
Maintainer: skiwi
Licence: GPL3#
Users: (view / edit)

Questions answered by this extension

Can I display selected debugging messages from $MessagesFmt from only one, or from selected, named message sources?
Can I make the messages from each named message source hidden until shown on user demand?

Description

A drop in replacement for the PmWiki (:messages key= :) directive. Based on code from PITS:01368.

The global variable $MessagesFmt is written to by PmWiki extensions and recipes with debug and similar information. By convention the array has two dimensions, the first a string identifying the source of the message, and the optional second dimension, a string with the debug message itself.

Differences are:

  • comma or space separated name parameters, with wildcards, can be supplied to select the groups of messages displayed
  • only messages for specified name parameters are displayed
  • name parameters are case insensitive
  • directive does not have to start at the beginning of a line
  • the output is placed within a HTML section of class=messages
  • groups of messages can be rolled up by using the detail=show | hide parameter

Installation

Usage

Place the directive, as described below, in your PmWiki page.

This extension provides a page variable {$MessagesReplacementVersion} which contains the current version, and page variable $@MessagesReplacement for a (:if enabled MessagesReplacement:) extension installation check.

Configuration

(:messages optional,list of names with,wildcards* keys="names,with,*wildcards" detail=hide :)

Parameters are optional and case-insensitive:

  • names can include wild cards
  • key= a comma separated list of names which can include wild cards
  • detail='show' or detail='hide' provides a clickable name for each group of messages with initial value of show or hide

Change log / Release notes

2024-09-15 struggling with extGetConfig 2024-08-20 convert to extension 2024-05-31 add key= parameter to maintain compatibility with built in directive 2024-04-27 fix PHP 8 warnings, add detail=show||hide parameter 2022-02-02 Separate groups of messages, enable heading 2022-01-22 Initial version

See also

Contributors

Special thanks to Petko

Comments

See discussion at MessagesReplacement-Talk

tahi Page last modified on 2024 Sept 15 09:41

Edit - History - Recent Changes - WikiHelp - Search - (:messages:) -> mailto:?Subject="KiwiWiki: Messages Replacement"&Body="From KiwiWiki: Messages Replacement (http://kiwiwiki [period] co [period] nz/Extensions/MessagesReplacement) - A drop in replacement for the PmWiki [[PmWiki:PageDirectives#message directive" | email page as link ]]