devel:admin_plugins
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
devel:admin_plugins [2016-01-27 13:26] – [Admin plugin trigger] fix link of Admin Plugin Example 126.237.117.2 | devel:admin_plugins [2023-09-01 23:55] (current) – Klap-in | ||
---|---|---|---|
Line 13: | Line 13: | ||
An Admin Plugin //Example// needs: | An Admin Plugin //Example// needs: | ||
* class name '' | * class name '' | ||
- | * which extends [[xref>DokuWiki_Admin_Plugin]]((defined in '' | + | * which extends [[xref>AdminPlugin]]((defined in '' |
* to be stored in a file '' | * to be stored in a file '' | ||
Moreover, a [[plugin_info|plugin.info.txt]] file is needed. For full details of plugins and their files and how to create more admin components refer to [[plugin file structure]]. | Moreover, a [[plugin_info|plugin.info.txt]] file is needed. For full details of plugins and their files and how to create more admin components refer to [[plugin file structure]]. | ||
Line 21: | Line 21: | ||
^Name ^Description ^ | ^Name ^Description ^ | ||
- | |[[xref>lib/plugins/admin.php#handle|handle()]] |Called from [[xref> | + | |[[xref>inc/Extension/AdminPlugin:: |
- | |[[xref>lib/plugins/admin.php#html|html()]] | + | |[[xref>inc/Extension/AdminPlugin:: |
===Optional methods=== | ===Optional methods=== | ||
(Override only if needed): | (Override only if needed): | ||
- | ^Name ^Description ^ | + | ^ Name ^ Description |
- | |[[xref>lib/ | + | | [[xref> |
- | |[[xref>lib/ | + | | [[xref> |
- | |[[xref>lib/ | + | | [[xref> |
- | |[[xref>lib/ | + | | [[xref> |
+ | | [[xref> | ||
===Inherited methods=== | ===Inherited methods=== | ||
Line 37: | Line 38: | ||
See [[common plugin functions]] for inherited functions available to all plugins. e.g. localisation, | See [[common plugin functions]] for inherited functions available to all plugins. e.g. localisation, | ||
- | \\ | + | === Icon === |
+ | |||
+ | Since the 2017 Frusterick Manners release, admin plugins can provide an icon to be shown next to the plugin' | ||
+ | |||
+ | There are a few restrictions the icon has to adhere to for it to be displayed: | ||
+ | |||
+ | * It has to be in SVG format | ||
+ | * The file has to be smaller than 2 kB | ||
+ | * It should only contain a single path object | ||
+ | |||
+ | The fill color of the path will be set by CSS and match the link color (unless your template does something different). | ||
+ | |||
+ | To match the style of other icons, we recommend to either pick an icon from the huge, free selection at https:// | ||
===== Admin plugin trigger ===== | ===== Admin plugin trigger ===== | ||
Line 48: | Line 62: | ||
* '' | * '' | ||
* '' | * '' | ||
- | * '' | + | * '' |
- | * '' | + | * '' |
- | Best practice is to include these variables in your plugin' | + | Best practice is to include these variables in your plugin' |
Line 63: | Line 77: | ||
* If you haven' | * If you haven' | ||
- | * A plugin may vary its menu text on the main admin menu depending on its status or the state of what it administers. The [[plugin: | + | * A plugin may vary its menu text on the main admin menu depending on its status or the state of what it administers. The [[plugin: |
==== Safety ==== | ==== Safety ==== | ||
Line 71: | Line 85: | ||
* All user entered data must be treated with suspicion, even from users identified as admins by ACL settings. It is recommended to use DokuWiki [[request_vars|Input Class]]. This class gives you type safe access to the request variables, makes sure they are correctly initialized and allows you to set defaults. | * All user entered data must be treated with suspicion, even from users identified as admins by ACL settings. It is recommended to use DokuWiki [[request_vars|Input Class]]. This class gives you type safe access to the request variables, makes sure they are correctly initialized and allows you to set defaults. | ||
- | * Use the '' | + | * Use the |
+ | |||
+ | * When using forms you should include a hidden form field with the session-based security token by calling the function [[xref> | ||
- | * When using forms you should include a hidden form field with the session-based security token by calling the function [[xref> | ||
==== Core API & globals ==== | ==== Core API & globals ==== | ||
devel/admin_plugins.1453897615.txt.gz · Last modified: 2016-01-27 13:26 by 126.237.117.2