summaryrefslogtreecommitdiff
path: root/inc/parserutils.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/parserutils.php')
-rw-r--r--inc/parserutils.php49
1 files changed, 43 insertions, 6 deletions
diff --git a/inc/parserutils.php b/inc/parserutils.php
index 9c2a0b570..791033e63 100644
--- a/inc/parserutils.php
+++ b/inc/parserutils.php
@@ -55,6 +55,11 @@ define('METADATA_RENDER_UNLIMITED', 4);
* wasn't found
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id page id
+ * @param string|int $rev revision timestamp or empty string
+ * @param bool $excuse
+ * @return null|string
*/
function p_wiki_xhtml($id, $rev='', $excuse=true){
$file = wikiFN($id,$rev);
@@ -89,6 +94,9 @@ function p_wiki_xhtml($id, $rev='', $excuse=true){
* Returns the specified local text in parsed format
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id page id
+ * @return null|string
*/
function p_locale_xhtml($id){
//fetch parsed locale
@@ -101,6 +109,11 @@ function p_locale_xhtml($id){
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Chris Smith <chris@jalakai.co.uk>
+ *
+ * @param string $file filename, path to file
+ * @param string $format
+ * @param string $id page id
+ * @return null|string
*/
function p_cached_output($file, $format='xhtml', $id='') {
global $conf;
@@ -129,6 +142,11 @@ function p_cached_output($file, $format='xhtml', $id='') {
* Uses and creates a serialized cache file
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $file filename, path to file
+ * @param bool $cacheonly
+ * @param string $id page id
+ * @return array|null
*/
function p_cached_instructions($file,$cacheonly=false,$id='') {
static $run = null;
@@ -157,7 +175,8 @@ function p_cached_instructions($file,$cacheonly=false,$id='') {
*
* @author Harry Fuecks <hfuecks@gmail.com>
* @author Andreas Gohr <andi@splitbrain.org>
- * @param string $text raw wiki syntax text
+ *
+ * @param string $text raw wiki syntax text
* @return array a list of instruction arrays
*/
function p_get_instructions($text){
@@ -185,9 +204,9 @@ 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 int $render If the page should be rendererd - possible values:
+ * @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 int $render If the page should be rendererd - possible values:
* METADATA_DONT_RENDER, METADATA_RENDER_USING_SIMPLE_CACHE, METADATA_RENDER_USING_CACHE
* METADATA_RENDER_UNLIMITED (also combined with the previous two options),
* default: METADATA_RENDER_USING_CACHE
@@ -360,6 +379,9 @@ function p_set_metadata($id, $data, $render=false, $persistent=true){
* used on page deletion
*
* @author Michael Klier <chi@chimeric.de>
+ *
+ * @param string $id page id
+ * @return bool success / fail
*/
function p_purge_metadata($id) {
$meta = p_read_metadata($id);
@@ -423,6 +445,10 @@ function p_save_metadata($id, $meta) {
* renders the metadata of a page
*
* @author Esther Brunner <esther@kaffeehaus.ch>
+ *
+ * @param string $id page id
+ * @param array $orig the original metadata
+ * @return array|null array('current'=> array,'persistent'=> array);
*/
function p_render_metadata($id, $orig){
// make sure the correct ID is in global ID
@@ -477,6 +503,8 @@ function p_render_metadata($id, $orig){
* returns all available parser syntax modes in correct order
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @return array[] with for each plugin the array('sort' => sortnumber, 'mode' => mode string, 'obj' => plugin object)
*/
function p_get_parsermodes(){
global $conf;
@@ -569,6 +597,10 @@ function p_get_parsermodes(){
* Callback function for usort
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array $a
+ * @param array $b
+ * @return int $a is lower/equal/higher than $b
*/
function p_sort_modes($a, $b){
if($a['sort'] == $b['sort']) return 0;
@@ -582,6 +614,11 @@ function p_sort_modes($a, $b){
*
* @author Harry Fuecks <hfuecks@gmail.com>
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $mode
+ * @param array $instructions
+ * @param array $info returns render info like enabled toc and cache
+ * @return null|string rendered output
*/
function p_render($mode,$instructions,&$info){
if(is_null($instructions)) return '';
@@ -673,8 +710,8 @@ function p_get_renderer($mode) {
* METADATA_RENDER_USING_SIMPLE_CACHE,
* METADATA_RENDER_USING_CACHE,
* METADATA_RENDER_UNLIMITED
- *
* @return string|null The first heading
+ *
* @author Andreas Gohr <andi@splitbrain.org>
* @author Michael Hamann <michael@content-space.de>
*/
@@ -688,8 +725,8 @@ function p_get_first_heading($id, $render=METADATA_RENDER_USING_SIMPLE_CACHE){
* @param string $code source code to be highlighted
* @param string $language language to provide highlighting
* @param string $wrapper html element to wrap the returned highlighted text
- *
* @return string xhtml code
+ *
* @author Christopher Smith <chris@jalakai.co.uk>
* @author Andreas Gohr <andi@splitbrain.org>
*/