Wiki Plugin
Since Php Wiki-1.3.3 support for WikiPlugins is included.
A plugin is some PHP code that
- lives in phpwiki/lib/plugin/<pluginname>.php
- implements the WikiPlugin interface by extending that class.
There are many plugins already distributed with Php Wiki. Simply look in the lib/plugin directory or see the Plugin Manager list.
To write your own, look at the Hello World Plugin (HelloWorld.php in that directory),
which is a minimal example of a plugin.
Publish your self-written plugin at a new Php Wiki page with PluginName + Plugin appended
and add a link to
CategoryContributedPlugin.
A Wiki Plugin allows one to easily add new types of dynamic content (as well as other functionality) to wiki pages within Php Wiki. In this very wiki all actions which are not entirely lowercased are implemented using plugins, and some lowercased convenience actions also. (rename, revert, setacl, diff, ...)
(The old-style Magic Php Wiki URLs have been replaced by plugins entrirely.)
Example
Currently, one invokes a plugin by putting something like:
<?plugin AllPages limit=5?>
into a regular wiki-page. That particular example produces a list of the first 5 existing pages (via the PageList library).
Details
Plugins can take certain named arguments (most do). The values of these arguments can be determined four different ways. In order of precedence:
The plugin invocation can specify the value for an argument, like so:
<?plugin BackLinks page=OtherPage ?>
The argument can be specified via an HTTP query argument. This doesn't happen (is not allowed) unless the argument is mentioned in the plugin invocation:
<?plugin BackLinks page ?>
Default values specified in the plugin invocation:
<?plugin BackLinks page||=OtherPage ?>
The plugin must supply default values for each argument it uses. Such default args may be overriden by URL arguments like so:
BackLinks?page=ThisPage&sortby=-mtime
(The Back Links plugin uses the current page as the default value for the page argument.)
Most plugins using the PageListLibrary inherit their default arguments from the
PhpWiki:PageListLibrary.
Standard Arguments
Most plugins display a list of pages, via the PageListLibrary. PageList provides automatic support for those arguments.
info, exclude, author, owner, creator, sortby, limit, paging, cols, azhead, comma, commasep, ordered
For details see the
PhpWiki:PageListLibrary documentation.
exclude and pages accept a list of pages. Either as comma-seperated list,
supporting glob-style wildcards, or via the <!plugin-list pluginname [args] !>
invocation syntax, where pluginname might be any plugin returning a pagelist.
See
PhpWiki:PluginList.
Basic Plugin Types
All these plugins derive from the Wiki Plugin class extending the run method, which returns a object tree of HTML objects, and may react on any provided arguments from the WikiPage (see the args below) or optionally overridden by arguments from the url (GET or POST args), if defined via '||='.
A basic plugin just needs the run() method, and optionally getName, getDescription, getVersion, getDefaultArguments. See the Hello World Plugin for a short introduction.
plugin reacts on its arguments and the request and displays arbitrary HTML.
plugin-form is used to display a input type=text box for the default argument s.
plugin-list is used as argument to provide a dynamic list of pagenames.
<?plugin PluginName [args...] ?><?plugin-form PluginName [args...] ?><?plugin PluginName args=<!plugin-list pluginname [args] !> ?>
The box Method
Themes based on the "sidebar" theme may use the box method of any plugin, which displays a title and a condensed content in a box.
WikiPluginCached
Plugins deriving from the class WikiPluginCached must also define the methods getPluginType(), optionally getExpire(), managesValidators(), and dependent of the getPluginType the methods to display the possibly cached result.
getImage(), getMap() or getHtml(),
optionally also
getAlt(), getImageType(), embedMap(), embedImg(), embedObject()
See the config.ini PLUGIN_CACHED_* settings and
PhpWiki:WikiPluginCached
Action Pages
The term ActionPage refers to a page containing a plugin invocation.
An action is together with the pagename argument the a basic Php Wiki argument.
It can both be GET or POST actions. Actions are untranslated, always english.
Basic (and old) actions are all lowercase, like edit, browse, remove, ...
Newer actions in
PhpWiki:CamelCase are invoked via plugins on their specific action page.
We decoupled actions from plugins via action pages for the following reasons:
- support translated action buttons and customizable action descriptions.
- customize standard actions by tuning the plugin invocation arguments. override or add plugin defaults.
- split simple plugins into multiple actions, like Recent Changes/Recent Edits, Most Popular/Least Popular, All Pages/All Pages Created By Me/All Pages Last Edited By Me/All Pages Owned By Me which differ only in one argument.
- Those actions which have buttons or links in the theme or are referenced in the standard pgsrc pageset require their (possibly localized) actionpages, otherwise the actions will not work.
- If the localized actionpage is not found the english version is used.
- If no actionpage is found, it is recommended to do action=upgrade, which imports all missing and required action pages into the database.
So for a hypothetical new MyActionPage plugin MyActionPage will invoke the plugin and MyActionPagePlugin is the the description.
Existing Plugins
See Plugin Manager for a detailed list. Most plugins should have their own description page with the name Plugin appended.
- All Users
- Analyse Access Log Sql Plugin
- Append Text Plugin
- Author History Plugin
- Calendar List Plugin
- Calendar Plugin
- Comment Plugin
- Edit Meta Data Plugin
- External Search Plugin
- Foaf Viewer Plugin
- Frame Include Plugin
- Hello World Plugin
- Include Page Plugin
- Inter Wiki Search
- List Pages Plugin
- Moderated Page
- Old Style Table Plugin
- Photo Album Plugin
- Php Highlight Plugin
- Php Weather Plugin
- Ploticus Plugin
- Plugin Manager
- Raw Html Plugin
- Rich Table Plugin
- Search Highlight Plugin
- Syntax Highlighter Plugin
- System Info Plugin
- Te X2 png Plugin
- Text Formatting Rules
- Unfold Subpages Plugin
- Up Load Plugin
- Wiki Blog Plugin
- Add Comment Plugin
- Create Page Plugin
- Create Toc Plugin
- Rss Feed Plugin
- Help / _Auth Info Plugin
- Help / _Backend Info Plugin
- Help / _Group Info Plugin
- Help / _Preferences Info Plugin
- Help / _Wiki Translation Plugin
- Help / Add Comment Plugin
- Help / All Pages Plugin
- Help / All Users Plugin
- Help / Analyse Access Log Sql Plugin
- Help / Append Text Plugin
- Help / Ascii Math Plugin
- Help / Ascii SVGPlugin
- Help / Author History Plugin
- Help / Back Links Plugin
- Help / Blog Archives Plugin
- Help / Blog Journal Plugin
- Help / Box Right Plugin
- Help / Cache Test Plugin
- Help / Calendar List Plugin
- Help / Calendar Plugin
- Help / Category Page Plugin
- Help / Comment Plugin
- Help / Create Bib Plugin
- Help / Create Page Plugin
- Help / Create Toc Plugin
- Help / Dead End Pages Plugin
- Help / Diff Plugin
- Help / Edit Meta Data Plugin
- Help / External Search Plugin
- Help / File Info Plugin
- Help / Foaf Viewer Plugin
- Help / Frame Include Plugin
- Help / Full Text Search Plugin
- Help / Fuzzy Pages Plugin
- Help / Google Maps Plugin
- Help / Google Plugin Plugin
- Help / Go To Plugin
- Help / Hello World Plugin
- Help / Html Converter Plugin
- Help / Include Page Plugin
- Help / Include Pages Plugin
- Help / Include Site Map Plugin
- Help / Inter Wiki Search Plugin
- Help / Jabber Presence Plugin
- Help / Ldap Search Plugin
- Help / Like Pages Plugin
- Help / Link Database Plugin
- Help / List Pages Plugin
- Help / List Subpages Plugin
- Help / Moderated Page Plugin
- Help / Most Popular Plugin
- Help / No Cache Plugin
- Help / Old Style Table Plugin
- Help / Orphaned Pages Plugin
- Help / Page Dump Plugin
- Help / Page Group Plugin
- Help / Page History Plugin
- Help / Page Info Plugin
- Help / Page Trail Plugin
- Help / Password Reset Plugin
- Help / Photo Album Plugin
- Help / Php Highlight Plugin
- Help / Php Weather Plugin
- Help / Ploticus Plugin
- Help / Plugin Manager Plugin
- Help / Popular Nearby Plugin
- Help / Pop Up Plugin
- Help / Preference App Plugin
- Help / Prev Next Plugin
- Help / Random Page Plugin
- Help / Rate It Plugin
- Help / Raw Html Plugin
- Help / Recent Changes Cached Plugin
- Help / Recent Changes Plugin
- Help / Recent Comments Plugin
- Help / Recent Edits Plugin
- Help / Recent Referrers Plugin
- Help / Related Changes Plugin
- Help / Rich Table Plugin
- Help / Rss Feed Plugin
- Help / Search Highlight Plugin
- Help / Semantic Relations Plugin
- Help / Semantic Search Plugin
- Help / Site Map Plugin
- Help / Sql Result Plugin
- Help / Sync Wiki Plugin
- Help / Syntax Highlighter Plugin
- Help / System Info Plugin
- Help / Template Plugin
- Help / Te X2 png Plugin
- Help / text 2 png Plugin
- Help / Text Formatting Rules
- Help / Tex To Png Plugin
- Help / Title Search Plugin
- Help / Translate Text Plugin
- Help / Unfold Subpages Plugin
- Help / Up Load Plugin
- Help / User Preferences Plugin
- Help / User Ratings Plugin
- Help / Visual Wiki Plugin
- Help / Wanted Pages Plugin
- Help / Watch Page Plugin
- Help / Who Is Online Plugin
- Help / Wiki Admin Chmod Plugin
- Help / Wiki Admin Chown Plugin
- Help / Wiki Admin Markup Plugin
- Help / Wiki Admin Remove Plugin
- Help / Wiki Admin Rename Plugin
- Help / Wiki Admin Search Replace Plugin
- Help / Wiki Admin Select Plugin
- Help / Wiki Admin Set Acl Plugin
- Help / Wiki Admin Utils Plugin
- Help / Wiki Form Plugin
- Help / Wiki Form Rich Plugin
- Help / Wiki Forum Plugin
- Help / Wiki Plugin
- Help / Wiki Poll Plugin
- Help / You Tube Plugin
- Template / New Plugin
- Release Notes
- Help / Wiki Blog Plugin
Contributed Plugins
See
PhpWiki:CategoryContributedPlugin.
Those pages link to Category Contributed Plugin?: