[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/ -> plugin.php (summary)

DokuWiki Plugin base class

Author: Christopher Smith
License: GPL 2 (http://www.gnu.org/licenses/gpl.html)
File Size: 300 lines (10 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

DokuWiki_Plugin:: (16 methods):
  getInfo()
  getPluginType()
  getPluginName()
  getPluginComponent()
  getLang()
  locale_xhtml()
  localFN()
  setupLocale()
  getConf()
  loadConfig()
  readDefaultSettings()
  loadHelper()
  email()
  external_link()
  render_text()
  isSingleton()


Class: DokuWiki_Plugin  - X-Ref

Do not inherit directly from this class, instead inherit from the specialized
ones in lib/plugin

getInfo()   X-Ref
General Info

Needs to return a associative array with the following values:

base   - the plugin's base name (eg. the directory it needs to be installed in)
author - Author of the plugin
email  - Email address to contact the author
date   - Last modified date of the plugin in YYYY-MM-DD format
name   - Name of the plugin
desc   - Short description of the plugin (Text only)
url    - Website with more information on the plugin (eg. syntax description)

getPluginType()   X-Ref

return: string  plugin type

getPluginName()   X-Ref

return: string  plugin name

getPluginComponent()   X-Ref

return: string  component name

getLang($id)   X-Ref
getLang($id)
use this function to access plugin language strings
to try to minimise unnecessary loading of the strings when the plugin doesn't require them
e.g. when info plugin is querying plugins for information about themselves.

param: string  $id     id of the string to be retrieved
return: string  string in appropriate language or english if not available

locale_xhtml($id)   X-Ref
locale_xhtml($id)

retrieve a language dependent file and pass to xhtml renderer for display
plugin equivalent of p_locale_xhtml()

param: string $id id of language dependent wiki page
return: string     parsed contents of the wiki page in xhtml format

localFN($id,$ext='txt')   X-Ref
Prepends appropriate path for a language dependent filename
plugin equivalent of localFN()

param: string $id id of localization file
param: string $ext The file extension (usually txt)
return: string wiki text

setupLocale()   X-Ref
Reads all the plugins language dependent strings into $this->lang
this function is automatically called by getLang()


getConf($setting, $notset=false)   X-Ref
getConf($setting)

use this function to access plugin configuration variables

param: string $setting the setting to access
param: mixed  $notset  what to return if the setting is not available
return: mixed

loadConfig()   X-Ref
loadConfig()
merges the plugin's default settings with any local settings
this function is automatically called through getConf()


readDefaultSettings()   X-Ref
read the plugin's default configuration settings from conf/default.php
this function is automatically called through getConf()

return: array    setting => value

loadHelper($name, $msg = true)   X-Ref
Loads a given helper plugin (if enabled)

param: string $name   name of plugin to load
param: bool   $msg    if a message should be displayed in case the plugin is not available
author: Esther Brunner <wikidesign@gmail.com>
return: DokuWiki_Plugin|null helper plugin object

email($email, $name='', $class='', $more='')   X-Ref
email
standardised function to generate an email link according to obfuscation settings

param: string $email
param: string $name
param: string $class
param: string $more
return: string html

external_link($link, $title='', $class='', $target='', $more='')   X-Ref
external_link
standardised function to generate an external link according to conf settings

param: string $link
param: string $title
param: string $class
param: string $target
param: string $more
return: string

render_text($text, $format='xhtml')   X-Ref
output text string through the parser, allows dokuwiki markup to be used
very ineffecient for small pieces of data - try not to use

param: string $text   wiki markup to parse
param: string $format output format
return: null|string

isSingleton()   X-Ref
Allow the plugin to prevent DokuWiki from reusing an instance

return: bool   false if the plugin has to be instantiated