]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - locale/de/pgsrc/Hilfe%2FWikiPlugin
Update pgsrc to 1.4.0RC1
[SourceForge/phpwiki.git] / locale / de / pgsrc / Hilfe%2FWikiPlugin
1 Date: Fri, 10 Sep 2010 13:48:42 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC1)
3 X-Rcs-Id: $Id$
4 Content-Type: application/x-phpwiki;
5   pagename=Hilfe%2FWikiPlugin;
6   flags="";
7   markup=2;
8   charset=utf-8
9 Content-Transfer-Encoding: binary
10 Since PhpWiki-1.3.3 support for ~WikiPlugins is included.
11
12 A plugin is some PHP code that
13
14 * lives in =phpwiki/lib/plugin/<pluginname>.php=
15 * implements the ~WikiPlugin interface by extending that class.
16
17 There are many plugins already distributed with PhpWiki. Simply look in the =lib/plugin=
18 directory or see the PluginManager list.
19
20 To write your own, look at the HelloWorldPlugin (~HelloWorld.php in that directory), 
21 which is a minimal example of a plugin.
22 Publish your self-written plugin at a new PhpWiki page with ~PluginName + *Plugin* appended 
23 and add a link to [CategoryContributedPlugin | PhpWiki:CategoryContributedPlugin].
24
25 A Help:WikiPlugin allows one to easily add new types of dynamic content 
26 (as well as other functionality) to wiki pages within PhpWiki.
27 In this very wiki all actions which are not entirely lowercased
28 are implemented using plugins, and some lowercased convenience actions also. (rename, revert, setacl, diff, ...)
29
30 (The old-style  Help:MagicPhpWikiURLs have been replaced by plugins entirely.)
31
32 == Example
33
34 Currently, one invokes a plugin by putting something like:
35
36 {{{
37 <<AllPages limit=5>>
38 }}}
39
40 into a regular wiki-page.  That particular example produces a list of
41 the first 5 existing pages (via the ~PageList library).
42
43 <<AllPages limit=5 >>
44
45 == Details
46
47 Plugins can take certain named arguments (most do).  The values of
48 these arguments can be determined four different ways.  In order of
49 precedence:
50
51 # The plugin invocation can specify the value for an argument, like so:
52   {{{
53   <<BackLinks page=OtherPage >>
54   }}}
55
56 # The argument can be specified via an HTTP query argument.  This
57   doesn't happen (is not allowed) unless the argument is mentioned in
58   the plugin invocation:
59
60   {{{
61   <<BackLinks page >>
62   }}}
63
64 # Default values specified in the plugin invocation:
65
66   {{{
67   <<BackLinks page||=OtherPage >>
68   }}}
69
70 # The plugin must supply default values for each argument it uses.
71   Such default args may be overriden by URL arguments like so: 
72   {{{
73     BackLinks?page=ThisPage&sortby=-mtime
74   }}}
75   (The BackLinks plugin uses the current page as the default value for
76   the ''page'' argument.)
77
78   Most plugins using the ~PageListLibrary inherit their default arguments 
79   from the PhpWiki:PageListLibrary.
80
81 === Standard Arguments
82
83 Most plugins display a list of pages, via the ~PageListLibrary.
84 ~PageList provides automatic support for those arguments.
85
86   info, exclude, author, owner, creator, sortby, limit, paging, cols, azhead,
87   comma, commasep, ordered
88
89   For details see the PhpWiki:PageListLibrary documentation.
90
91 *exclude* and *pages* accept a list of pages. Either as comma-seperated list,
92 supporting glob-style wildcards, or via the <tt><!plugin-list pluginname ~[args~] !></tt>
93 invocation syntax, where pluginname might be any plugin returning a pagelist.
94 See PhpWiki:PluginList.
95
96 === Basic Plugin Types
97
98 All these plugins derive from the Help:WikiPlugin class extending the run method,
99 which returns a object tree of HTML objects, and may react on any
100 provided arguments from the ~WikiPage (see the args below) or
101 optionally overridden by arguments from the url (GET or POST args), 
102 if defined via '||='.
103
104 A basic plugin just needs the run() method, and optionally getName, 
105 getDescription, getDefaultArguments. See the Help:HelloWorldPlugin for a short introduction.
106
107   *plugin* reacts on its arguments and the request and displays arbitrary HTML.
108
109   *plugin-form* is used to display a input type=text box for the default argument *s*.
110
111   *plugin-list* is used as argument to provide a dynamic list of pagenames.
112
113   {{{
114     <<PluginName  Help:s ...] >>
115   }}}
116
117   {{{
118     <?plugin-form PluginName  Help:s ...] ?>
119   }}}
120
121   {{{
122     <<PluginName args=<!plugin-list pluginname  Help:s ] !> >>
123   }}}
124
125 ==== The box Method
126
127 Themes based on the "sidebar" theme may use the box method of any plugin, which displays a *title* 
128 and a condensed *content* in a box.
129
130 ==== ~WikiPluginCached
131
132 Plugins deriving from the class ~WikiPluginCached must also define the methods getPluginType(), 
133 optionally getExpire(), managesValidators(), and dependent of the getPluginType the methods 
134 to display the *possibly cached* result.
135
136   getImage(), getMap() or getHtml(), 
137
138 optionally also
139
140   getAlt(), getImageType(), embedMap(), embedImg(), embedObject()
141
142 See the config.ini PLUGIN_CACHED_* settings and PhpWiki:WikiPluginCached
143
144 === Aktions Seiten
145
146 The term *~ActionPage* refers to a page containing a plugin invocation.
147 An *action* is together with the *pagename* argument the a basic PhpWiki argument. 
148 It can both be GET or POST actions. Actions are untranslated, always english. 
149 Basic (and old) actions are all lowercase, like edit, browse, remove, ...
150 Newer actions in PhpWiki:CamelCase are invoked via plugins on their specific action page.
151
152 We decoupled actions from plugins via action pages for the following reasons:
153
154 # support translated action buttons and customizable action descriptions. 
155 # customize standard actions by tuning the plugin invocation arguments. override or add plugin defaults.
156 # split simple plugins into multiple actions, like RecentChanges/RecentEdits, MostPopular/LeastPopular, 
157   AllPages/AllPagesCreatedByMe/AllPagesLastEditedByMe/AllPagesOwnedByMe which differ only in one argument.
158
159 * Those actions which have buttons or links in the theme or are referenced in the standard pgsrc 
160   pageset require their (possibly localized) actionpages, otherwise the actions will not work.
161 * If the localized actionpage is not found the english version is used.
162 * If no actionpage is found, it is recommended to do action=upgrade, which imports all missing 
163   and required action pages into the database.
164
165 So for a hypothetical new ~MyActionPage plugin ~MyActionPage will invoke the plugin and 
166 ~MyActionPagePlugin is the the description.
167
168 == Existing Plugins
169
170 See PluginManager for a detailed list. Most plugins should have their own description page with the name 
171 *Plugin* appended.
172
173 <<BackLinks noheader=1 >>
174
175 == Contributed Plugins 
176
177 See PhpWiki:CategoryContributedPlugin.
178
179 <<Backlinks page=CategoryContributedPlugin >>
180
181 -----
182 [[PhpWikiDokumentation]]