Lines Matching full:id

60  * Returns the parsed Wikitext in XHTML for the given id and revision.
65 * @param string $id page id
74 function p_wiki_xhtml($id, $rev = '', $excuse = true, $date_at = '') argument
76 $file = wikiFN($id, $rev);
79 //ensure $id is in global $ID (needed for parsing)
80 global $ID;
81 $keep = $ID;
82 $ID = $id;
87 … $ret = p_render('xhtml', p_get_instructions(io_readWikiPage($file, $id, $rev)), $info, $date_at);
92 $ret = p_cached_output($file, 'xhtml', $id);
95 $changelog = new PageChangeLog($id);
103 //restore ID (just in case)
104 $ID = $keep;
112 * @param string $id page id
117 function p_locale_xhtml($id) argument
120 $data = ['id' => $id, 'html' => ''];
124 $data['html'] = p_cached_output(localeFN($data['id']));
136 * @param string $id page id
142 function p_cached_output($file, $format = 'xhtml', $id = '') argument
146 $cache = new CacheRenderer($id, $file, $format);
153 $parsed = p_render($format, p_cached_instructions($file, false, $id), $info);
177 * @param string $id page id
182 function p_cached_instructions($file, $cacheonly = false, $id = '') argument
187 $cache = new CacheInstructions($id, $file);
193 $ins = p_get_instructions(io_readWikiPage($file, $id));
235 * @param string $id The id of the page the metadata should be returned from
247 function p_get_metadata($id, $key = '', $render = METADATA_RENDER_USING_CACHE) argument
249 global $ID;
258 $cache = ($ID == $id);
259 $meta = p_read_metadata($id, $cache);
271 …recursion && $render != METADATA_DONT_RENDER && !isset($rendered_pages[$id]) && page_exists($id)) {
274 $cachefile = new CacheRenderer($id, wikiFN($id), 'metadata');
279 $pagefn = wikiFN($id);
280 $metafn = metaFN($id, '.meta');
291 $rendered_pages[$id] = true;
294 $meta = p_render_metadata($id, $meta);
296 if ($meta == $old_meta || p_save_metadata($id, $meta)) {
325 * @param string $id is the ID of a wiki page
335 function p_set_metadata($id, $data, $render = false, $persistent = true) argument
339 global $ID, $METADATA_RENDERERS;
342 if (isset($METADATA_RENDERERS[$id])) {
343 $orig =& $METADATA_RENDERERS[$id];
347 $cache = ($ID == $id);
348 $orig = p_read_metadata($id, $cache);
351 $meta = $render ? p_render_metadata($id, $orig) : $orig;
402 if (isset($METADATA_RENDERERS[$id])) {
404 $METADATA_RENDERERS[$id]['current'] = $meta['current'];
405 $METADATA_RENDERERS[$id]['persistent'] = $meta['persistent'];
408 return p_save_metadata($id, $meta);
416 * @param string $id page id
421 function p_purge_metadata($id) argument
423 $meta = p_read_metadata($id);
431 return p_save_metadata($id, $meta);
435 * read the metadata from source/cache for $id
438 * @param string $id absolute wiki page id
446 function p_read_metadata($id, $cache = false) argument
450 if (isset($cache_metadata[(string)$id])) return $cache_metadata[(string)$id];
452 $file = metaFN($id, '.meta');
458 $cache_metadata[(string)$id] = $meta;
467 * @param string $id absolute wiki page id
472 function p_save_metadata($id, $meta) argument
477 if (isset($cache_metadata[$id])) $cache_metadata[$id] = $meta;
478 if (!empty($INFO) && isset($INFO['id']) && ($id == $INFO['id'])) {
482 return io_saveFile(metaFN($id, '.meta'), serialize($meta));
488 * @param string $id page id
494 function p_render_metadata($id, $orig) argument
496 // make sure the correct ID is in global ID
497 global $ID, $METADATA_RENDERERS;
499 // avoid recursive rendering processes for the same id
500 if (isset($METADATA_RENDERERS[$id])) {
505 $METADATA_RENDERERS[$id] =& $orig;
507 $keep = $ID;
508 $ID = $id;
511 $orig['page'] = $id;
515 $instructions = p_cached_instructions(wikiFN($id), false, $id);
517 $ID = $keep;
518 unset($METADATA_RENDERERS[$id]);
538 $ID = $keep;
539 unset($METADATA_RENDERERS[$id]);
647 * @param string $id dokuwiki page id
659 function p_get_first_heading($id, $render = METADATA_RENDER_USING_SIMPLE_CACHE) argument
661 return p_get_metadata(cleanID($id), 'title', $render);