[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/ -> pageutils.php (summary)

Utilities for handling pagenames

Author: Andreas Gohr
License: GPL 2 (http://www.gnu.org/licenses/gpl.html)
File Size: 581 lines (15 kb)
Included or required: 15 times
Referenced: 0 times
Includes or requires: 0 files

Defines 21 functions

  getID()
  cleanID()
  getNS()
  noNS()
  curNS()
  noNSorNS()
  sectionID()
  page_exists()
  wikiFN()
  wikiLockFN()
  metaFN()
  metaFiles()
  mediaFN()
  localeFN()
  resolve_id()
  resolve_mediaid()
  resolve_pageid()
  getCacheName()
  isHiddenPage()
  isVisiblePage()
  http_conditionalRequest()

Functions
Functions that are not part of a class:

getID($param='id',$clean=true)   X-Ref
Fetch the an ID from request

Uses either standard $_REQUEST variable or extracts it from
the full request URI when userewrite is set to 2

For $param='id' $conf['start'] is returned if no id was found.
If the second parameter is true (default) the ID is cleaned.

author: Andreas Gohr <andi@splitbrain.org>

cleanID($raw_id,$ascii=false,$media=false)   X-Ref
Remove unwanted chars from ID

Cleans a given ID to only use allowed characters. Accented characters are
converted to unaccented ones

author: Andreas Gohr <andi@splitbrain.org>
param: string  $raw_id    The pageid to clean
param: boolean $ascii     Force ASCII
param: boolean $media     Allow leading or trailing _ for media files

getNS($id)   X-Ref
Return namespacepart of a wiki ID

author: Andreas Gohr <andi@splitbrain.org>

noNS($id)   X-Ref
Returns the ID without the namespace

author: Andreas Gohr <andi@splitbrain.org>

curNS($id)   X-Ref
Returns the current namespace

author: Nathan Fritz <fritzn@crown.edu>

noNSorNS($id)   X-Ref
Returns the ID without the namespace or current namespace for 'start' pages

author: Nathan Fritz <fritzn@crown.edu>

sectionID($title,&$check=null)   X-Ref
Creates a XHTML valid linkid from a given headline title

author: Andreas Gohr <andi@splitbrain.org>
param: string  $title   The headline title
param: array   $check   List of existing IDs

page_exists($id,$rev='',$clean=true)   X-Ref
Wiki page existence check

parameters as for wikiFN

author: Chris Smith <chris@jalakai.co.uk>

wikiFN($raw_id,$rev='',$clean=true)   X-Ref
returns the full path to the datafile specified by ID and optional revision

The filename is URL encoded to protect Unicode chars

author: Andreas Gohr <andi@splitbrain.org>
param: $raw_id  string   id of wikipage
param: $rev     string   page revision, empty string for current
param: $clean   bool     flag indicating that $raw_id should be cleaned.  Only set to false

wikiLockFN($id)   X-Ref
Returns the full path to the file for locking the page while editing.

author: Ben Coburn <btcoburn@silicodon.net>

metaFN($id,$ext)   X-Ref
returns the full path to the meta file specified by ID and extension

The filename is URL encoded to protect Unicode chars

author: Steven Danz <steven-danz@kc.rr.com>

metaFiles($id)   X-Ref
returns an array of full paths to all metafiles of a given ID

author: Esther Brunner <esther@kaffeehaus.ch>

mediaFN($id)   X-Ref
returns the full path to the mediafile specified by ID

The filename is URL encoded to protect Unicode chars

author: Andreas Gohr <andi@splitbrain.org>

localeFN($id)   X-Ref
Returns the full filepath to a localized textfile if local
version isn't found the english one is returned

author: Andreas Gohr <andi@splitbrain.org>

resolve_id($ns,$id,$clean=true)   X-Ref
Resolve relative paths in IDs

Do not call directly use resolve_mediaid or resolve_pageid
instead

Partyly based on a cleanPath function found at
http://www.php.net/manual/en/function.realpath.php#57016

author: <bart at mediawave dot nl>

resolve_mediaid($ns,&$page,&$exists)   X-Ref
Returns a full media id

author: Andreas Gohr <andi@splitbrain.org>

resolve_pageid($ns,&$page,&$exists)   X-Ref
Returns a full page id

author: Andreas Gohr <andi@splitbrain.org>

getCacheName($data,$ext='')   X-Ref
Returns the name of a cachefile from given data

The needed directory is created by this function!

author: Andreas Gohr <andi@splitbrain.org>
param: string $data  This data is used to create a unique md5 name
param: string $ext   This is appended to the filename if given
return: string       The filename of the cachefile

isHiddenPage($id)   X-Ref
Checks a pageid against $conf['hidepages']

author: Andreas Gohr <gohr@cosmocode.de>

isVisiblePage($id)   X-Ref
Reverse of isHiddenPage

author: Andreas Gohr <gohr@cosmocode.de>

http_conditionalRequest($timestamp)   X-Ref
Checks and sets HTTP headers for conditional HTTP requests

link: http://simon.incutio.com/archive/2003/04/23/conditionalGet
returns: void or void with previously header() commands executed
author: Simon Willison <swillison@gmail.com>
param: timestamp $timestamp lastmodified time of the cache file



Generated: Tue Dec 2 01:30:01 2008 Cross-referenced by PHPXref 0.7