[ Index ]
 

Code source de DokuWiki 2006-11-06

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/inc/ -> common.php (sommaire)

Common DokuWiki functions

Author: Andreas Gohr <andi@splitbrain.org>
License: GPL 2 (http://www.gnu.org/licenses/gpl.html)
Poids: 1011 lignes (26 kb)
Inclus ou requis: 14 fois
Référencé: 0 fois
Nécessite: 7 fichiers
 inc/utf8.php
 inc/mail.php
 inc/infoutils.php
 inc/parserutils.php
 inc/DifferenceEngine.php
 inc/changelog.php
 inc/io.php

Définit 34 fonctions

  hsc()
  ptln()
  stripctl()
  pageinfo()
  buildURLparams()
  buildAttributes()
  breadcrumbs()
  idfilter()
  wl()
  exportlink()
  ml()
  script()
  checkwordblock()
  clientIP()
  checklock()
  lock()
  unlock()
  cleanText()
  formText()
  rawLocale()
  rawWiki()
  pageTemplate()
  rawWikiSlices()
  con()
  saveWikiText()
  saveOldRevision()
  notify()
  getGoogleQuery()
  setCorrectLocale()
  filesize_h()
  obfuscate()
  is_subscribed()
  subscriber_addresslist()
  unslash()

Fonctions
Fonctions qui ne font pas partie d'une Classe:

hsc($string)   X-Ref
Wrapper around htmlspecialchars()

author: Andreas Gohr <andi@splitbrain.org>

ptln($string,$intend=0)   X-Ref
print a newline terminated string

You can give an indention as optional parameter

author: Andreas Gohr <andi@splitbrain.org>

stripctl($string)   X-Ref
strips control characters (<32) from the given string

author: Andreas Gohr <andi@splitbrain.org>

pageinfo()   X-Ref
Return info about the current document as associative
array.

author: Andreas Gohr <andi@splitbrain.org>

buildURLparams($params, $sep='&amp;')   X-Ref
Build an string of URL parameters

author: Andreas Gohr

buildAttributes($params)   X-Ref
Build an string of html tag attributes

Skips keys starting with '_', values get HTML encoded

author: Andreas Gohr

breadcrumbs()   X-Ref
This builds the breadcrumb trail and returns it as array

author: Andreas Gohr <andi@splitbrain.org>

idfilter($id,$ue=true)   X-Ref
Filter for page IDs

This is run on a ID before it is outputted somewhere
currently used to replace the colon with something else
on Windows systems and to have proper URL encoding

Urlencoding is ommitted when the second parameter is false

author: Andreas Gohr <andi@splitbrain.org>

wl($id='',$more='',$abs=false,$sep='&amp;')   X-Ref
This builds a link to a wikipage

It handles URL rewriting and adds additional parameter if
given in $more

author: Andreas Gohr <andi@splitbrain.org>

exportlink($id='',$format='raw',$more='',$abs=false,$sep='&amp;')   X-Ref
This builds a link to an alternate page format

Handles URL rewriting if enabled. Follows the style of wl().

author: Ben Coburn <btcoburn@silicodon.net>

ml($id='',$more='',$direct=true,$sep='&amp;')   X-Ref
Build a link to a media file

Will return a link to the detail page if $direct is false

script($script='doku.php')   X-Ref
Just builds a link to a script

author: Andreas Gohr <andi@splitbrain.org>

checkwordblock()   X-Ref
Spamcheck against wordlist

Checks the wikitext against a list of blocked expressions
returns true if the text contains any bad words

author: Andreas Gohr <andi@splitbrain.org>

clientIP($single=false)   X-Ref
Return the IP of the client

Honours X-Forwarded-For and X-Real-IP Proxy Headers

It returns a comma separated list of IPs if the above mentioned
headers are set. If the single parameter is set, it tries to return
a routable public address, prefering the ones suplied in the X
headers

author: Andreas Gohr <andi@splitbrain.org>
param: boolean $single If set only a single IP is returned

checklock($id)   X-Ref
Checks if a given page is currently locked.

removes stale lockfiles

author: Andreas Gohr <andi@splitbrain.org>

lock($id)   X-Ref
Lock a page for editing

author: Andreas Gohr <andi@splitbrain.org>

unlock($id)   X-Ref
Unlock a page if it was locked by the user

author: Andreas Gohr <andi@splitbrain.org>
return: bool true if a lock was removed

cleanText($text)   X-Ref
convert line ending to unix format

author: Andreas Gohr <andi@splitbrain.org>

formText($text)   X-Ref
Prepares text for print in Webforms by encoding special chars.
It also converts line endings to Windows format which is
pseudo standard for webforms.

author: Andreas Gohr <andi@splitbrain.org>

rawLocale($id)   X-Ref
Returns the specified local text in raw format

author: Andreas Gohr <andi@splitbrain.org>

rawWiki($id,$rev='')   X-Ref
Returns the raw WikiText

author: Andreas Gohr <andi@splitbrain.org>

pageTemplate($data)   X-Ref
Returns the pagetemplate contents for the ID's namespace

author: Andreas Gohr <andi@splitbrain.org>

rawWikiSlices($range,$id,$rev='')   X-Ref
Returns the raw Wiki Text in three slices.

The range parameter needs to have the form "from-to"
and gives the range of the section in bytes - no
UTF-8 awareness is needed.
The returned order is prefix, section and suffix.

author: Andreas Gohr <andi@splitbrain.org>

con($pre,$text,$suf,$pretty=false)   X-Ref
Joins wiki text slices

function to join the text slices with correct lineendings again.
When the pretty parameter is set to true it adds additional empty
lines between sections if needed (used on saving).

author: Andreas Gohr <andi@splitbrain.org>

saveWikiText($id,$text,$summary,$minor=false)   X-Ref
Saves a wikitext by calling io_writeWikiPage.
Also directs changelog and attic updates.

author: Andreas Gohr <andi@splitbrain.org>
author: Ben Coburn <btcoburn@silicodon.net>

saveOldRevision($id)   X-Ref
moves the current version to the attic and returns its
revision date

author: Andreas Gohr <andi@splitbrain.org>

notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()   X-Ref
Sends a notify mail on page change

author: Andreas Gohr <andi@splitbrain.org>
param: string  $id       The changed page
param: string  $who      Who to notify (admin|subscribers)
param: int     $rev      Old page revision
param: string  $summary  What changed
param: boolean $minor    Is this a minor edit?
param: array   $replace  Additional string substitutions, @KEY@ to be replaced by value

getGoogleQuery()   X-Ref
extracts the query from a google referer

author: Andreas Gohr <andi@splitbrain.org>

setCorrectLocale()   X-Ref
Try to set correct locale

author: Andreas Gohr <andi@splitbrain.org>

filesize_h($size, $dec = 1)   X-Ref
Return the human readable size of a file

author: Martin Benjamin <b.martin@cybernet.ch>
author: Aidan Lister <aidan@php.net>
param: int    $size   A file size
param: int    $dec    A number of decimal places

obfuscate($email)   X-Ref
return an obfuscated email address in line with $conf['mailguard'] setting

author: Harry Fuecks <hfuecks@gmail.com>
author: Christopher Smith <chris@jalakai.co.uk>

is_subscribed($id,$uid)   X-Ref
Let us know if a user is tracking a page

author: Andreas Gohr <andi@splitbrain.org>

subscriber_addresslist($id)   X-Ref
Return a string with the email addresses of all the
users subscribed to a page

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

unslash($string,$char="'")   X-Ref
Removes quoting backslashes

author: Andreas Gohr <andi@splitbrain.org>



Généré le : Tue Apr 3 20:47:31 2007 par Balluche grâce à PHPXref 0.7