From c1b9dbaf11fd4b48e8c70aa0613cc81c82cc81cc Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 25 Sep 2006 21:32:02 +0200 Subject: metadebug parameter added With DokuWiki's reliance on certain page metadata, it is sometimes necessary to view the metadata of a page. This patch allows developers to append the parameter ?metadebug darcs-hash:20060925193202-7ad00-6a42c7458aaa1cc40df3c7a61ad70df5d64be152.gz --- inc/infoutils.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'inc') diff --git a/inc/infoutils.php b/inc/infoutils.php index 98bd22352..ab8bc8deb 100644 --- a/inc/infoutils.php +++ b/inc/infoutils.php @@ -247,4 +247,22 @@ function dbglog($msg){ } } +/** + * Prints the metadata of a given page + * + * Only prints when debugging is allowed and the metadebug request + * parameter is set + * + * The data is dumped after tpl_action and thus after the template's + * closing html tag. This makes the HTML invalid, but this is for + * debugging only anyway. + * + * @author Andreas Gohr + */ +function debug_meta($id){ + global $conf; + if(!$conf['allowdebug']) return; + if(!$_REQUEST['metadebug']) return; + dbg(p_get_metadata($id)); +} -- cgit v1.2.3