<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="home" title="HomePage" href="HomePage.html" />
<link rel="help" title="HowToUseWiki" href="HowToUseWiki.html" />
<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1" />
<link rel="author" title="The PhpWiki Programming Team" href="http://phpwiki.org/ThePhpWikiProgrammingTeam" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="en" />
<meta name="robots" content="noindex,nofollow" />
<meta name="language" content="en" />
<meta name="document-type" content="Public" />
<meta name="document-rating" content="General" />
<meta name="generator" content="PhpWiki" />
<meta name="PHPWIKI_VERSION" content="1.3.14" />

<base href="../" />
<link rel="stylesheet" type="text/css" charset="iso-8859-1" href="phpwiki-printer.css" />
<title>PhpWiki - Help  /  Wiki Plugin</title>
</head>
<body>

<div id="header">
  
<!-- Page title -->
<h1>Help  /  Wiki Plugin</h1>
</div>
<div id="content">



<div class="wikitext"><p class="tightenable top">Since <a href="PhpWiki.html" class="wiki">PhpWiki</a>-1.3.3 support for WikiPlugins is included.</p>
<p class="tightenable">A plugin is some PHP code that</p>
<ul><li class="tightenable bottom">lives in <tt>phpwiki/lib/plugin/&lt;pluginname&gt;.php</tt></li>
<li class="tightenable top">implements the WikiPlugin interface by extending that class.</li>
</ul>
<p class="tightenable">There are many plugins already distributed with <a href="PhpWiki.html" class="wiki">PhpWiki</a>. Simply look
in the <tt>lib/plugin</tt> directory or see the <a href="PluginManager.html" class="wiki">PluginManager</a> list or see all the
<a href="TitleSearch.html?s=Help%2F%2APlugin" class="wikiaction">Help/*Plugin pages</a>.</p>
<p class="tightenable">To write your own, look at the <a href="Help/HelloWorldPlugin" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />Help:</span><span class="wikipage">HelloWorldPlugin</span></a> (HelloWorld.php
in that directory), which is a minimal example of a plugin.
Publish your self-written plugin at a new <a href="PhpWiki.html" class="wiki">PhpWiki</a> page with
PluginName + <b>Plugin</b> appended
and add a link to <a href="http://phpwiki.sourceforge.net/phpwiki/CategoryContributedPlugin" class="named-interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />CategoryContributedPlugin</span></a>.</p>
<p class="tightenable">A <a href="Help/WikiPlugin" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />Help:</span><span class="wikipage">WikiPlugin</span></a> allows one to easily add new types of dynamic
content (as well as other functionality) to wiki pages within <a href="PhpWiki.html" class="wiki">PhpWiki</a>.
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, ...)</p>
<p class="tightenable">Note that you can NOT extend the markup syntax with a plugin, as in other wiki engines.</p>
<p class="tightenable">(The old-style  <a href="Help/MagicPhpWikiURLs" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />Help:</span><span class="wikipage">MagicPhpWikiURLs</span></a> have been replaced by plugins
entirely.)</p>
<h2>Example</h2>
<p class="tightenable">Currently, one invokes a plugin by putting something like:</p>
<pre class="tightenable">
&lt;?plugin AllPages limit=20 cols=3 ?&gt;</pre>
<p class="tightenable">into a regular wiki-page.  That particular example produces a list
of the first 20 existing pages in 3 columns, via the <a href="http://phpwiki.sourceforge.net/phpwiki/PageList" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />PhpWiki:</span><span class="wikipage">PageList</span></a>
library.</p>
<div class="plugin tightenable" id="AllPagesPlugin6"><p>All pages in this wiki (1366 total):</p>
<table>
<colgroup span="3" width="33%"></colgroup>
<tr valign="top">
<td><table>
<tr><td width="100%" colspan="1"><table width="100%"><tr class="wikipaging">
  <td class="wikipaging-disabled" align="left"">
      |&lt;&lt;      &nbsp;
      &lt;&lt;  </td>
  <td class="wikipaging-enabled" align="center">
       - 1 / 69 -   </td>
  <td class="wikipaging-enabled" align="right">
      <a href="Help/WikiPlugin.html?action=dumphtml&amp;directory=%2Ftmp%2Fwikidumphtml&amp;limit=20%2C20&amp;count=1366">&gt;&gt;</a> 
      &nbsp;
      <a href="Help/WikiPlugin.html?action=dumphtml&amp;directory=%2Ftmp%2Fwikidumphtml&amp;limit=1346%2C20&amp;count=1366">&gt;&gt;|</a>  </td>
</tr></table></td></tr>
</table>
<ul class="pagelist">
<li class="evenrow"><a href="%22Hidden%20settings%22%20in%20e-smith-cups.html" class="wiki">&quot;Hidden settings&quot; in e-smith-cups</a></li>
<li class="evenrow"><a href="%22Hidden%20settings%22%20in%20e-smith-cups%20Feedback.html" class="wiki">&quot;Hidden settings&quot; in e-smith-cups Feedback</a></li>
<li class="evenrow"><a href="3rdPartyYumRepositories.html" class="wiki">3rdPartyYumRepositories</a></li>
<li class="oddrow"><a href="3ware%206400.html" class="wiki">3ware 6400</a></li>
<li class="oddrow"><a href="3ware%206400%20Feedback.html" class="wiki">3ware 6400 Feedback</a></li>
<li class="oddrow"><a href="APC%20Smart%20UPS.html" class="wiki">APC Smart UPS</a></li>
<li class="evenrow"><a href="ASSP%20Anti-SPAM%20HOWTO.html" class="wiki">ASSP Anti-SPAM HOWTO</a></li>
</ul>
<table>
<tr><td width="100%" colspan="1"><table width="100%"><tr class="wikipaging">
  <td class="wikipaging-disabled" align="left"">
      |&lt;&lt;      &nbsp;
      &lt;&lt;  </td>
  <td class="wikipaging-enabled" align="center">
       - 1 / 69 -   </td>
  <td class="wikipaging-enabled" align="right">
      <a href="Help/WikiPlugin.html?action=dumphtml&amp;directory=%2Ftmp%2Fwikidumphtml&amp;limit=20%2C20&amp;count=1366">&gt;&gt;</a> 
      &nbsp;
      <a href="Help/WikiPlugin.html?action=dumphtml&amp;directory=%2Ftmp%2Fwikidumphtml&amp;limit=1346%2C20&amp;count=1366">&gt;&gt;|</a>  </td>
</tr></table></td></tr>
</table>
</td>
<td><table>
<tr><td width="100%" colspan="1"><table width="100%"><tr class="wikipaging">
  <td class="wikipaging-disabled" align="left"">
      |&lt;&lt;      &nbsp;
      &lt;&lt;  </td>
  <td class="wikipaging-enabled" align="center">
       - 1 / 69 -   </td>
  <td class="wikipaging-enabled" align="right">
      <a href="Help/WikiPlugin.html?action=dumphtml&amp;directory=%2Ftmp%2Fwikidumphtml&amp;limit=20%2C20&amp;count=1366">&gt;&gt;</a> 
      &nbsp;
      <a href="Help/WikiPlugin.html?action=dumphtml&amp;directory=%2Ftmp%2Fwikidumphtml&amp;limit=1346%2C20&amp;count=1366">&gt;&gt;|</a>  </td>
</tr></table></td></tr>
</table>
<ul class="pagelist">
<li class="evenrow"><a href="ASSP%20Anti-SPAM%20HOWTO%20Feedback.html" class="wiki">ASSP Anti-SPAM HOWTO Feedback</a></li>
<li class="evenrow"><a href="AWOL.html" class="wiki">AWOL</a></li>
<li class="evenrow"><a href="AWstats%20sur%20SME.html" class="wiki">AWstats sur SME</a></li>
<li class="oddrow"><a href="AWstats%20sur%20SME%20Feedback.html" class="wiki">AWstats sur SME Feedback</a></li>
<li class="oddrow"><a href="Abonnements%20Listes.html" class="wiki">Abonnements Listes</a></li>
<li class="oddrow"><a href="Acc%E8s%20au%20manager%20refus%E9.html" class="wiki">Accès au manager refusé</a></li>
<li class="evenrow"><a href="Adaptec%20RAID%20Controller.html" class="wiki">Adaptec RAID Controller</a></li>
</ul>
<table>
<tr><td width="100%" colspan="1"><table width="100%"><tr class="wikipaging">
  <td class="wikipaging-disabled" align="left"">
      |&lt;&lt;      &nbsp;
      &lt;&lt;  </td>
  <td class="wikipaging-enabled" align="center">
       - 1 / 69 -   </td>
  <td class="wikipaging-enabled" align="right">
      <a href="Help/WikiPlugin.html?action=dumphtml&amp;directory=%2Ftmp%2Fwikidumphtml&amp;limit=20%2C20&amp;count=1366">&gt;&gt;</a> 
      &nbsp;
      <a href="Help/WikiPlugin.html?action=dumphtml&amp;directory=%2Ftmp%2Fwikidumphtml&amp;limit=1346%2C20&amp;count=1366">&gt;&gt;|</a>  </td>
</tr></table></td></tr>
</table>
</td>
<td><table>
<tr><td width="100%" colspan="1"><table width="100%"><tr class="wikipaging">
  <td class="wikipaging-disabled" align="left"">
      |&lt;&lt;      &nbsp;
      &lt;&lt;  </td>
  <td class="wikipaging-enabled" align="center">
       - 1 / 69 -   </td>
  <td class="wikipaging-enabled" align="right">
      <a href="Help/WikiPlugin.html?action=dumphtml&amp;directory=%2Ftmp%2Fwikidumphtml&amp;limit=20%2C20&amp;count=1366">&gt;&gt;</a> 
      &nbsp;
      <a href="Help/WikiPlugin.html?action=dumphtml&amp;directory=%2Ftmp%2Fwikidumphtml&amp;limit=1346%2C20&amp;count=1366">&gt;&gt;|</a>  </td>
</tr></table></td></tr>
</table>
<ul class="pagelist">
<li class="evenrow"><a href="Adaptec%20RAID%20Controller%20Feedback.html" class="wiki">Adaptec RAID Controller Feedback</a></li>
<li class="evenrow"><a href="Adding%20a%20search%20engine%20to%20Apache%20on%20e-smith%204.0.html" class="wiki">Adding a search engine to Apache on e-smith 4.0</a></li>
<li class="evenrow"><a href="Adding%20a%20search%20engine%20to%20Apache%20on%20e-smith%204.0%20Feedback.html" class="wiki">Adding a search engine to Apache on e-smith 4.0 Feedback</a></li>
<li class="oddrow"><a href="AddingPages.html" class="wiki">AddingPages</a></li>
<li class="oddrow"><a href="Additional%20IP%20How%20To.html" class="wiki">Additional IP How To</a></li>
<li class="oddrow"><a href="Additional%20IP%20How%20To%20Feedback.html" class="wiki">Additional IP How To Feedback</a></li>
<li class="evenrow"><a href="Address%20Book.html" class="wiki">Address Book</a></li>
</ul>
<table>
<tr><td width="100%" colspan="1"><table width="100%"><tr class="wikipaging">
  <td class="wikipaging-disabled" align="left"">
      |&lt;&lt;      &nbsp;
      &lt;&lt;  </td>
  <td class="wikipaging-enabled" align="center">
       - 1 / 69 -   </td>
  <td class="wikipaging-enabled" align="right">
      <a href="Help/WikiPlugin.html?action=dumphtml&amp;directory=%2Ftmp%2Fwikidumphtml&amp;limit=20%2C20&amp;count=1366">&gt;&gt;</a> 
      &nbsp;
      <a href="Help/WikiPlugin.html?action=dumphtml&amp;directory=%2Ftmp%2Fwikidumphtml&amp;limit=1346%2C20&amp;count=1366">&gt;&gt;|</a>  </td>
</tr></table></td></tr>
</table>
</td>
</tr>
</table>
</div>
<h2>Details</h2>
<p class="tightenable">Plugins can take certain named arguments, most do.  The values of
these arguments can be determined four different ways.  In order of
precedence:</p>
<ol><li class="tightenable"><p class="tightenable top bottom">The plugin invocation can specify the value for an argument, like so:</p>
<pre class="tightenable top bottom">
&lt;?plugin BackLinks page=OtherPage ?&gt;</pre>
</li>
<li class="tightenable"><p class="tightenable top">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:</p>
<pre class="tightenable bottom">
&lt;?plugin BackLinks page ?&gt;</pre>
</li>
<li class="tightenable"><p class="tightenable top">Default values specified in the plugin invocation:</p>
<pre class="tightenable bottom">
&lt;?plugin BackLinks page||=OtherPage ?&gt;</pre>
</li>
<li class="tightenable"><p class="tightenable top bottom">The plugin must supply default values for each argument it uses.
Such default args may be overriden by URL arguments like so:</p>
<pre class="tightenable top bottom">
  BackLinks?page=ThisPage&amp;sortby=-mtime</pre>
<p class="tightenable top">(The <a href="BackLinks.html" class="wiki">BackLinks</a> plugin uses the current page as the default value for
the <b>page</b> argument.)</p>
<p class="tightenable bottom">Most plugins using the <a href="http://phpwiki.sourceforge.net/phpwiki/PageList" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />PhpWiki:</span><span class="wikipage">PageList</span></a> library inherit their
default arguments from the PageList.</p>
</li>
</ol>
<h3>Standard Arguments</h3>
<p class="tightenable">Most plugins display a list of pages, via the <a href="http://phpwiki.sourceforge.net/phpwiki/PageList" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />PhpWiki:</span><span class="wikipage">PageList</span></a>
library. PageList provides automatic support for those arguments.</p>
<blockquote class="tightenable"><p class="tightenable top">info, exclude, author, owner, creator, sortby, limit, paging, cols, azhead,
comma, commasep, ordered</p>
<p class="tightenable bottom">For details see the <a href="http://phpwiki.sourceforge.net/phpwiki/PageList" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />PhpWiki:</span><span class="wikipage">PageList</span></a> library documentation.</p>
</blockquote>
<p class="tightenable"><b>exclude</b> and <b>pages</b> accept a list of pages. Either as comma-seperated list,
supporting glob-style wildcards, or via the <tt>&lt;!plugin-list pluginname [args] !&gt;</tt>
invocation syntax, where pluginname might be any plugin returning a <a href="http://phpwiki.sourceforge.net/phpwiki/PageList" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />PhpWiki:</span><span class="wikipage">PageList</span></a>.
See <a href="http://phpwiki.sourceforge.net/phpwiki/PluginList" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />PhpWiki:</span><span class="wikipage">PluginList</span></a>.</p>
<p class="tightenable">Since most plugins return a PageList, this PageList is also a common
input parameter for other plugins, actions or formats.</p>
<h3>Basic Plugin Types</h3>
<p class="tightenable">All these plugins derive from the <a href="Help/WikiPlugin" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />Help:</span><span class="wikipage">WikiPlugin</span></a> 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 '||='.</p>
<p class="tightenable">A basic plugin just needs the run() method, and optionally getName,
getDescription, getVersion, getDefaultArguments. See the
<a href="Help/HelloWorldPlugin" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />Help:</span><span class="wikipage">HelloWorldPlugin</span></a> for a short introduction.</p>
<blockquote class="tightenable"><p class="tightenable top"><b>plugin</b> reacts on its arguments and the request and displays
arbitrary HTML.</p>
<p class="tightenable"><b>plugin-form</b> is used to display a input type=text box for the
default argument <b>s</b>.</p>
<p class="tightenable"><b>plugin-list</b> is used as argument to provide a dynamic list of
pagenames.</p>
<pre class="tightenable">
  &lt;?plugin PluginName [args...] ?&gt;</pre>
<pre class="tightenable">
  &lt;?plugin-form PluginName [args...] ?&gt;</pre>
<pre class="tightenable bottom">
  &lt;?plugin PluginName args=&lt;!plugin-list pluginname [args...] !&gt; ?&gt;</pre>
</blockquote>
<h4>The box Method</h4>
<p class="tightenable">Themes based on the &quot;sidebar&quot; theme may use the box method of any
plugin, which displays a <b>title</b>
and a condensed <b>content</b> in a box.</p>
<h4>WikiPluginCached</h4>
<p class="tightenable">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 <b>possibly cached</b> result.</p>
<blockquote class="tightenable"><p class="tightenable top bottom">getImage(), getMap() or getHtml(),</p>
</blockquote>
<p class="tightenable">optionally also</p>
<blockquote class="tightenable"><p class="tightenable top bottom">getAlt(), getImageType(), embedMap(), embedImg(), embedObject()</p>
</blockquote>
<p class="tightenable">See the config.ini PLUGIN_CACHED_* settings and <a href="http://phpwiki.sourceforge.net/phpwiki/WikiPluginCached" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />PhpWiki:</span><span class="wikipage">WikiPluginCached</span></a></p>
<h3>Action Pages</h3>
<p class="tightenable">The term <b><a href="Help/ActionPage" class="named-interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />ActionPage</span></a></b> refers to a page containing a plugin
invocation with the same or translated pluginname as the pagename.
An <b>action</b> is together with the <b>pagename</b> argument the basic
<a href="PhpWiki.html" class="wiki">PhpWiki</a> argument.
It can both be GET or POST actions. Actions are untranslated, always
english, pagenames can be localized.
Basic (and old) actions are all lowercase, like edit, browse, remove, ...
Newer actions in <a href="http://phpwiki.sourceforge.net/phpwiki/CamelCase" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />PhpWiki:</span><span class="wikipage">CamelCase</span></a> are invoked via plugins on their
specific action page.</p>
<p class="tightenable">We decoupled actions from plugins via action pages for the following
reasons:</p>
<ol><li class="tightenable bottom">Support translated action buttons and customizable action descriptions.</li>
<li class="tightenable top bottom">Customize standard actions by tuning the plugin invocation arguments.
Override or add plugin defaults.</li>
<li class="tightenable top bottom">Split simple plugins into multiple actions, like <a href="RecentChanges.html" class="wiki">RecentChanges</a>/<a href="RecentEdits.html" class="wiki">RecentEdits</a>,
<a href="MostPopular.html" class="wiki">MostPopular</a>/<a href="LeastPopular.html" class="wiki">LeastPopular</a>, <a href="AllPages.html" class="wiki">AllPages</a>/<a href="AllPagesCreatedByMe.html" class="wiki">AllPagesCreatedByMe</a>/<a href="AllPagesLastEditedByMe.html" class="wiki">AllPagesLastEditedByMe</a>/
<a href="AllPagesOwnedByMe.html" class="wiki">AllPagesOwnedByMe</a> which differ only in one argument.</li>
<li class="tightenable top">Simplify the syntax for actions on another actions using a <u title="Empty link to: PageList" onmouseover="window.status=&quot;Empty link to: PageList&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">PageList</u>
as result of an actionpage as input parameter for another action or
format.</li>
</ol>
<ul><li class="tightenable bottom">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.</li>
<li class="tightenable top bottom">If the localized actionpage is not found the english version is
used.</li>
<li class="tightenable top">If no actionpage is found, it is recommended to do action=upgrade,
which imports all missing and required action pages into the database.</li>
</ul>
<p class="tightenable">So for a hypothetical new MyActionPage plugin MyActionPage will
invoke the plugin and Help:MyActionPagePlugin should be the description page.</p>
<h2>Existing Plugins</h2>
<p class="tightenable">See <a href="PluginManager.html" class="wiki">PluginManager</a> for a detailed list. Most plugins should have their
own description page as subpage of <b>Help/</b> with the name <b>Plugin</b>
appended.</p>
<div class="plugin tightenable" id="BackLinksPlugin65"><ul class="pagelist">
<li class="evenrow"><a href="Help/ActionPage.html" class="wiki">Help/ActionPage</a></li>
</ul>
</div>
<h2>Contributed Plugins</h2>
<p class="tightenable">See <a href="http://phpwiki.sourceforge.net/phpwiki/CategoryContributedPlugin" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />PhpWiki:</span><span class="wikipage">CategoryContributedPlugin</span></a>.</p>
<div class="plugin tightenable" id="BackLinksPlugin66"><p>One page links to <u title="Empty link to: CategoryContributedPlugin" onmouseover="window.status=&quot;Empty link to: CategoryContributedPlugin&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">CategoryContributedPlugin</u>:</p>
<ul class="pagelist">
<li class="evenrow"><a href="Help/WikiPlugin.html" class="wiki">Help/WikiPlugin</a></li>
</ul>
</div>
<hr />
<p class="tightenable top bottom"><a href="PhpWikiDocumentation.html" class="wiki">PhpWikiDocumentation</a></p>
</div>

<div id="footer">  <hr class="printer" noshade="noshade" />
<p class="editdate">Owner: &quot;admin&quot;  Last edited on August 14, 2007  7:11 am by &quot;The PhpWiki programming team&quot;</p>
</div>

</div>
<!-- Add your Disclaimer here -->
</body>
</html>
