diff options
| author | 2021-02-17 10:34:54 -0500 | |
|---|---|---|
| committer | 2021-02-17 16:34:54 +0100 | |
| commit | 787e8fa463a2a9d24876aa1040d90e43ba122e34 (patch) | |
| tree | 147e345bffeccd87186350e39385c3363fc46070 | |
| parent | 8961c7beac40ee8b2d5623e136d57eb32dc910e9 (diff) | |
Add user maintenance hooks (#3440)
The new hook allows to add maintenance extensions at the user level.
See #3398
| -rwxr-xr-x | app/actualize_script.php | 3 | ||||
| -rw-r--r-- | docs/en/developers/03_Backend/05_Extensions.md | 17 | ||||
| -rw-r--r-- | lib/Minz/ExtensionManager.php | 4 |
3 files changed, 16 insertions, 8 deletions
diff --git a/app/actualize_script.php b/app/actualize_script.php index 7df84b805..1e3514de7 100755 --- a/app/actualize_script.php +++ b/app/actualize_script.php @@ -72,6 +72,9 @@ foreach ($users as $user) { } FreshRSS_Auth::giveAccess(); + + Minz_ExtensionManager::callHook('freshrss_user_maintenance'); + $app->init(); notice('FreshRSS actualize ' . $user . '...'); echo $user, ' '; //Buffered diff --git a/docs/en/developers/03_Backend/05_Extensions.md b/docs/en/developers/03_Backend/05_Extensions.md index 62eaa5410..0c87793c9 100644 --- a/docs/en/developers/03_Backend/05_Extensions.md +++ b/docs/en/developers/03_Backend/05_Extensions.md @@ -330,15 +330,16 @@ The following events are available: * `entry_before_insert` (`function($entry) -> Entry | null`): will be executed when a feed is refreshed and new entries will be imported into the database. The new entry (instance of FreshRSS\_Entry) will be passed as parameter. * `feed_before_actualize` (`function($feed) -> Feed | null`): will be executed when a feed is updated. The feed (instance of FreshRSS\_Feed) will be passed as parameter. * `feed_before_insert` (`function($feed) -> Feed | null`): will be executed when a new feed is imported into the database. The new feed (instance of FreshRSS\_Feed) will be passed as parameter. -* `freshrss_init` (`function() -> none`): will be executed at the end of the initialization of FreshRSS, useful to initialize components or to do additional access checks -* `js_vars` (`function($vars = array) -> array | null`): will be executed if the `jsonVars` in the header will be generated -* `menu_admin_entry` (`function() -> string`): add an entry at the end of the "Administration" menu, the returned string must be valid HTML (e.g. `<li class="item active"><a href="url">New entry</a></li>`) -* `menu_configuration_entry` (`function() -> string`): add an entry at the end of the "Configuration" menu, the returned string must be valid HTML (e.g. `<li class="item active"><a href="url">New entry</a></li>`) -* `menu_other_entry` (`function() -> string`): add an entry at the end of the header dropdown menu (i.e. after the "About" entry), the returned string must be valid HTML (e.g. `<li class="item active"><a href="url">New entry</a></li>`) +* `freshrss_init` (`function() -> none`): will be executed at the end of the initialization of FreshRSS, useful to initialize components or to do additional access checks. +* `freshrss_user_maintenance` (`function() -> none`): will be executed for each user during the `actualize_script`, useful to run some maintenance tasks on the user. +* `js_vars` (`function($vars = array) -> array | null`): will be executed if the `jsonVars` in the header will be generated. +* `menu_admin_entry` (`function() -> string`): add an entry at the end of the "Administration" menu, the returned string must be valid HTML (e.g. `<li class="item active"><a href="url">New entry</a></li>`). +* `menu_configuration_entry` (`function() -> string`): add an entry at the end of the "Configuration" menu, the returned string must be valid HTML (e.g. `<li class="item active"><a href="url">New entry</a></li>`). +* `menu_other_entry` (`function() -> string`): add an entry at the end of the header dropdown menu (i.e. after the "About" entry), the returned string must be valid HTML (e.g. `<li class="item active"><a href="url">New entry</a></li>`). * `nav_menu` (`function() -> string`): will be executed if the navigation was built. -* `nav_reading_modes` (`function($reading_modes) -> array | null`): **TODO** add documentation -* `post_update` (`function(none) -> none`): **TODO** add documentation -* `simplepie_before_init` (`function($simplePie, $feed) -> none`): **TODO** add documentation +* `nav_reading_modes` (`function($reading_modes) -> array | null`): **TODO** add documentation. +* `post_update` (`function(none) -> none`): **TODO** add documentation. +* `simplepie_before_init` (`function($simplePie, $feed) -> none`): **TODO** add documentation. ### Writing your own configure.phtml diff --git a/lib/Minz/ExtensionManager.php b/lib/Minz/ExtensionManager.php index 2a68f8393..841d970dd 100644 --- a/lib/Minz/ExtensionManager.php +++ b/lib/Minz/ExtensionManager.php @@ -39,6 +39,10 @@ class Minz_ExtensionManager { 'list' => array(), 'signature' => 'NoneToNone', ), + 'freshrss_user_maintenance' => array( // function() -> none + 'list' => array(), + 'signature' => 'NoneToNone', + ), 'js_vars' => array( // function($vars = array) -> array | null 'list' => array(), 'signature' => 'OneToOne', |
