From 4a81940267e4278153d3726b605286fd963084ec Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Mon, 10 Jan 2011 20:39:44 +0100 Subject: Activate the render parameter of p_get_metadata p_get_metadata has a $render parameter that has been disabled by the restructuring of metadata rendering. This change reactivates it so rendering metadata can be prevented. This is e.g. used in the search and in some plugins like indexmenu that use p_get_first_heading. The default of the parameter has been changed to true as otherwise the new caching structure won't work as almost all calls to p_get_metadata don't set the $render parameter. The indexer call to p_get_first_heading has been changed to set $render to true as in the indexer only one page will be rendered and the title in the index should really be the current one. This does not fix the problem that rendering pages with lots of links or displaying the index can cause the parsing/rendering of a lot of pages. --- inc/parserutils.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'inc/parserutils.php') diff --git a/inc/parserutils.php b/inc/parserutils.php index fbdc2e3a9..9224dae10 100644 --- a/inc/parserutils.php +++ b/inc/parserutils.php @@ -220,10 +220,15 @@ function p_get_instructions($text){ /** * returns the metadata of a page * + * @param string $id The id of the page the metadata should be returned from + * @param string $key The key of the metdata value that shall be read (by default everything) - separate hierarchies by " " like "date created" + * @param boolean $render If the page should be rendererd when the cache can't be used - default true + * @return mixed The requested metadata fields + * * @author Esther Brunner * @author Michael Hamann */ -function p_get_metadata($id, $key='', $render=false){ +function p_get_metadata($id, $key='', $render=true){ global $ID; // cache the current page @@ -234,7 +239,7 @@ function p_get_metadata($id, $key='', $render=false){ // prevent recursive calls in the cache static $recursion = false; - if (!$recursion){ + if (!$recursion && $render){ $recursion = true; $cachefile = new cache_renderer($id, wikiFN($id), 'metadata'); -- cgit v1.2.3