Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:entwickler:plugin_manager [2025/08/21 18:19] – [PluginAbstract class] mightymcoderen:entwickler:plugin_manager [2026/02/01 18:48] (current) – [Plugin Manager] mightymcoder
Line 9: Line 9:
 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:
   * [[en:entwickler:plugin_manager#naming_conventions|Naming conventions]]   * [[en:entwickler:plugin_manager#naming_conventions|Naming conventions]]
   * A consistent [[en:entwickler:plugin_manager#folder_structure|folder structure]]   * A consistent [[en:entwickler:plugin_manager#folder_structure|folder structure]]
-  * Use of the new plugin namespace //Plugins// +  * A [[en:entwickler:plugin_manager#plugin_preferences_class|preference presenter class]] with a [[en:entwickler:plugin_manager#single_formpresenter_element|single FormPresenter element]] or with [[en:entwickler:plugin_manager#multiple_formpresenter_elements|multiple FormPresenter elements]]
-  * A [[en:entwickler:plugin_manager#plugin_preferences_class|preference presenter class]]+
   * A [[en:entwickler:plugin_manager#plugin_class|plugin class]]   * A [[en:entwickler:plugin_manager#plugin_class|plugin class]]
   * A JSON [[en:entwickler:plugin_manager#configuration_file|configuration file]]   * A JSON [[en:entwickler:plugin_manager#configuration_file|configuration file]]
  
 ======= Naming conventions ======= ======= Naming conventions =======
-To use the new plugin namespace //Plugins// some naming conventions must be observed: +To use the new Plugin Manager some naming conventions must be observed: 
-  - No plugin folder or file may contain delimiters such as //"-"// or //"_"// especially if it will be used via a class import. For consistency only the optional folder //db_scripts// (see: [[en:entwickler:plugin_manager#folder_structure|folder structure]]) is exempt from this rule. +  - 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 CamelCase notation. +  - All folder and file names containing multiple words and are placed inside the //classes// folder should follow UpperCamelCase (PascalCase) notation. 
 +  - No plugin file defining a class may contain delimiters such as //"-"// or //"_"// especially if it will be used via a class import.
 ======= Folder structure ======= ======= Folder structure =======
 The basic folder structure of any plugin is shown below using the "Birthday" overview plugin as an example: The basic folder structure of any plugin is shown below using the "Birthday" overview plugin as an example:
Line 293: Line 293:
 <code php> <code php>
 <?php <?php
-use Plugins\Birthday\classes\Birthday;+use Birthday\classes\Birthday;
  
 /** /**
Line 333: Line 333:
 | "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. |
Line 340: Line 343:
 <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": {
  • en/entwickler/plugin_manager.1755793155.txt.gz
  • Last modified: 2025/08/21 18:19
  • by mightymcoder