Updates register plugin's docs

main
Yasen Pramatarov 2026-01-20 10:05:47 +02:00
parent 80aaa0cab6
commit 58c2651796
2 changed files with 42 additions and 3 deletions

View File

@ -44,16 +44,55 @@ Enable/disable registration in `totalmeet.conf.php`:
## Implementation ## Implementation
Uses simple callable dispatcher pattern for single-action plugin: Uses callable dispatcher pattern with procedural handler functions:
```php ```php
register_plugin_route_prefix('register', [ register_plugin_route_prefix('register', [
'dispatcher' => function($context) { 'dispatcher' => function($action, array $context = []) {
require_once PLUGIN_REGISTER_PATH . 'controllers/register.php'; require_once PLUGIN_REGISTER_PATH . 'controllers/register.php';
if (function_exists('register_plugin_handle_register')) {
return register_plugin_handle_register($action, $context);
}
return false;
}, },
'access' => 'public', 'access' => 'public',
'defaults' => ['action' => 'register'],
'plugin' => 'register',
]); ]);
``` ```
## Controller Architecture
The controller uses procedural functions:
- `register_plugin_handle_register($action, $context)` - main handler
- `register_plugin_handle_submission(...)` - processes form submission
- `register_plugin_render_form(...)` - renders registration form with layout
- `register_plugin_log_success(...)` - logs successful registration
## Database Tables
No plugin-specific tables. Uses core `user` and `user_meta` tables.
## Enable/Disable
The plugin is managed via the admin plugin management interface (stored in `settings` table).
When disabled, the registration route becomes unavailable.
## File Structure
```
plugins/register/
├── bootstrap.php # registers route with callable dispatcher
├── plugin.json # plugin metadata
├── README.md # this documentation
├── controllers/
│ └── register.php # procedural handler functions
├── models/
│ └── register.php # registration logic and validation
├── helpers.php # plugin helper wrapper
└── views/
└── form-register.php # registration form template
```
## Dependencies ## Dependencies
None - functions independently. None - functions independently.

View File

@ -1,5 +1,5 @@
{ {
"name": "Registration Plugin", "name": "Registration Plugin",
"version": "1.0.1", "version": "1.0.2",
"description": "Provides registration functionality as a plugin." "description": "Provides registration functionality as a plugin."
} }