| Both sides previous revision Previous revision Next revision | Previous revision |
| en:entwickler:plugin_manager [2026/02/01 16:38] – [Naming conventions] mightymcoder | en:entwickler:plugin_manager [2026/02/01 18:48] (current) – [Plugin Manager] mightymcoder |
|---|
| plugins in Admidio. | plugins in Admidio. |
| |
| | A Basic //"Overview Plugin Example"// can by found here: [[https://github.com/Admidio/admidio-overview-plugin-example|Admidio Overview Plugin Example]] |
| ======== Make your plugin compatible with the Plugin Manager (Admidio 5) ======== | ======== Make your plugin compatible with the Plugin Manager (Admidio 5) ======== |
| To make your plugin compatible with the Plugin Manager certain requirements must first be met. These include: | To make your plugin compatible with the Plugin Manager certain requirements must first be met. These include: |
| |
| ======= Naming conventions ======= | ======= Naming conventions ======= |
| To use the new PluginManager some naming conventions must be observed: | To use the new Plugin Manager some naming conventions must be observed: |
| - For better readability file and folder names containing multiple words should follow snake_case (underscore separated) notation. | - For better readability file and folder names containing multiple words should follow snake_case (underscore separated) notation. |
| - All folder and file names containing multiple words and are placed inside the //classes// folder should follow UpperCamelCase (PascalCase) notation. | - All folder and file names containing multiple words and are placed inside the //classes// folder should follow UpperCamelCase (PascalCase) notation. |
| <code php> | <code php> |
| <?php | <?php |
| use Plugins\Birthday\classes\Birthday; | use Birthday\classes\Birthday; |
| |
| /** | /** |
| | "icon" | | The icon displayed in the Admidio sidebar and on the Plugin Manager overview. | | | "icon" | | The icon displayed in the Admidio sidebar and on the Plugin Manager overview. | |
| | "mainFile" | | The filename of the main plugin entry point. If not set "index.php" or "PluginName.php" is assumed. | | | "mainFile" | | The filename of the main plugin entry point. If not set "index.php" or "PluginName.php" is assumed. | |
| | | "overviewPlugin" | | This optional flag is used to determinate whether the plugin should be installed as an overview plugin. | |
| | | "autoload" | (X) | An object containing another object "psr-4" which contains the psr4 autoload mapping(s) of the plugin class(es). | |
| | | "preferencesFile" | | The filename of the preferences entry point for the plugin settings. If this key is set there is no integration of the plugin settings into the Admidio Preferences Page. | |
| | "hasSubcards" | | This optional flag is used to determinate whether a plugins preference page contains multiple "cards" to display (for CSS styling purposes only). | | | "hasSubcards" | | This optional flag is used to determinate whether a plugins preference page contains multiple "cards" to display (for CSS styling purposes only). | |
| | "dependencies" | (X) | An array of all dependencies the plugin needs to work properly. If this is not set the Plugin Manager cannot detect whether the plugin can be installed properly. | | | "dependencies" | (X) | An array of all dependencies the plugin needs to work properly. If this is not set the Plugin Manager cannot detect whether the plugin can be installed properly. | |
| <code json> | <code json> |
| { | { |
| "name": "PLG_BIRTHDAY_PLUGIN_NAME", | "name": "PLG_BIRTHDAY_PLUGIN_NAME", |
| "description": "PLG_BIRTHDAY_PLUGIN_DESCRIPTION", | "description": "PLG_BIRTHDAY_PLUGIN_DESCRIPTION", |
| "version": "1.0.0", | "version": "1.0.0", |
| "author": "Admidio Team", | "author": "Admidio Team", |
| "url": "https://www.admidio.org", | "url": "https://www.admidio.org", |
| "icon": "bi-cake2", | "icon": "bi-cake2", |
| "mainFile": "index.php", | "mainFile": "index.php", |
| "dependencies": [ | "overviewPlugin": true, |
| "Admidio\\Infrastructure\\Plugins\\Overview", | "autoload": { |
| "Admidio\\Infrastructure\\Plugins\\PluginAbstract", | "psr-4": { |
| "Admidio\\Infrastructure\\Utils\\SecurityUtils", | "Birthday\\classes\\": "classes/" |
| "Admidio\\Roles\\Service\\RolesService" | } |
| ], | }, |
| | "dependencies": [ |
| | "Admidio\\Infrastructure\\Plugins\\Overview", |
| | "Admidio\\Infrastructure\\Plugins\\PluginAbstract", |
| | "Admidio\\Infrastructure\\Utils\\SecurityUtils", |
| | "Admidio\\Roles\\Service\\RolesService" |
| | ], |
| | "defaultConfig": { |
| | "birthday_plugin_enabled": { |
| | "name": "ORG_ACCESS_TO_PLUGIN", |
| | "description": "ORG_ACCESS_TO_PLUGIN_DESC", |
| | "type": "integer", |
| | "value" : 1 |
| | }, |
| | "birthday_overview_sequence": { |
| | "type": "integer", |
| | "value" : 2 |
| | }, |
| | "birthday_show_names_extern": { |
| | "name": "PLG_BIRTHDAY_PREFERENCES_SHOW_NAMES_EXTERN", |
| | "description": "PLG_BIRTHDAY_PREFERENCES_SHOW_NAMES_EXTERN_DESC", |
| | "type": "boolean", |
| | "value" : false |
| | }, |
| | "birthday_show_names": { |
| | "name": "PLG_BIRTHDAY_PREFERENCES_SHOW_NAMES", |
| | "description": "PLG_BIRTHDAY_PREFERENCES_SHOW_NAMES_DESC", |
| | "type": "integer", |
| | "value" : 0 |
| | }, |
| | "birthday_show_age": { |
| | "name": "PLG_BIRTHDAY_PREFERENCES_SHOW_AGE", |
| | "description": "PLG_BIRTHDAY_PREFERENCES_SHOW_AGE_DESC", |
| | "type": "boolean", |
| | "value" : false |
| | }, |
| | "birthday_show_age_salutation": { |
| | "name": "PLG_BIRTHDAY_PREFERENCES_SHOW_AGE_SALUTATION", |
| | "description": "PLG_BIRTHDAY_PREFERENCES_SHOW_AGE_SALUTATION_DESC", |
| | "type": "integer", |
| | "value" : 18 |
| | }, |
| | "birthday_show_notice_none": { |
| | "name": "PLG_BIRTHDAY_PREFERENCES_SHOW_NOTICE_NONE", |
| | "description": "PLG_BIRTHDAY_PREFERENCES_SHOW_NOTICE_NONE_DESC", |
| | "type": "boolean", |
| | "value" : true |
| | }, |
| | "birthday_show_past": { |
| | "name": "PLG_BIRTHDAY_PREFERENCES_SHOW_PAST", |
| | "description": "PLG_BIRTHDAY_PREFERENCES_SHOW_PAST_DESC", |
| | "type": "integer", |
| | "value" : 1 |
| | }, |
| | "birthday_show_future": { |
| | "name": "PLG_BIRTHDAY_PREFERENCES_SHOW_FUTURE", |
| | "description": "PLG_BIRTHDAY_PREFERENCES_SHOW_FUTURE_DESC", |
| | "type": "integer", |
| | "value" : 2 |
| | }, |
| | "birthday_show_display_limit": { |
| | "name": "PLG_BIRTHDAY_PREFERENCES_SHOW_DISPLAY_LIMIT", |
| | "description": "PLG_BIRTHDAY_PREFERENCES_SHOW_DISPLAY_LIMIT_DESC", |
| | "type": "integer", |
| | "value" : 200 |
| | }, |
| | "birthday_show_email_extern": { |
| | "name": "PLG_BIRTHDAY_PREFERENCES_SHOW_EMAIL_EXTERN", |
| | "description": "PLG_BIRTHDAY_PREFERENCES_SHOW_EMAIL_EXTERN_DESC", |
| | "type": "integer", |
| | "value" : 0 |
| | }, |
| | "birthday_roles_view_plugin": { |
| | "name": "PLG_BIRTHDAY_PREFERENCES_ROLES_VIEW_PLUGIN", |
| | "description": "PLG_BIRTHDAY_PREFERENCES_ROLES_VIEW_PLUGIN_DESC", |
| | "type": "array", |
| | "value" : ["All"] |
| | }, |
| | "birthday_roles_sql": { |
| | "name": "PLG_BIRTHDAY_PREFERENCES_ROLES_SQL", |
| | "description": "PLG_BIRTHDAY_PREFERENCES_ROLES_SQL_DESC", |
| | "type": "array", |
| | "value" : ["All"] |
| | }, |
| | "birthday_sort_sql": { |
| | "name": "PLG_BIRTHDAY_PREFERENCES_SORT_SQL", |
| | "description": "PLG_BIRTHDAY_PREFERENCES_SORT_SQL_DESC", |
| | "type": "string", |
| | "value" : "DESC" |
| | } |
| | } |
| | } ], |
| "defaultConfig": { | "defaultConfig": { |
| "birthday_plugin_enabled": { | "birthday_plugin_enabled": { |