aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/Plugin-System.html
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-10-12 13:58:35 +0200
committerArthurHoaro <arthur@hoa.ro>2016-10-12 13:58:35 +0200
commitbc22c9a0acb095970e9494cbe8954f0612e05dc0 (patch)
tree4e3a94b7469f5b2e3eaf946756235730429bf9d4 /doc/Plugin-System.html
parent890afc32f744859d11b97eb26ed5c030af9b4145 (diff)
parentebd67c6e1b40aebdd3a52285ce9ff9412b2a3038 (diff)
downloadShaarli-bc22c9a0acb095970e9494cbe8954f0612e05dc0.tar.gz
Shaarli-bc22c9a0acb095970e9494cbe8954f0612e05dc0.tar.zst
Shaarli-bc22c9a0acb095970e9494cbe8954f0612e05dc0.zip
Merge tag 'v0.7.0' of github.com:shaarli/Shaarli into stable
Release v0.7.0
Diffstat (limited to 'doc/Plugin-System.html')
-rw-r--r--doc/Plugin-System.html222
1 files changed, 132 insertions, 90 deletions
diff --git a/doc/Plugin-System.html b/doc/Plugin-System.html
index cb1cb746..37b26152 100644
--- a/doc/Plugin-System.html
+++ b/doc/Plugin-System.html
@@ -4,31 +4,49 @@
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <meta name="generator" content="pandoc"> 5 <meta name="generator" content="pandoc">
6 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> 6 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
7 <title>Shaarli - Plugin System</title> 7 <title>Shaarli Plugin System</title>
8 <style type="text/css">code{white-space: pre;}</style> 8 <style type="text/css">code{white-space: pre;}</style>
9 <!--[if lt IE 9]>
10 <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
11 <![endif]-->
12 <style type="text/css"> 9 <style type="text/css">
10div.sourceCode { overflow-x: auto; }
13table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { 11table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
14 margin: 0; padding: 0; vertical-align: baseline; border: none; } 12 margin: 0; padding: 0; vertical-align: baseline; border: none; }
15table.sourceCode { width: 100%; line-height: 100%; } 13table.sourceCode { width: 100%; line-height: 100%; }
16td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; } 14td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
17td.sourceCode { padding-left: 5px; } 15td.sourceCode { padding-left: 5px; }
18code > span.kw { color: #007020; font-weight: bold; } 16code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
19code > span.dt { color: #902000; } 17code > span.dt { color: #902000; } /* DataType */
20code > span.dv { color: #40a070; } 18code > span.dv { color: #40a070; } /* DecVal */
21code > span.bn { color: #40a070; } 19code > span.bn { color: #40a070; } /* BaseN */
22code > span.fl { color: #40a070; } 20code > span.fl { color: #40a070; } /* Float */
23code > span.ch { color: #4070a0; } 21code > span.ch { color: #4070a0; } /* Char */
24code > span.st { color: #4070a0; } 22code > span.st { color: #4070a0; } /* String */
25code > span.co { color: #60a0b0; font-style: italic; } 23code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
26code > span.ot { color: #007020; } 24code > span.ot { color: #007020; } /* Other */
27code > span.al { color: #ff0000; font-weight: bold; } 25code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
28code > span.fu { color: #06287e; } 26code > span.fu { color: #06287e; } /* Function */
29code > span.er { color: #ff0000; font-weight: bold; } 27code > span.er { color: #ff0000; font-weight: bold; } /* Error */
28code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
29code > span.cn { color: #880000; } /* Constant */
30code > span.sc { color: #4070a0; } /* SpecialChar */
31code > span.vs { color: #4070a0; } /* VerbatimString */
32code > span.ss { color: #bb6688; } /* SpecialString */
33code > span.im { } /* Import */
34code > span.va { color: #19177c; } /* Variable */
35code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
36code > span.op { color: #666666; } /* Operator */
37code > span.bu { } /* BuiltIn */
38code > span.ex { } /* Extension */
39code > span.pp { color: #bc7a00; } /* Preprocessor */
40code > span.at { color: #7d9029; } /* Attribute */
41code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
42code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
43code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
44code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
30 </style> 45 </style>
31 <link rel="stylesheet" href="github-markdown.css"> 46 <link rel="stylesheet" href="github-markdown.css">
47 <!--[if lt IE 9]>
48 <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
49 <![endif]-->
32</head> 50</head>
33<body> 51<body>
34<div id="local-sidebar"> 52<div id="local-sidebar">
@@ -39,18 +57,25 @@ code > span.er { color: #ff0000; font-weight: bold; }
39<li><a href="Download.html">Download</a></li> 57<li><a href="Download.html">Download</a></li>
40<li><a href="Server-requirements.html">Server requirements</a></li> 58<li><a href="Server-requirements.html">Server requirements</a></li>
41<li><a href="Server-configuration.html">Server configuration</a></li> 59<li><a href="Server-configuration.html">Server configuration</a></li>
60<li><a href="Server-security.html">Server security</a></li>
61<li><a href="Shaarli-installation.html">Shaarli installation</a></li>
42<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li> 62<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
63<li><a href="Plugins.html">Plugins</a></li>
43</ul></li> 64</ul></li>
65<li><a href="Docker.html">Docker</a></li>
44<li><a href="Usage.html">Usage</a> 66<li><a href="Usage.html">Usage</a>
45<ul> 67<ul>
46<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li> 68<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
69<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
47<li><a href="Firefox-share.html">Firefox share</a></li> 70<li><a href="Firefox-share.html">Firefox share</a></li>
48<li><a href="RSS-feeds.html">RSS feeds</a></li> 71<li><a href="RSS-feeds.html">RSS feeds</a></li>
49</ul></li> 72</ul></li>
50<li>How To 73<li>How To
51<ul> 74<ul>
52<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li> 75<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
76<li><a href="Upgrade-from-original-sebsauvage/Shaarli.html">Upgrade from original sebsauvage/Shaarli</a></li>
53<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li> 77<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
78<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
54<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li> 79<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
55<li><a href="Datastore-hacks.html">Datastore hacks</a></li> 80<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
56</ul></li> 81</ul></li>
@@ -62,6 +87,7 @@ code > span.er { color: #ff0000; font-weight: bold; }
62<li><a href="Directory-structure.html">Directory structure</a></li> 87<li><a href="Directory-structure.html">Directory structure</a></li>
63<li><a href="3rd-party-libraries.html">3rd party libraries</a></li> 88<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
64<li><a href="Plugin-System.html">Plugin System</a></li> 89<li><a href="Plugin-System.html">Plugin System</a></li>
90<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
65<li><a href="Security.html">Security</a></li> 91<li><a href="Security.html">Security</a></li>
66<li><a href="Static-analysis.html">Static analysis</a></li> 92<li><a href="Static-analysis.html">Static analysis</a></li>
67<li><a href="Theming.html">Theming</a></li> 93<li><a href="Theming.html">Theming</a></li>
@@ -77,32 +103,11 @@ code > span.er { color: #ff0000; font-weight: bold; }
77</div> 103</div>
78<h1 id="plugin-system">Plugin System</h1> 104<h1 id="plugin-system">Plugin System</h1>
79<blockquote> 105<blockquote>
80<p>Note: Plugin current status - in developpement (not merged into master).</p> 106<p>Note: Plugin current status - in development (not merged into master).</p>
81</blockquote> 107</blockquote>
82<p><a href="#plugin-user-guide"><strong>I am a user.</strong> Plugin User Guide.</a><a href=".html"></a></p> 108<p><a href="#developer-api"><strong>I am a developer.</strong> Developer API.</a><a href=".html"></a></p>
83<p><a href="#developper-api"><strong>I am a developper.</strong> Developper API.</a><a href=".html"></a></p>
84<p><a href="#guide-for-template-designer"><strong>I am a template designer.</strong> Guide for template designer.</a><a href=".html"></a></p> 109<p><a href="#guide-for-template-designer"><strong>I am a template designer.</strong> Guide for template designer.</a><a href=".html"></a></p>
85<h2 id="plugin-user-guide">Plugin User Guide</h2> 110<h2 id="developer-api">Developer API</h2>
86<h3 id="manage-plugins">Manage plugins</h3>
87<p>In <code>config.php</code>, change $GLOBALS<a href="&#39;ENABLED_PLUGINS&#39;]-array:.html">'config'['ENABLED_PLUGINS'] array:</a></p>
88<pre class="sourceCode php"><code class="sourceCode php"><span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">&#39;config&#39;</span><span class="ot">[</span><span class="st">&#39;ENABLED_PLUGINS&#39;</span><span class="ot">]](</span><span class="st">&#39;ENABLED_PLUGINS&#39;</span><span class="ot">]</span>.html<span class="ot">)</span></code></pre>
89<p>Full list:</p>
90<pre class="sourceCode php"><code class="sourceCode php"><span class="kw">$GLOBALS</span><span class="ot">[</span><span class="st">&#39;config&#39;</span><span class="ot">[</span><span class="st">&#39;ENABLED_PLUGINS&#39;</span><span class="ot">]</span> = <span class="fu">array</span><span class="ot">(](</span><span class="st">&#39;ENABLED_PLUGINS&#39;</span><span class="ot">]</span>-=-<span class="fu">array</span><span class="ot">(</span>.html<span class="ot">)</span>
91 <span class="st">&#39;qrcode&#39;</span><span class="ot">,</span> <span class="st">&#39;archiveorg&#39;</span><span class="ot">,</span> <span class="st">&#39;readityourself&#39;</span><span class="ot">,</span> <span class="st">&#39;playvideos&#39;</span><span class="ot">,</span>
92 <span class="st">&#39;wallabag&#39;</span><span class="ot">,</span> <span class="st">&#39;markdown&#39;</span><span class="ot">,</span> <span class="st">&#39;addlink_toolbar&#39;</span><span class="ot">,</span>
93<span class="ot">);</span></code></pre>
94<h3 id="list-of-plugins">List of plugins</h3>
95<p>Plugin maintained by the community:</p>
96<ul>
97<li>Archive.org - add a clickable icon to every link to archive.org.</li>
98<li>Addlink in toolbar - add a field to paste new links URL in toolbar.</li>
99<li>Markdown - write and display Shaare in Markdown.</li>
100<li>Play videos - popup to play all videos displayed in linklist.</li>
101<li>QRCode - add a clickable icon generating a QRCode for every link.</li>
102<li>ReadItYourself - add a clickable icon for ReadItYourself.</li>
103<li>Wallabag - add a clickable icon for Wallabag.</li>
104</ul>
105<h2 id="developper-api">Developper API</h2>
106<h3 id="what-can-i-do-with-plugins">What can I do with plugins?</h3> 111<h3 id="what-can-i-do-with-plugins">What can I do with plugins?</h3>
107<p>The plugin system let you:</p> 112<p>The plugin system let you:</p>
108<ul> 113<ul>
@@ -134,72 +139,86 @@ code > span.er { color: #ff0000; font-weight: bold; }
134<p>Template placeholders are displayed in template in specific places.</p> 139<p>Template placeholders are displayed in template in specific places.</p>
135<p>RainTPL displays every element contained in the placeholder's array. These element can be added by plugins.</p> 140<p>RainTPL displays every element contained in the placeholder's array. These element can be added by plugins.</p>
136<p>For example, let's add a value in the placeholder <code>top_placeholder</code> which is displayed at the top of my page:</p> 141<p>For example, let's add a value in the placeholder <code>top_placeholder</code> which is displayed at the top of my page:</p>
137<pre class="sourceCode php"><code class="sourceCode php"><span class="kw">$data</span><span class="ot">[</span><span class="st">&#39;top_placeholder&#39;</span><span class="ot">[]</span> = <span class="st">&#39;My content&#39;</span><span class="ot">;](]</span>-=-<span class="st">&#39;My-content&#39;</span><span class="ot">;</span>.html<span class="ot">)</span> 142<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><span class="kw">$data</span><span class="ot">[</span><span class="st">&#39;top_placeholder&#39;</span><span class="ot">[]</span> = <span class="st">&#39;My content&#39;</span><span class="ot">;](]</span>-=-<span class="st">&#39;My-content&#39;</span><span class="ot">;</span>.html<span class="ot">)</span>
138<span class="co"># OR</span> 143<span class="co"># OR</span>
139<span class="fu">array_push</span><span class="ot">(</span><span class="kw">$data</span><span class="ot">[</span><span class="st">&#39;top_placeholder&#39;</span><span class="ot">],</span> <span class="st">&#39;My&#39;</span><span class="ot">,</span> <span class="st">&#39;content&#39;</span><span class="ot">);[](</span>.html<span class="ot">)</span> 144<span class="fu">array_push</span><span class="ot">(</span><span class="kw">$data</span><span class="ot">[</span><span class="st">&#39;top_placeholder&#39;</span><span class="ot">],</span> <span class="st">&#39;My&#39;</span><span class="ot">,</span> <span class="st">&#39;content&#39;</span><span class="ot">);[](</span>.html<span class="ot">)</span>
140 145
141<span class="kw">return</span> <span class="kw">$data</span><span class="ot">;</span></code></pre> 146<span class="kw">return</span> <span class="kw">$data</span><span class="ot">;</span></code></pre></div>
142<h4 id="data-manipulation">Data manipulation</h4> 147<h4 id="data-manipulation">Data manipulation</h4>
143<p>When a page is displayed, every variable send to the template engine is passed to plugins before that in <code>$data</code>.</p> 148<p>When a page is displayed, every variable send to the template engine is passed to plugins before that in <code>$data</code>.</p>
144<p>The data contained by this array can be altered before template rendering.</p> 149<p>The data contained by this array can be altered before template rendering.</p>
145<p>For exemple, in linklist, it is possible to alter every title:</p> 150<p>For exemple, in linklist, it is possible to alter every title:</p>
146<pre class="sourceCode php"><code class="sourceCode php"><span class="co">// mind the reference if you want $data to be altered</span> 151<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><span class="co">// mind the reference if you want $data to be altered</span>
147<span class="kw">foreach</span> <span class="ot">(</span><span class="kw">$data</span><span class="ot">[</span><span class="st">&#39;links&#39;</span><span class="ot">]</span> <span class="kw">as</span> &amp;<span class="kw">$value</span><span class="ot">)</span> {<span class="ot">[](</span>.html<span class="ot">)</span> 152<span class="kw">foreach</span> <span class="ot">(</span><span class="kw">$data</span><span class="ot">[</span><span class="st">&#39;links&#39;</span><span class="ot">]</span> <span class="kw">as</span> &amp;<span class="kw">$value</span><span class="ot">)</span> {<span class="ot">[](</span>.html<span class="ot">)</span>
148 <span class="co">// String reverse every title.</span> 153 <span class="co">// String reverse every title.</span>
149 <span class="kw">$value</span><span class="ot">[</span><span class="st">&#39;title&#39;</span><span class="ot">]</span> = <span class="fu">strrev</span><span class="ot">(</span><span class="kw">$value</span><span class="ot">[</span><span class="st">&#39;title&#39;</span><span class="ot">]);[](</span>.html<span class="ot">)</span> 154 <span class="kw">$value</span><span class="ot">[</span><span class="st">&#39;title&#39;</span><span class="ot">]</span> = <span class="fu">strrev</span><span class="ot">(</span><span class="kw">$value</span><span class="ot">[</span><span class="st">&#39;title&#39;</span><span class="ot">]);[](</span>.html<span class="ot">)</span>
150} 155}
151 156
152<span class="kw">return</span> <span class="kw">$data</span><span class="ot">;</span></code></pre> 157<span class="kw">return</span> <span class="kw">$data</span><span class="ot">;</span></code></pre></div>
158<h3 id="metadata">Metadata</h3>
159<p>Every plugin needs a <code>&lt;plugin_name&gt;.meta</code> file, which is in fact an <code>.ini</code> file (<code>KEY=&quot;VALUE&quot;</code>), to be listed in plugin administration.</p>
160<p>Each file contain two keys:</p>
161<ul>
162<li><code>description</code>: plugin description</li>
163<li><code>parameters</code>: user parameter names, separated by a <code>;</code>.</li>
164</ul>
165<blockquote>
166<p>Note: In PHP, <code>parse_ini_file()</code> seems to want strings to be between by quotes <code>&quot;</code> in the ini file.</p>
167</blockquote>
153<h3 id="its-not-working">It's not working!</h3> 168<h3 id="its-not-working">It's not working!</h3>
154<p>Use <code>demo_plugin</code> as a functional example. It covers most of the plugin system features.</p> 169<p>Use <code>demo_plugin</code> as a functional example. It covers most of the plugin system features.</p>
155<p>If it's still not working, please <a href="https://github.com/shaarli/Shaarli/issues/new">open an issue</a>.<a href=".html"></a></p> 170<p>If it's still not working, please <a href="https://github.com/shaarli/Shaarli/issues/new">open an issue</a>.<a href=".html"></a></p>
156<h3 id="hooks">Hooks</h3> 171<h3 id="hooks">Hooks</h3>
157<table> 172<table style="width:42%;">
173<colgroup>
174<col style="width: 19%" />
175<col style="width: 22%" />
176</colgroup>
158<thead> 177<thead>
159<tr class="header"> 178<tr class="header">
160<th style="text-align: left;">Hooks</th> 179<th>Hooks</th>
161<th style="text-align: center;">Description</th> 180<th style="text-align: center;">Description</th>
162</tr> 181</tr>
163</thead> 182</thead>
164<tbody> 183<tbody>
165<tr class="odd"> 184<tr class="odd">
166<td style="text-align: left;"><a href="#render_header">render_header</a></td> 185<td><a href="#render_header">render_header</a></td>
167<td style="text-align: center;">Allow plugin to add content in page headers.</td> 186<td style="text-align: center;">Allow plugin to add content in page headers.</td>
168</tr> 187</tr>
169<tr class="even"> 188<tr class="even">
170<td style="text-align: left;"><a href="#render_includes">render_includes</a></td> 189<td><a href="#render_includes">render_includes</a></td>
171<td style="text-align: center;">Allow plugin to include their own CSS files.</td> 190<td style="text-align: center;">Allow plugin to include their own CSS files.</td>
172</tr> 191</tr>
173<tr class="odd"> 192<tr class="odd">
174<td style="text-align: left;"><a href="#render_footer">render_footer</a></td> 193<td><a href="#render_footer">render_footer</a></td>
175<td style="text-align: center;">Allow plugin to add content in page footer and include their own JS files.</td> 194<td style="text-align: center;">Allow plugin to add content in page footer and include their own JS files.</td>
176</tr> 195</tr>
177<tr class="even"> 196<tr class="even">
178<td style="text-align: left;"><a href="#render_linklist">render_linklist</a></td> 197<td><a href="#render_linklist">render_linklist</a></td>
179<td style="text-align: center;">It allows to add content at the begining and end of the page, after every link displayed and to alter link data.</td> 198<td style="text-align: center;">It allows to add content at the begining and end of the page, after every link displayed and to alter link data.</td>
180</tr> 199</tr>
181<tr class="odd"> 200<tr class="odd">
182<td style="text-align: left;"><a href="#render_editlink">render_editlink</a></td> 201<td><a href="#render_editlink">render_editlink</a></td>
183<td style="text-align: center;">Allow to add fields in the form, or display elements.</td> 202<td style="text-align: center;">Allow to add fields in the form, or display elements.</td>
184</tr> 203</tr>
185<tr class="even"> 204<tr class="even">
186<td style="text-align: left;"><a href="#render_tools">render_tools</a></td> 205<td><a href="#render_tools">render_tools</a></td>
187<td style="text-align: center;">Allow to add content at the end of the page.</td> 206<td style="text-align: center;">Allow to add content at the end of the page.</td>
188</tr> 207</tr>
189<tr class="odd"> 208<tr class="odd">
190<td style="text-align: left;"><a href="#render_picwall">render_picwall</a></td> 209<td><a href="#render_picwall">render_picwall</a></td>
191<td style="text-align: center;">Allow to add content at the top and bottom of the page.</td> 210<td style="text-align: center;">Allow to add content at the top and bottom of the page.</td>
192</tr> 211</tr>
193<tr class="even"> 212<tr class="even">
194<td style="text-align: left;"><a href="#render_tagcloud">render_tagcloud</a></td> 213<td><a href="#render_tagcloud">render_tagcloud</a></td>
195<td style="text-align: center;">Allow to add content at the top and bottom of the page.</td> 214<td style="text-align: center;">Allow to add content at the top and bottom of the page.</td>
196</tr> 215</tr>
197<tr class="odd"> 216<tr class="odd">
198<td style="text-align: left;"><a href="#render_daily">render_daily</a></td> 217<td><a href="#render_daily">render_daily</a></td>
199<td style="text-align: center;">Allow to add content at the top and bottom of the page, the bottom of each link and to alter data.</td> 218<td style="text-align: center;">Allow to add content at the top and bottom of the page, the bottom of each link and to alter data.</td>
200</tr> 219</tr>
201<tr class="even"> 220<tr class="even">
202<td style="text-align: left;"><a href="#savelink">savelink</a></td> 221<td><a href="#savelink">savelink</a></td>
203<td style="text-align: center;">Allow to alter the link being saved in the datastore.</td> 222<td style="text-align: center;">Allow to alter the link being saved in the datastore.</td>
204</tr> 223</tr>
205</tbody> 224</tbody>
@@ -259,6 +278,7 @@ code > span.er { color: #ff0000; font-weight: bold; }
259<p>List of placeholders:</p> 278<p>List of placeholders:</p>
260<ul> 279<ul>
261<li><code>text</code>: called after the end of the footer text.</li> 280<li><code>text</code>: called after the end of the footer text.</li>
281<li><code>endofpage</code>: called at the end of the page.</li>
262</ul> 282</ul>
263<p><img src="http://i.imgur.com/L5S2YEH.png" alt="text_example" /><a href=".html"></a></p> 283<p><img src="http://i.imgur.com/L5S2YEH.png" alt="text_example" /><a href=".html"></a></p>
264<ul> 284<ul>
@@ -393,6 +413,20 @@ code > span.er { color: #ff0000; font-weight: bold; }
393<li>tags</li> 413<li>tags</li>
394</ul> 414</ul>
395<h2 id="guide-for-template-designer">Guide for template designer</h2> 415<h2 id="guide-for-template-designer">Guide for template designer</h2>
416<h3 id="plugin-administration">Plugin administration</h3>
417<p>Your theme must include a plugin administration page: <code>pluginsadmin.html</code>.</p>
418<blockquote>
419<p>Note: repo's template link needs to be added when the PR is merged.</p>
420</blockquote>
421<p>Use the default one as an example.</p>
422<p>Aside from classic RainTPL loops, plugins order is handle by JavaScript. You can just include <code>plugin_admin.js</code>, only if:</p>
423<ul>
424<li>you're using a table.</li>
425<li>you call orderUp() and orderUp() onclick on arrows.</li>
426<li>you add data-line and data-order to your rows.</li>
427</ul>
428<p>Otherwise, you can use your own JS as long as this field is send by the form:</p>
429<p><input type="hidden" name="order_{$key}" value="{$counter}"></p>
396<h3 id="placeholder-system">Placeholder system</h3> 430<h3 id="placeholder-system">Placeholder system</h3>
397<p>In order to make plugins work with every custom themes, you need to add variable placeholder in your templates.</p> 431<p>In order to make plugins work with every custom themes, you need to add variable placeholder in your templates.</p>
398<p>It's a RainTPL loop like this:</p> 432<p>It's a RainTPL loop like this:</p>
@@ -406,96 +440,104 @@ code > span.er { color: #ff0000; font-weight: bold; }
406<pre><code>{loop=&quot;$plugins_header.buttons_toolbar&quot;} 440<pre><code>{loop=&quot;$plugins_header.buttons_toolbar&quot;}
407 {$value} 441 {$value}
408{/loop}</code></pre> 442{/loop}</code></pre>
443<p>At the end of file, before clearing floating blocks:</p>
444<pre><code>{if=&quot;!empty($plugin_errors) &amp;&amp; isLoggedIn()&quot;}
445 &lt;ul class=&quot;errors&quot;&gt;
446 {loop=&quot;plugin_errors&quot;}
447 &lt;li&gt;{$value}&lt;/li&gt;
448 {/loop}
449 &lt;/ul&gt;
450{/if}</code></pre>
409<p><strong>includes.html</strong></p> 451<p><strong>includes.html</strong></p>
410<p>At the end of the file:</p> 452<p>At the end of the file:</p>
411<pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$plugins_includes.css_files&quot;} 453<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$plugins_includes.css_files&quot;}
412<span class="kw">&lt;link</span><span class="ot"> type=</span><span class="st">&quot;text/css&quot;</span><span class="ot"> rel=</span><span class="st">&quot;stylesheet&quot;</span><span class="ot"> href=</span><span class="st">&quot;{$value}#&quot;</span><span class="kw">/&gt;</span> 454<span class="kw">&lt;link</span><span class="ot"> type=</span><span class="st">&quot;text/css&quot;</span><span class="ot"> rel=</span><span class="st">&quot;stylesheet&quot;</span><span class="ot"> href=</span><span class="st">&quot;{$value}#&quot;</span><span class="kw">/&gt;</span>
413{/loop}</code></pre> 455{/loop}</code></pre></div>
414<p><strong>page.footer.html</strong></p> 456<p><strong>page.footer.html</strong></p>
415<p>At the end of your footer notes:</p> 457<p>At the end of your footer notes:</p>
416<pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$plugins_footer.text&quot;} 458<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$plugins_footer.text&quot;}
417 {$value} 459 {$value}
418{/loop}</code></pre> 460{/loop}</code></pre></div>
419<p>At the end of file:</p> 461<p>At the end of file:</p>
420<pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$plugins_footer.js_files&quot;} 462<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$plugins_footer.js_files&quot;}
421 <span class="kw">&lt;script</span><span class="ot"> src=</span><span class="st">&quot;{$value}#&quot;</span><span class="kw">&gt;&lt;/script&gt;</span> 463 <span class="kw">&lt;script</span><span class="ot"> src=</span><span class="st">&quot;{$value}#&quot;</span><span class="kw">&gt;&lt;/script&gt;</span>
422{/loop}</code></pre> 464{/loop}</code></pre></div>
423<p><strong>linklist.html</strong></p> 465<p><strong>linklist.html</strong></p>
424<p>After search fields:</p> 466<p>After search fields:</p>
425<pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$plugins_header.fields_toolbar&quot;} 467<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$plugins_header.fields_toolbar&quot;}
426 {$value} 468 {$value}
427{/loop}</code></pre> 469{/loop}</code></pre></div>
428<p>Before displaying the link list (after paging):</p> 470<p>Before displaying the link list (after paging):</p>
429<pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$plugin_start_zone&quot;} 471<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$plugin_start_zone&quot;}
430 {$value} 472 {$value}
431{/loop}</code></pre> 473{/loop}</code></pre></div>
432<p>For every links (icons):</p> 474<p>For every links (icons):</p>
433<pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$value.link_plugin&quot;} 475<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$value.link_plugin&quot;}
434 <span class="kw">&lt;span&gt;</span>{$value}<span class="kw">&lt;/span&gt;</span> 476 <span class="kw">&lt;span&gt;</span>{$value}<span class="kw">&lt;/span&gt;</span>
435{/loop}</code></pre> 477{/loop}</code></pre></div>
436<p>Before end paging:</p> 478<p>Before end paging:</p>
437<pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$plugin_end_zone&quot;} 479<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$plugin_end_zone&quot;}
438 {$value} 480 {$value}
439{/loop}</code></pre> 481{/loop}</code></pre></div>
440<p><strong>linklist.paging.html</strong></p> 482<p><strong>linklist.paging.html</strong></p>
441<p>After the &quot;private only&quot; icon:</p> 483<p>After the &quot;private only&quot; icon:</p>
442<pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$action_plugin&quot;} 484<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$action_plugin&quot;}
443 {$value} 485 {$value}
444{/loop}</code></pre> 486{/loop}</code></pre></div>
445<p><strong>editlink.html</strong></p> 487<p><strong>editlink.html</strong></p>
446<p>After tags field:</p> 488<p>After tags field:</p>
447<pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$edit_link_plugin&quot;} 489<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$edit_link_plugin&quot;}
448 {$value} 490 {$value}
449{/loop}</code></pre> 491{/loop}</code></pre></div>
450<p><strong>tools.html</strong></p> 492<p><strong>tools.html</strong></p>
451<p>After the last tool:</p> 493<p>After the last tool:</p>
452<pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$tools_plugin&quot;} 494<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop=&quot;$tools_plugin&quot;}
453 {$value} 495 {$value}
454{/loop}</code></pre> 496{/loop}</code></pre></div>
455<p><strong>picwall.html</strong></p> 497<p><strong>picwall.html</strong></p>
456<p>Top:</p> 498<p>Top:</p>
457<pre class="sourceCode html"><code class="sourceCode html"><span class="kw">&lt;div</span><span class="ot"> id=</span><span class="st">&quot;plugin_zone_start_picwall&quot;</span><span class="ot"> class=</span><span class="st">&quot;plugin_zone&quot;</span><span class="kw">&gt;</span> 499<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw">&lt;div</span><span class="ot"> id=</span><span class="st">&quot;plugin_zone_start_picwall&quot;</span><span class="ot"> class=</span><span class="st">&quot;plugin_zone&quot;</span><span class="kw">&gt;</span>
458 {loop=&quot;$plugin_start_zone&quot;} 500 {loop=&quot;$plugin_start_zone&quot;}
459 {$value} 501 {$value}
460 {/loop} 502 {/loop}
461<span class="kw">&lt;/div&gt;</span></code></pre> 503<span class="kw">&lt;/div&gt;</span></code></pre></div>
462<p>Bottom:</p> 504<p>Bottom:</p>
463<pre class="sourceCode html"><code class="sourceCode html"><span class="kw">&lt;div</span><span class="ot"> id=</span><span class="st">&quot;plugin_zone_end_picwall&quot;</span><span class="ot"> class=</span><span class="st">&quot;plugin_zone&quot;</span><span class="kw">&gt;</span> 505<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw">&lt;div</span><span class="ot"> id=</span><span class="st">&quot;plugin_zone_end_picwall&quot;</span><span class="ot"> class=</span><span class="st">&quot;plugin_zone&quot;</span><span class="kw">&gt;</span>
464 {loop=&quot;$plugin_end_zone&quot;} 506 {loop=&quot;$plugin_end_zone&quot;}
465 {$value} 507 {$value}
466 {/loop} 508 {/loop}
467<span class="kw">&lt;/div&gt;</span></code></pre> 509<span class="kw">&lt;/div&gt;</span></code></pre></div>
468<p><strong>tagcloud.html</strong></p> 510<p><strong>tagcloud.html</strong></p>
469<p>Top:</p> 511<p>Top:</p>
470<pre class="sourceCode html"><code class="sourceCode html"> <span class="kw">&lt;div</span><span class="ot"> id=</span><span class="st">&quot;plugin_zone_start_tagcloud&quot;</span><span class="ot"> class=</span><span class="st">&quot;plugin_zone&quot;</span><span class="kw">&gt;</span> 512<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"> <span class="kw">&lt;div</span><span class="ot"> id=</span><span class="st">&quot;plugin_zone_start_tagcloud&quot;</span><span class="ot"> class=</span><span class="st">&quot;plugin_zone&quot;</span><span class="kw">&gt;</span>
471 {loop=&quot;$plugin_start_zone&quot;} 513 {loop=&quot;$plugin_start_zone&quot;}
472 {$value} 514 {$value}
473 {/loop} 515 {/loop}
474 <span class="kw">&lt;/div&gt;</span></code></pre> 516 <span class="kw">&lt;/div&gt;</span></code></pre></div>
475<p>Bottom:</p> 517<p>Bottom:</p>
476<pre class="sourceCode html"><code class="sourceCode html"> <span class="kw">&lt;div</span><span class="ot"> id=</span><span class="st">&quot;plugin_zone_end_tagcloud&quot;</span><span class="ot"> class=</span><span class="st">&quot;plugin_zone&quot;</span><span class="kw">&gt;</span> 518<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"> <span class="kw">&lt;div</span><span class="ot"> id=</span><span class="st">&quot;plugin_zone_end_tagcloud&quot;</span><span class="ot"> class=</span><span class="st">&quot;plugin_zone&quot;</span><span class="kw">&gt;</span>
477 {loop=&quot;$plugin_end_zone&quot;} 519 {loop=&quot;$plugin_end_zone&quot;}
478 {$value} 520 {$value}
479 {/loop} 521 {/loop}
480 <span class="kw">&lt;/div&gt;</span></code></pre> 522 <span class="kw">&lt;/div&gt;</span></code></pre></div>
481<p><strong>daily.html</strong></p> 523<p><strong>daily.html</strong></p>
482<p>Top:</p> 524<p>Top:</p>
483<pre class="sourceCode html"><code class="sourceCode html"><span class="kw">&lt;div</span><span class="ot"> id=</span><span class="st">&quot;plugin_zone_start_picwall&quot;</span><span class="ot"> class=</span><span class="st">&quot;plugin_zone&quot;</span><span class="kw">&gt;</span> 525<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw">&lt;div</span><span class="ot"> id=</span><span class="st">&quot;plugin_zone_start_picwall&quot;</span><span class="ot"> class=</span><span class="st">&quot;plugin_zone&quot;</span><span class="kw">&gt;</span>
484 {loop=&quot;$plugin_start_zone&quot;} 526 {loop=&quot;$plugin_start_zone&quot;}
485 {$value} 527 {$value}
486 {/loop} 528 {/loop}
487<span class="kw">&lt;/div&gt;</span></code></pre> 529<span class="kw">&lt;/div&gt;</span></code></pre></div>
488<p>After every link:</p> 530<p>After every link:</p>
489<pre class="sourceCode html"><code class="sourceCode html"><span class="kw">&lt;div</span><span class="ot"> class=</span><span class="st">&quot;dailyEntryFooter&quot;</span><span class="kw">&gt;</span> 531<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw">&lt;div</span><span class="ot"> class=</span><span class="st">&quot;dailyEntryFooter&quot;</span><span class="kw">&gt;</span>
490 {loop=&quot;$link.link_plugin&quot;} 532 {loop=&quot;$link.link_plugin&quot;}
491 {$value} 533 {$value}
492 {/loop} 534 {/loop}
493<span class="kw">&lt;/div&gt;</span></code></pre> 535<span class="kw">&lt;/div&gt;</span></code></pre></div>
494<p>Bottom:</p> 536<p>Bottom:</p>
495<pre class="sourceCode html"><code class="sourceCode html"><span class="kw">&lt;div</span><span class="ot"> id=</span><span class="st">&quot;plugin_zone_end_picwall&quot;</span><span class="ot"> class=</span><span class="st">&quot;plugin_zone&quot;</span><span class="kw">&gt;</span> 537<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw">&lt;div</span><span class="ot"> id=</span><span class="st">&quot;plugin_zone_end_picwall&quot;</span><span class="ot"> class=</span><span class="st">&quot;plugin_zone&quot;</span><span class="kw">&gt;</span>
496 {loop=&quot;$plugin_end_zone&quot;} 538 {loop=&quot;$plugin_end_zone&quot;}
497 {$value} 539 {$value}
498 {/loop} 540 {/loop}
499<span class="kw">&lt;/div&gt;</span></code></pre> 541<span class="kw">&lt;/div&gt;</span></code></pre></div>
500</body> 542</body>
501</html> 543</html>