diff options
author | Michael Hamann <michael@content-space.de> | 2011-01-10 20:39:44 +0100 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2011-01-10 20:39:44 +0100 |
commit | 4a81940267e4278153d3726b605286fd963084ec (patch) | |
tree | 16b52a6e0bb14b472e94f6ece346563ae7df8b22 /inc/parserutils.php | |
parent | d6a4a040ca66d247bb4c3fc3e67c4ee683c920b2 (diff) | |
download | rpg-4a81940267e4278153d3726b605286fd963084ec.tar.gz rpg-4a81940267e4278153d3726b605286fd963084ec.tar.bz2 |
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.
Diffstat (limited to 'inc/parserutils.php')
-rw-r--r-- | inc/parserutils.php | 9 |
1 files changed, 7 insertions, 2 deletions
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 <esther@kaffeehaus.ch> * @author Michael Hamann <michael@content-space.de> */ -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'); |