Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This essentially allows customization of back-end components using the theme folder that we already have for views/translations/icons. Using this you'll be able to hook into specific back-end events to add & modify functionality for your own use-case.
This system will look for a
functions.php
file within your configure theme, and run that during application boot. Within this file you could register event handlers.The events available, and their parameters and return options, will be documented within the codebase within a class that holds static references for the event names. This can be previewed here: https://github.com/BookStackApp/BookStack/blob/backend_theme_system/app/Theming/ThemeEvents.php
Multiple event handlers could be added per event, but if a handler returns a non-null value then no further handlers will be called during that event emission. This allows return values of handlers to be used where required with relative ease.
The initial implementation will be considered unstable with the intention of being open to feedback, then in the future we'll deem this semi-stable, with the core event system being maintained but the event details being subject to change over BookStack releases as to limit core project maintenance and development burden.
Usage Examples
Todo
Example theme
functions.php
file