diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-10-12 13:58:35 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-10-12 13:58:35 +0200 |
commit | bc22c9a0acb095970e9494cbe8954f0612e05dc0 (patch) | |
tree | 4e3a94b7469f5b2e3eaf946756235730429bf9d4 /doc/Plugin-System.html | |
parent | 890afc32f744859d11b97eb26ed5c030af9b4145 (diff) | |
parent | ebd67c6e1b40aebdd3a52285ce9ff9412b2a3038 (diff) | |
download | Shaarli-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.html | 222 |
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"> |
10 | div.sourceCode { overflow-x: auto; } | ||
13 | table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { | 11 | table.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; } |
15 | table.sourceCode { width: 100%; line-height: 100%; } | 13 | table.sourceCode { width: 100%; line-height: 100%; } |
16 | td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; } | 14 | td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; } |
17 | td.sourceCode { padding-left: 5px; } | 15 | td.sourceCode { padding-left: 5px; } |
18 | code > span.kw { color: #007020; font-weight: bold; } | 16 | code > span.kw { color: #007020; font-weight: bold; } /* Keyword */ |
19 | code > span.dt { color: #902000; } | 17 | code > span.dt { color: #902000; } /* DataType */ |
20 | code > span.dv { color: #40a070; } | 18 | code > span.dv { color: #40a070; } /* DecVal */ |
21 | code > span.bn { color: #40a070; } | 19 | code > span.bn { color: #40a070; } /* BaseN */ |
22 | code > span.fl { color: #40a070; } | 20 | code > span.fl { color: #40a070; } /* Float */ |
23 | code > span.ch { color: #4070a0; } | 21 | code > span.ch { color: #4070a0; } /* Char */ |
24 | code > span.st { color: #4070a0; } | 22 | code > span.st { color: #4070a0; } /* String */ |
25 | code > span.co { color: #60a0b0; font-style: italic; } | 23 | code > span.co { color: #60a0b0; font-style: italic; } /* Comment */ |
26 | code > span.ot { color: #007020; } | 24 | code > span.ot { color: #007020; } /* Other */ |
27 | code > span.al { color: #ff0000; font-weight: bold; } | 25 | code > span.al { color: #ff0000; font-weight: bold; } /* Alert */ |
28 | code > span.fu { color: #06287e; } | 26 | code > span.fu { color: #06287e; } /* Function */ |
29 | code > span.er { color: #ff0000; font-weight: bold; } | 27 | code > span.er { color: #ff0000; font-weight: bold; } /* Error */ |
28 | code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ | ||
29 | code > span.cn { color: #880000; } /* Constant */ | ||
30 | code > span.sc { color: #4070a0; } /* SpecialChar */ | ||
31 | code > span.vs { color: #4070a0; } /* VerbatimString */ | ||
32 | code > span.ss { color: #bb6688; } /* SpecialString */ | ||
33 | code > span.im { } /* Import */ | ||
34 | code > span.va { color: #19177c; } /* Variable */ | ||
35 | code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ | ||
36 | code > span.op { color: #666666; } /* Operator */ | ||
37 | code > span.bu { } /* BuiltIn */ | ||
38 | code > span.ex { } /* Extension */ | ||
39 | code > span.pp { color: #bc7a00; } /* Preprocessor */ | ||
40 | code > span.at { color: #7d9029; } /* Attribute */ | ||
41 | code > span.do { color: #ba2121; font-style: italic; } /* Documentation */ | ||
42 | code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ | ||
43 | code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ | ||
44 | code > 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="'ENABLED_PLUGINS']-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">'config'</span><span class="ot">[</span><span class="st">'ENABLED_PLUGINS'</span><span class="ot">]](</span><span class="st">'ENABLED_PLUGINS'</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">'config'</span><span class="ot">[</span><span class="st">'ENABLED_PLUGINS'</span><span class="ot">]</span> = <span class="fu">array</span><span class="ot">(](</span><span class="st">'ENABLED_PLUGINS'</span><span class="ot">]</span>-=-<span class="fu">array</span><span class="ot">(</span>.html<span class="ot">)</span> | ||
91 | <span class="st">'qrcode'</span><span class="ot">,</span> <span class="st">'archiveorg'</span><span class="ot">,</span> <span class="st">'readityourself'</span><span class="ot">,</span> <span class="st">'playvideos'</span><span class="ot">,</span> | ||
92 | <span class="st">'wallabag'</span><span class="ot">,</span> <span class="st">'markdown'</span><span class="ot">,</span> <span class="st">'addlink_toolbar'</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">'top_placeholder'</span><span class="ot">[]</span> = <span class="st">'My content'</span><span class="ot">;](]</span>-=-<span class="st">'My-content'</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">'top_placeholder'</span><span class="ot">[]</span> = <span class="st">'My content'</span><span class="ot">;](]</span>-=-<span class="st">'My-content'</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">'top_placeholder'</span><span class="ot">],</span> <span class="st">'My'</span><span class="ot">,</span> <span class="st">'content'</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">'top_placeholder'</span><span class="ot">],</span> <span class="st">'My'</span><span class="ot">,</span> <span class="st">'content'</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">'links'</span><span class="ot">]</span> <span class="kw">as</span> &<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">'links'</span><span class="ot">]</span> <span class="kw">as</span> &<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">'title'</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">'title'</span><span class="ot">]);[](</span>.html<span class="ot">)</span> | 154 | <span class="kw">$value</span><span class="ot">[</span><span class="st">'title'</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">'title'</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><plugin_name>.meta</code> file, which is in fact an <code>.ini</code> file (<code>KEY="VALUE"</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>"</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="$plugins_header.buttons_toolbar"} | 440 | <pre><code>{loop="$plugins_header.buttons_toolbar"} |
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="!empty($plugin_errors) && isLoggedIn()"} | ||
445 | <ul class="errors"> | ||
446 | {loop="plugin_errors"} | ||
447 | <li>{$value}</li> | ||
448 | {/loop} | ||
449 | </ul> | ||
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="$plugins_includes.css_files"} | 453 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$plugins_includes.css_files"} |
412 | <span class="kw"><link</span><span class="ot"> type=</span><span class="st">"text/css"</span><span class="ot"> rel=</span><span class="st">"stylesheet"</span><span class="ot"> href=</span><span class="st">"{$value}#"</span><span class="kw">/></span> | 454 | <span class="kw"><link</span><span class="ot"> type=</span><span class="st">"text/css"</span><span class="ot"> rel=</span><span class="st">"stylesheet"</span><span class="ot"> href=</span><span class="st">"{$value}#"</span><span class="kw">/></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="$plugins_footer.text"} | 458 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$plugins_footer.text"} |
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="$plugins_footer.js_files"} | 462 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$plugins_footer.js_files"} |
421 | <span class="kw"><script</span><span class="ot"> src=</span><span class="st">"{$value}#"</span><span class="kw">></script></span> | 463 | <span class="kw"><script</span><span class="ot"> src=</span><span class="st">"{$value}#"</span><span class="kw">></script></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="$plugins_header.fields_toolbar"} | 467 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$plugins_header.fields_toolbar"} |
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="$plugin_start_zone"} | 471 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$plugin_start_zone"} |
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="$value.link_plugin"} | 475 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$value.link_plugin"} |
434 | <span class="kw"><span></span>{$value}<span class="kw"></span></span> | 476 | <span class="kw"><span></span>{$value}<span class="kw"></span></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="$plugin_end_zone"} | 479 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$plugin_end_zone"} |
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 "private only" icon:</p> | 483 | <p>After the "private only" icon:</p> |
442 | <pre class="sourceCode html"><code class="sourceCode html">{loop="$action_plugin"} | 484 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$action_plugin"} |
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="$edit_link_plugin"} | 489 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$edit_link_plugin"} |
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="$tools_plugin"} | 494 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html">{loop="$tools_plugin"} |
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"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_start_picwall"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span> | 499 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_start_picwall"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span> |
458 | {loop="$plugin_start_zone"} | 500 | {loop="$plugin_start_zone"} |
459 | {$value} | 501 | {$value} |
460 | {/loop} | 502 | {/loop} |
461 | <span class="kw"></div></span></code></pre> | 503 | <span class="kw"></div></span></code></pre></div> |
462 | <p>Bottom:</p> | 504 | <p>Bottom:</p> |
463 | <pre class="sourceCode html"><code class="sourceCode html"><span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_end_picwall"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span> | 505 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_end_picwall"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span> |
464 | {loop="$plugin_end_zone"} | 506 | {loop="$plugin_end_zone"} |
465 | {$value} | 507 | {$value} |
466 | {/loop} | 508 | {/loop} |
467 | <span class="kw"></div></span></code></pre> | 509 | <span class="kw"></div></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"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_start_tagcloud"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span> | 512 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_start_tagcloud"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span> |
471 | {loop="$plugin_start_zone"} | 513 | {loop="$plugin_start_zone"} |
472 | {$value} | 514 | {$value} |
473 | {/loop} | 515 | {/loop} |
474 | <span class="kw"></div></span></code></pre> | 516 | <span class="kw"></div></span></code></pre></div> |
475 | <p>Bottom:</p> | 517 | <p>Bottom:</p> |
476 | <pre class="sourceCode html"><code class="sourceCode html"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_end_tagcloud"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span> | 518 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_end_tagcloud"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span> |
477 | {loop="$plugin_end_zone"} | 519 | {loop="$plugin_end_zone"} |
478 | {$value} | 520 | {$value} |
479 | {/loop} | 521 | {/loop} |
480 | <span class="kw"></div></span></code></pre> | 522 | <span class="kw"></div></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"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_start_picwall"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span> | 525 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_start_picwall"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span> |
484 | {loop="$plugin_start_zone"} | 526 | {loop="$plugin_start_zone"} |
485 | {$value} | 527 | {$value} |
486 | {/loop} | 528 | {/loop} |
487 | <span class="kw"></div></span></code></pre> | 529 | <span class="kw"></div></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"><div</span><span class="ot"> class=</span><span class="st">"dailyEntryFooter"</span><span class="kw">></span> | 531 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw"><div</span><span class="ot"> class=</span><span class="st">"dailyEntryFooter"</span><span class="kw">></span> |
490 | {loop="$link.link_plugin"} | 532 | {loop="$link.link_plugin"} |
491 | {$value} | 533 | {$value} |
492 | {/loop} | 534 | {/loop} |
493 | <span class="kw"></div></span></code></pre> | 535 | <span class="kw"></div></span></code></pre></div> |
494 | <p>Bottom:</p> | 536 | <p>Bottom:</p> |
495 | <pre class="sourceCode html"><code class="sourceCode html"><span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_end_picwall"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span> | 537 | <div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw"><div</span><span class="ot"> id=</span><span class="st">"plugin_zone_end_picwall"</span><span class="ot"> class=</span><span class="st">"plugin_zone"</span><span class="kw">></span> |
496 | {loop="$plugin_end_zone"} | 538 | {loop="$plugin_end_zone"} |
497 | {$value} | 539 | {$value} |
498 | {/loop} | 540 | {/loop} |
499 | <span class="kw"></div></span></code></pre> | 541 | <span class="kw"></div></span></code></pre></div> |
500 | </body> | 542 | </body> |
501 | </html> | 543 | </html> |