Lines Matching defs:id
65 * Returns the parsed Wikitext in XHTML for the given id and revision.
70 * @param string $id page id
79 function p_wiki_xhtml($id, $rev = '', $excuse = true, $date_at = '')
81 $file = wikiFN($id, $rev);
84 //ensure $id is in global $ID (needed for parsing)
87 $ID = $id;
92 $ret = p_render('xhtml', p_get_instructions(io_readWikiPage($file, $id, $rev)), $info, $date_at);
97 $ret = p_cached_output($file, 'xhtml', $id);
100 $changelog = new PageChangeLog($id);
117 * @param string $id page id
122 function p_locale_xhtml($id)
125 $data = ['id' => $id, 'html' => ''];
129 $data['html'] = p_cached_output(localeFN($data['id']));
141 * @param string $id page id
147 function p_cached_output($file, $format = 'xhtml', $id = '')
151 $cache = new CacheRenderer($id, $file, $format);
158 $parsed = p_render($format, p_cached_instructions($file, false, $id), $info);
182 * @param string $id page id
187 function p_cached_instructions($file, $cacheonly = false, $id = '')
192 $cache = new CacheInstructions($id, $file);
198 $ins = p_get_instructions(io_readWikiPage($file, $id));
240 * @param string $id The id of the page the metadata should be returned from
252 function p_get_metadata($id, $key = '', $render = METADATA_RENDER_USING_CACHE)
263 $cache = ($ID == $id);
264 $meta = p_read_metadata($id, $cache);
276 if (!$recursion && $render != METADATA_DONT_RENDER && !isset($rendered_pages[$id]) && page_exists($id)) {
279 $cachefile = new CacheRenderer($id, wikiFN($id), 'metadata');
284 $pagefn = wikiFN($id);
285 $metafn = metaFN($id, '.meta');
296 $rendered_pages[$id] = true;
299 $meta = p_render_metadata($id, $meta);
301 if ($meta == $old_meta || p_save_metadata($id, $meta)) {
330 * @param string $id is the ID of a wiki page
340 function p_set_metadata($id, $data, $render = false, $persistent = true)
347 if (isset($METADATA_RENDERERS[$id])) {
348 $orig =& $METADATA_RENDERERS[$id];
352 $cache = ($ID == $id);
353 $orig = p_read_metadata($id, $cache);
356 $meta = $render ? p_render_metadata($id, $orig) : $orig;
407 if (isset($METADATA_RENDERERS[$id])) {
409 $METADATA_RENDERERS[$id]['current'] = $meta['current'];
410 $METADATA_RENDERERS[$id]['persistent'] = $meta['persistent'];
413 return p_save_metadata($id, $meta);
421 * @param string $id page id
426 function p_purge_metadata($id)
428 $meta = p_read_metadata($id);
436 return p_save_metadata($id, $meta);
440 * read the metadata from source/cache for $id
443 * @param string $id absolute wiki page id
451 function p_read_metadata($id, $cache = false)
455 if (isset($cache_metadata[(string)$id])) return $cache_metadata[(string)$id];
457 $file = metaFN($id, '.meta');
463 $cache_metadata[(string)$id] = $meta;
472 * @param string $id absolute wiki page id
477 function p_save_metadata($id, $meta)
482 if (isset($cache_metadata[$id])) $cache_metadata[$id] = $meta;
483 if (!empty($INFO) && isset($INFO['id']) && ($id == $INFO['id'])) {
487 return io_saveFile(metaFN($id, '.meta'), serialize($meta));
493 * @param string $id page id
499 function p_render_metadata($id, $orig)
504 // avoid recursive rendering processes for the same id
505 if (isset($METADATA_RENDERERS[$id])) {
510 $METADATA_RENDERERS[$id] =& $orig;
513 $ID = $id;
516 $orig['page'] = $id;
520 $instructions = p_cached_instructions(wikiFN($id), false, $id);
523 unset($METADATA_RENDERERS[$id]);
544 unset($METADATA_RENDERERS[$id]);
758 * @param string $id dokuwiki page id
770 function p_get_first_heading($id, $render = METADATA_RENDER_USING_SIMPLE_CACHE)
772 return p_get_metadata(cleanID($id), 'title', $render);