https://wiki.mahara.org/index.php?title=User:Gold/Docs/Anatomy_of_a_Search_Plugin&feed=atom&action=history
User:Gold/Docs/Anatomy of a Search Plugin - Revision history
2024-03-29T06:40:51Z
Revision history for this page on the wiki
MediaWiki 1.35.10
https://wiki.mahara.org/index.php?title=User:Gold/Docs/Anatomy_of_a_Search_Plugin&diff=12116&oldid=prev
Gold: /* Configuration */
2021-05-19T23:10:46Z
<p><span dir="auto"><span class="autocomment">Configuration</span></span></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 23:10, 19 May 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l28" >Line 28:</td>
<td colspan="2" class="diff-lineno">Line 28:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Configuration ===</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Configuration ===</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Adding a configuration form is just a matter of implementing the following methods.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">* <code>has_config()</code> : Tells the system there is a config form. Shows the config cog on the Plugin Administration screen.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">* <code>get_config_options()</code> : Return a Pieform array.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">* <code>validate_config_options(Pieform $form, $values)</code> : Validate the user input from your config form.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">* <code>save_config_options(Pieform $form, $values)</code> : Save config options and react to any values entered.</ins></div></td></tr>
</table>
Gold
https://wiki.mahara.org/index.php?title=User:Gold/Docs/Anatomy_of_a_Search_Plugin&diff=12115&oldid=prev
Gold: Initial WIP on documenting a search plugin.
2021-05-18T21:46:00Z
<p>Initial WIP on documenting a search plugin.</p>
<p><b>New page</b></p><div>== tl;dr; ==<br />
<br />
This is intended to become a developer reference.<br />
<br />
== How to get your plugin seen by the system ==<br />
<br />
The Plugin will live in the <code>htdocs/search</code> directory and needs to extend the <code>PluginSearch</code> class. As with all Mahara plugins the class is loaded from/lives in the <code>lib.php</code> file in the plugin directory.<br />
<br />
<pre><br />
htdocs/search/Mysearch<br />
├── lib<br />
│ └── PluginSearchMysearch.php<br />
├── lib.php<br />
└── version.php<br />
</pre><br />
<br />
To keep things tidy we are adding a <code>lib</code> directory where the class files will live. This isn't strictly needed, but if your plugin is going to create multiple classes this is a way to keep the line count per file down to a manageable level. If you are only going to need one class though, skip this and just add it to the <code>lib.php</code> file.<br />
<br />
The following methods need to be implemented by your Plugin.<br />
* <code>search_user()</code> : <br />
* <code>search_group()</code> : <br />
* <code>group_search_user()</code> : <br />
* <code>self_search()</code> : <br />
<br />
=== Extras ===<br />
<br />
* Implement <code>get_plugin_display_name()</code> to give your plugin a human readable name.<br />
<br />
=== Configuration ===</div>
Gold