aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <aledeg@users.noreply.github.com> 2025-10-02 09:33:53 -0400
committerGravatar GitHub <noreply@github.com> 2025-10-02 15:33:53 +0200
commit032316155c03ca1013644476b8f9413ba436b744 (patch)
treeb3315790d53f1c6ff1740cdf0fc9ac0e8e9393ca /lib/Minz
parent0eab229d5231a198e98f974ae84d54bcebb085a1 (diff)
Add a new hook in the UI (#8054)
* Add a new hook in the UI The new hook allows extension to add their own tool bar to navigate between entries. For instance, if the user wants less or more buttons that what's available by default. See #7912 See #7913 * add link data to ease navigation
Diffstat (limited to 'lib/Minz')
-rw-r--r--lib/Minz/HookType.php54
1 files changed, 28 insertions, 26 deletions
diff --git a/lib/Minz/HookType.php b/lib/Minz/HookType.php
index 0a9a311eb..0d96b8832 100644
--- a/lib/Minz/HookType.php
+++ b/lib/Minz/HookType.php
@@ -22,6 +22,7 @@ enum Minz_HookType: string {
case MenuAdminEntry = 'menu_admin_entry'; // function() -> string
case MenuConfigurationEntry = 'menu_configuration_entry'; // function() -> string
case MenuOtherEntry = 'menu_other_entry'; // function() -> string
+ case NavEntries = 'nav_entries'; // function() -> string
case NavMenu = 'nav_menu'; // function() -> string
case NavReadingModes = 'nav_reading_modes'; // function($readingModes = array) -> array | null
case PostUpdate = 'post_update'; // function(none) -> none
@@ -31,35 +32,36 @@ enum Minz_HookType: string {
public function signature(): Minz_HookSignature {
switch ($this) {
- case Minz_HookType::ApiMisc:
- case Minz_HookType::FreshrssInit:
- case Minz_HookType::FreshrssUserMaintenance:
- case Minz_HookType::PostUpdate:
+ case self::ApiMisc:
+ case self::FreshrssInit:
+ case self::FreshrssUserMaintenance:
+ case self::PostUpdate:
return Minz_HookSignature::NoneToNone;
- case Minz_HookType::BeforeLoginBtn:
- case Minz_HookType::MenuAdminEntry:
- case Minz_HookType::MenuConfigurationEntry:
- case Minz_HookType::MenuOtherEntry:
- case Minz_HookType::NavMenu:
+ case self::BeforeLoginBtn:
+ case self::MenuAdminEntry:
+ case self::MenuConfigurationEntry:
+ case self::MenuOtherEntry:
+ case self::NavEntries:
+ case self::NavMenu:
return Minz_HookSignature::NoneToString;
- case Minz_HookType::CheckUrlBeforeAdd:
- case Minz_HookType::EntryBeforeDisplay:
- case Minz_HookType::EntryBeforeInsert:
- case Minz_HookType::EntryBeforeAdd:
- case Minz_HookType::EntryBeforeUpdate:
- case Minz_HookType::FeedBeforeActualize:
- case Minz_HookType::FeedBeforeInsert:
- case Minz_HookType::JsVars:
- case Minz_HookType::NavReadingModes:
- case Minz_HookType::ViewModes:
+ case self::CheckUrlBeforeAdd:
+ case self::EntryBeforeDisplay:
+ case self::EntryBeforeInsert:
+ case self::EntryBeforeAdd:
+ case self::EntryBeforeUpdate:
+ case self::FeedBeforeActualize:
+ case self::FeedBeforeInsert:
+ case self::JsVars:
+ case self::NavReadingModes:
+ case self::ViewModes:
return Minz_HookSignature::OneToOne;
- case Minz_HookType::CustomFaviconBtnUrl:
- case Minz_HookType::CustomFaviconHash:
- case Minz_HookType::EntriesFavorite:
- case Minz_HookType::EntryAutoRead:
- case Minz_HookType::EntryAutoUnread:
- case Minz_HookType::SimplepieAfterInit:
- case Minz_HookType::SimplepieBeforeInit:
+ case self::CustomFaviconBtnUrl:
+ case self::CustomFaviconHash:
+ case self::EntriesFavorite:
+ case self::EntryAutoRead:
+ case self::EntryAutoUnread:
+ case self::SimplepieAfterInit:
+ case self::SimplepieBeforeInit:
return Minz_HookSignature::PassArguments;
default:
throw new \RuntimeException('The hook is not configured!');