| [ Index ] |
PHP Cross Reference of DokuWiki |
[Source view] [Print] [Project Stats]
Common DokuWiki functions
| Author: | Andreas Gohr |
| License: | GPL 2 (http://www.gnu.org/licenses/gpl.html) |
| File Size: | 1274 lines (35 kb) |
| Included or required: | 17 times |
| Referenced: | 0 times |
| Includes or requires: | 7 files inc/utf8.php inc/mail.php inc/infoutils.php inc/parserutils.php inc/DifferenceEngine.php inc/changelog.php inc/io.php |
| hsc($string) X-Ref |
| Wrapper around htmlspecialchars() author: Andreas Gohr <andi@splitbrain.org> see: htmlspecialchars() |
| ptln($string,$indent=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> |
| getSecurityToken() X-Ref |
| Return a secret token to be used for CSRF attack prevention link: http://en.wikipedia.org/wiki/Cross-site_request_forgery link: http://christ1an.blogspot.com/2007/04/preventing-csrf-efficiently.html author: Andreas Gohr <andi@splitbrain.org> return: string |
| checkSecurityToken($token=null) X-Ref |
| Check the secret CSRF token |
| formSecurityToken($print=true) X-Ref |
| Print a hidden form field with a secret CSRF token 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='&') X-Ref |
| Build an string of URL parameters author: Andreas Gohr |
| buildAttributes($params,$skipempty=false) 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='&') 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='&') 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='&',$abs=false) X-Ref |
| Build a link to a media file Will return a link to the detail page if $direct is false The $more parameter should always be given as array, the function then will strip default parameters to produce even cleaner URLs param: string $id - the media file id or URL param: mixed $more - string or array with additional parameters param: boolean $direct - link to detail page if false param: string $sep - URL parameter separator param: boolean $abs - Create an absolute URL |
| 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 |
| clientismobile() X-Ref |
| Check if the browser is on a mobile device Adapted from the example code at url below link: http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#code |
| gethostsbyaddrs($ips) X-Ref |
| Convert one or more comma separated IPs to hostnames returns: a comma separated list of hostnames author: Glen Harris <astfgl@iamnota.org> |
| 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> see: formText() for 2crlf conversion |
| 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> see: cleanText() for 2unix conversion |
| 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 search engine referrer author: Andreas Gohr <andi@splitbrain.org> author: Todd Augsburger <todd@rollerorgans.com> |
| 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,$ns=false) X-Ref |
| Let us know if a user is tracking a page or a namespace 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> |
| php_to_byte($v) X-Ref |
| Convert php.ini shorthands to byte link: http://de3.php.net/manual/en/ini.core.php#79564 author: <gilthans dot NO dot SPAM at gmail dot com> |
| preg_quote_cb($string) X-Ref |
| Wrapper around preg_quote adding the default delimiter |
| shorten($keep,$short,$max,$min=9,$char='⌇') X-Ref |
| Shorten a given string by removing data from the middle You can give the string in two parts, teh first part $keep will never be shortened. The second part $short will be cut in the middle to shorten but only if at least $min chars are left to display it. Otherwise it will be left off. param: string $keep the part to keep param: string $short the part to shorten param: int $max maximum chars you want for the whole string param: int $min minimum number of chars to have left for middle shortening param: string $char the shortening character to use |
| Generated: Sat Sep 6 01:30:01 2008 | Cross-referenced by PHPXref 0.7 |