-
Notifications
You must be signed in to change notification settings - Fork 2
/
ext_localconf.php
59 lines (40 loc) · 2.42 KB
/
ext_localconf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* PbNotifications
*/
use PeterBenke\PbNotifications\Backend\ToolbarItems\NotificationsToolbarItem;
defined('TYPO3') or die();
/*
Procedure for Ajax
================================================================================
See also: https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Backend/Ajax.html
- /Configuration/JavaScriptModules.php
=> register javascript directory 'EXT:pb_notifications/Resources/Public/JavaScript/'
- /Configuration/Backend/AjaxRoutes.php
=> register the routes for ajax 'pb_notifications_menu_item' and 'pb_notifications_menu'
=> used in /Resources/Public/JavaScript/Toolbar/NotificationsMenu.js
- /ext_localconf.php
=> register the hook (NotificationsToolbarItem->updateMenuHook())
- /Classes/Backend/ToolbarItems/NotificationsToolbarItem.php
=> Add the function updateMenuHook() to create the action 'peterbenke:pbnotifications:updateRequested'
=> Add the javascript NotificationsMenu.js in constructor
- /Resources/Public/JavaScript/Toolbar/NotificationsMenu.js
=> Listen to event 'peterbenke:pbnotifications:updateRequested' and call the ajax function
- /Classes/Controller/Backend/NotificationController.php
=> Add the functions renderMenuItem() and renderMenu() to update the menu item and the menu, defined in AjaxRoutes.php
Procedure for Modal after login
================================================================================
See also:
https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Events/Events/Backend/AfterBackendPageRenderEvent.html
https://docs.typo3.org/m/typo3/reference-coreapi/12.4/en-us/ApiOverview/Backend/JavaScript/Modules/Modals.html
https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Breaking-98288-UpdatedBackendModalAPI.html
- /Configuration/Services.yaml
=> register the event listener 'pb-extension/after-backend-page-render'
- /Classes/EventListener/Backend/AfterBackendPageRender.php
=> Register javascript file Reminder.js
- /Resources/Public/JavaScript/Reminder/Reminder.js
=> Add the javascript to create the modal after login
*/
// Register update signal to update the number of notifications
// => /Classes/Backend/ToolbarItems/NotificationsToolbarItem.php->updateMenuHook()
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['updateSignalHook']['PbNotificationsToolbar::updateMenu'] = NotificationsToolbarItem::class . '->updateMenuHook';