-
Notifications
You must be signed in to change notification settings - Fork 8
Favs extended #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Favs extended #206
Changes from all commits
a41fa72
3b75b05
9e2cf7a
19b4dd7
9e704a2
6a877ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| {"php":"8.3.25","version":"3.64.0:v3.64.0#58dd9c931c785a79739310aef5178928305ffa67","indent":" ","lineEnding":"\n","rules":{"binary_operator_spaces":{"default":"at_least_single_space"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":true,"no_blank_lines_after_class_opening":true,"no_extra_blank_lines":{"tokens":["use"]},"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":true,"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","const_import","do","else","elseif","final","finally","for","foreach","function","function_import","if","insteadof","interface","namespace","new","private","protected","public","static","switch","trait","try","use","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"attribute_placement":"ignore","on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"single_quote":true,"trailing_comma_in_multiline":true},"hashes":{"fragments\/QuickNavigation\/Dropdown.php":"7cc52d767a1b8fa704e4d89c9a3e48a7","fragments\/QuickNavigation\/List.php":"e90ddecd29ce153eec1083841a3088e2","fragments\/QuickNavigation\/NoResult.php":"9b879a1abf902a8aa81cb9e6ce5d921a","fragments\/QuickNavigation\/MinibarList.php":"6c40eb3f991f48d730f45b8d222914b1","pages\/config.php":"cae53f73bf533cc8bb59dadf1cbdebe4","pages\/index.php":"daf2b1a819e7a27391553c599d053802","lib\/LinkMap\/QuickNavigationLinkMap.php":"3060d0975067e724f1dd427eadb02d47","lib\/Utility\/BuildNavigationArray.php":"d2a23cc394de4fd4e83bb34da8b3c0bc","lib\/Minibar\/ArticleHistoryElement.php":"fa606bdfb8e44afdcd46695f36b5d327","lib\/QuickNavigationApi.php":"4eabc25eae94790b9095085102dc278a","lib\/ApiFunction\/MenuRender.php":"fa555351a229780f110eba970ed42a59","lib\/ApiFunction\/MediaSearch.php":"04d4e816aa6766f1f2bf889482187287","lib\/Button\/FavoriteButton.php":"c8163f9adb12699453fe458de325515e","lib\/Button\/ButtonRegistry.php":"0ecf7951feeb0b3524fa1b8c92ac6288","lib\/Button\/YformButton.php":"cb3c1d7608735d18b5732b7425f3c14a","lib\/Button\/ArticleHistoryButton.php":"3851f59535b0647f184a5d706da08aba","lib\/Button\/ButtonInterface.php":"943bf3db82d39b6854401e16fe7e36b6","lib\/Button\/ArticleNavigationButton.php":"a81f2e97e73f235cba29ffcad4db1854","lib\/Button\/WatsonButton.php":"ef0d3641591e83b6e7dfec54008e36a8","lib\/Button\/CategoryButton.php":"3854696ad9b32dffad7d25d881fd2b18","lib\/Media\/MediaSorter.php":"4af98d56992a2e58b4d440ff1545af50","lib\/Media\/QuickNavigationMedia.php":"aa21d3042a12fc77d87e15ccb9c66319","lib\/QuickNavigation.php":"9a208b43632faa9d39923ff64c22f056","update.php":"d6e8377314743b0306a045ec165b99ea","boot.php":"85e4410621c51370487316f2c7de01b4"}} | ||
| {"php":"8.4.12","version":"3.64.0:v3.64.0#58dd9c931c785a79739310aef5178928305ffa67","indent":" ","lineEnding":"\n","rules":{"binary_operator_spaces":{"default":"at_least_single_space"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":true,"no_blank_lines_after_class_opening":true,"no_extra_blank_lines":{"tokens":["use"]},"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":true,"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","const_import","do","else","elseif","final","finally","for","foreach","function","function_import","if","insteadof","interface","namespace","new","private","protected","public","static","switch","trait","try","use","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"attribute_placement":"ignore","on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"single_quote":true,"trailing_comma_in_multiline":true},"hashes":{"update.php":"599fd370563dc5811b440c0ae86309d7","fragments\/QuickNavigation\/NoResult.php":"9b879a1abf902a8aa81cb9e6ce5d921a","fragments\/QuickNavigation\/MinibarList.php":"6c40eb3f991f48d730f45b8d222914b1","fragments\/QuickNavigation\/List.php":"e90ddecd29ce153eec1083841a3088e2","fragments\/QuickNavigation\/Dropdown.php":"7cc52d767a1b8fa704e4d89c9a3e48a7","lib\/QuickNavigationApi.php":"4eabc25eae94790b9095085102dc278a","lib\/ApiFunction\/MenuRender.php":"fa555351a229780f110eba970ed42a59","lib\/ApiFunction\/MediaSearch.php":"04d4e816aa6766f1f2bf889482187287","lib\/QuickNavigation.php":"9a208b43632faa9d39923ff64c22f056","lib\/Minibar\/ArticleHistoryElement.php":"fa606bdfb8e44afdcd46695f36b5d327","lib\/Button\/ArticleNavigationButton.php":"a81f2e97e73f235cba29ffcad4db1854","lib\/Button\/YformButton.php":"cb3c1d7608735d18b5732b7425f3c14a","lib\/Button\/ButtonInterface.php":"943bf3db82d39b6854401e16fe7e36b6","lib\/Button\/ButtonRegistry.php":"0ecf7951feeb0b3524fa1b8c92ac6288","lib\/Button\/WatsonButton.php":"ef0d3641591e83b6e7dfec54008e36a8","lib\/Button\/ArticleHistoryButton.php":"3851f59535b0647f184a5d706da08aba","lib\/Button\/FavoriteButton.php":"c8163f9adb12699453fe458de325515e","lib\/Button\/CategoryButton.php":"3854696ad9b32dffad7d25d881fd2b18","lib\/LinkMap\/QuickNavigationLinkMap.php":"3060d0975067e724f1dd427eadb02d47","lib\/Utility\/BuildNavigationArray.php":"d2a23cc394de4fd4e83bb34da8b3c0bc","lib\/Media\/QuickNavigationMedia.php":"aa21d3042a12fc77d87e15ccb9c66319","lib\/Media\/MediaSorter.php":"4af98d56992a2e58b4d440ff1545af50","boot.php":"85e4410621c51370487316f2c7de01b4","pages\/index.php":"daf2b1a819e7a27391553c599d053802","pages\/config.php":"cae53f73bf533cc8bb59dadf1cbdebe4"}} |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,10 +7,14 @@ | |||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| <ul> | ||||||||||||||||||||||||||||||
| <?php foreach($this->getVar('listItems', []) as $listItem): ?> | ||||||||||||||||||||||||||||||
| <?php if (str_contains($listItem, 'quick-navigation-section-header') || str_contains($listItem, 'quick-navigation-section-divider')): ?> | ||||||||||||||||||||||||||||||
| <?= $listItem ?> | ||||||||||||||||||||||||||||||
| <?php else: ?> | ||||||||||||||||||||||||||||||
| <li> | ||||||||||||||||||||||||||||||
| <div class="quick-navigation-item"> | ||||||||||||||||||||||||||||||
| <?= $listItem ?> | ||||||||||||||||||||||||||||||
|
Comment on lines
+10
to
15
|
||||||||||||||||||||||||||||||
| <?php if (str_contains($listItem, 'quick-navigation-section-header') || str_contains($listItem, 'quick-navigation-section-divider')): ?> | |
| <?= $listItem ?> | |
| <?php else: ?> | |
| <li> | |
| <div class="quick-navigation-item"> | |
| <?= $listItem ?> | |
| <?php if ($listItem['type'] === 'header'): ?> | |
| <?= $listItem['content'] ?> | |
| <?php elseif ($listItem['type'] === 'divider'): ?> | |
| <?= $listItem['content'] ?> | |
| <?php else: ?> | |
| <li> | |
| <div class="quick-navigation-item"> | |
| <?= $listItem['content'] ?> |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -21,6 +21,9 @@ quick_navigation_favorite = Favoriten | |||
| quick_navigation_manage_favorite = Favoriten anlegen | ||||
| quick_navigation_favorite_article_add = Artikel hinzufügen in: | ||||
| quick_navigation_favorite_category_add = Kategorie hinzufügen in: | ||||
| quick_navigation_addon_pages = AddOn-Seiten | ||||
| quick_navigation_structure_favs = Struktur | ||||
| quick_navigation_addon_pages_selection = AddOn-Seiten Favoriten | ||||
| quick_navigation_yform = YForm | ||||
| quick_navigation_yform_add = Datensatz hinzufügen in: | ||||
|
|
||||
|
|
@@ -35,3 +38,13 @@ quick_navigation_media_live_search_placeholder = Live-Suche... | |||
|
|
||||
| # Live Search | ||||
| quick_navigation_media_live_search_placeholder = Live-Suche... | ||||
|
||||
| quick_navigation_media_live_search_placeholder = Live-Suche... |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,38 +2,103 @@ | |||||||||||||||||||
|
|
||||||||||||||||||||
| namespace FriendsOfRedaxo\QuickNavigation\Button; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| use rex; | ||||||||||||||||||||
| use rex_addon; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| class ButtonRegistry | ||||||||||||||||||||
| { | ||||||||||||||||||||
| /** | ||||||||||||||||||||
| * @var array<array{instance: mixed, priority: int}> an array that contains button instances and their priorities | ||||||||||||||||||||
| * @var array<array{id: string, label: string, instance: mixed, priority: int}> an array that contains button instances and their priorities | ||||||||||||||||||||
| */ | ||||||||||||||||||||
| protected static array $buttons = []; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| /** | ||||||||||||||||||||
| * Registers a button with an optional priority. | ||||||||||||||||||||
| * Lower priority values cause the button to appear earlier in the list. | ||||||||||||||||||||
| * | ||||||||||||||||||||
| * @param string $id Unique identifier for the button (e.g. 'article_navigation', 'watson') | ||||||||||||||||||||
| * @param string $label Human readable label for config (e.g. 'Artikelnavigation', 'Watson') | ||||||||||||||||||||
| */ | ||||||||||||||||||||
| public static function registerButton(ButtonInterface $buttonInstance, int $priority = 10): void | ||||||||||||||||||||
| public static function registerButton(ButtonInterface $buttonInstance, int $priority = 10, string $id = '', string $label = ''): void | ||||||||||||||||||||
| { | ||||||||||||||||||||
| self::$buttons[] = ['instance' => $buttonInstance, 'priority' => $priority]; | ||||||||||||||||||||
| // Generate ID from class name if not provided | ||||||||||||||||||||
| if ($id === '') { | ||||||||||||||||||||
| $className = get_class($buttonInstance); | ||||||||||||||||||||
| $id = strtolower(str_replace('Button', '', substr($className, strrpos($className, '\\') + 1))); | ||||||||||||||||||||
|
||||||||||||||||||||
| $id = strtolower(str_replace('Button', '', substr($className, strrpos($className, '\\') + 1))); | |
| // Use fully qualified class name, replace \ with _, strip 'Button' suffix, and lowercase | |
| $id = strtolower( | |
| preg_replace( | |
| '/button$/i', | |
| '', | |
| str_replace('\\', '_', $className) | |
| ) | |
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The
.quick-navigation-section-dividerclass is defined but set todisplay: none;. This suggests it's not currently being used. Consider removing this unused CSS rule or documenting why it's kept for future use.