forked from fa/breadcrumb-the-shire
Each module can now ship its own i18n/ directory with translation files (default_de.json, default_en.json). At boot time, ModuleI18nLoader preloads core translations then merges module translations on top via Reflection into I18n::$strings — the t() helper stays unchanged. - Add i18nPath property to ModuleManifest - Add ModuleI18nLoader with Reflection-based preload - Extract 59 module-exclusive keys from core i18n into module files (notifications: 8, bookmarks: 41, addressbook: 10) - Expand TranslationKeysTest to scan modules/ and validate against merged core + module translations - Add ModuleI18nContractTest for per-module de/en parity and completeness Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
116 lines
3.9 KiB
PHP
116 lines
3.9 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Notifications module manifest.
|
|
*
|
|
* In-app notifications with bell icon, dropdown panel,
|
|
* event-driven creation, and scheduled cleanup.
|
|
*/
|
|
return [
|
|
'id' => 'notifications',
|
|
'version' => '1.0.0',
|
|
'enabled_by_default' => true,
|
|
'load_order' => 15,
|
|
'requires' => [],
|
|
|
|
'routes' => [
|
|
['path' => 'notifications/list-data', 'target' => 'notifications/list-data'],
|
|
['path' => 'notifications/mark-read-data', 'target' => 'notifications/mark-read-data'],
|
|
['path' => 'notifications/delete-data', 'target' => 'notifications/delete-data'],
|
|
['path' => 'notifications/unread-count-data', 'target' => 'notifications/unread-count-data'],
|
|
],
|
|
'public_paths' => [],
|
|
|
|
'container_registrars' => [
|
|
\MintyPHP\Module\Notifications\NotificationsContainerRegistrar::class,
|
|
],
|
|
|
|
'ui_slots' => [
|
|
'topbar.right_item' => [
|
|
[
|
|
'key' => 'notifications-bell',
|
|
'template' => 'templates/topbar-notification-bell.phtml',
|
|
'permission' => 'notifications.view',
|
|
'order' => 100,
|
|
],
|
|
],
|
|
'layout.head_style' => [
|
|
[
|
|
'key' => 'notifications-topbar-style',
|
|
'path' => 'modules/notifications/css/layout/app-topbar-notifications.css',
|
|
'permission' => 'notifications.view',
|
|
'order' => 100,
|
|
],
|
|
[
|
|
'key' => 'notifications-dropdown-style',
|
|
'path' => 'modules/notifications/css/components/app-notification-dropdown.css',
|
|
'permission' => 'notifications.view',
|
|
'order' => 101,
|
|
],
|
|
],
|
|
'runtime.component' => [
|
|
[
|
|
'key' => 'notification-bell',
|
|
'script' => 'modules/notifications/js/components/app-notification-bell.js',
|
|
'export' => 'initNotificationBell',
|
|
'scope' => 'global',
|
|
'config_path' => 'components.notificationBell',
|
|
'default_config' => [],
|
|
'phase' => 'late',
|
|
'permission' => 'notifications.view',
|
|
'order' => 100,
|
|
],
|
|
],
|
|
],
|
|
|
|
'authorization_policies' => [
|
|
\MintyPHP\Module\Notifications\NotificationsAuthorizationPolicy::class,
|
|
],
|
|
|
|
'permissions' => [
|
|
[
|
|
'key' => 'notifications.view',
|
|
'label' => 'Notifications: View',
|
|
'description' => 'View and manage own notifications',
|
|
],
|
|
],
|
|
|
|
'event_listeners' => [
|
|
'user.created' => [
|
|
['class' => \MintyPHP\Module\Notifications\Listeners\UserCreatedNotificationListener::class, 'method' => 'handle'],
|
|
],
|
|
'user.deleted' => [
|
|
['class' => \MintyPHP\Module\Notifications\Listeners\UserDeletedNotificationListener::class, 'method' => 'handle'],
|
|
],
|
|
],
|
|
|
|
'scheduler_jobs' => [
|
|
[
|
|
'job_key' => 'notifications_cleanup',
|
|
'handler' => \MintyPHP\Module\Notifications\Handler\NotificationCleanupJobHandler::class,
|
|
'label' => 'Notification cleanup',
|
|
'description' => 'Purges read notifications older than 90 days',
|
|
'default_enabled' => 1,
|
|
'default_timezone' => 'UTC',
|
|
'default_schedule_type' => 'daily',
|
|
'default_schedule_interval' => 1,
|
|
'default_schedule_time' => '04:00',
|
|
'default_schedule_weekdays_csv' => null,
|
|
'default_catchup_once' => 1,
|
|
'allowed_schedule_types' => ['daily', 'weekly'],
|
|
],
|
|
],
|
|
|
|
'layout_context_providers' => [
|
|
\MintyPHP\Module\Notifications\Providers\NotificationsLayoutProvider::class,
|
|
],
|
|
'session_providers' => [
|
|
\MintyPHP\Module\Notifications\Providers\NotificationsSessionProvider::class,
|
|
],
|
|
|
|
'search_resources' => [],
|
|
'asset_groups' => [],
|
|
'migrations_path' => 'db/updates',
|
|
'i18n_path' => 'i18n',
|
|
];
|