]> BookStack Code Mirror - bookstack/blob - app/Theming/ThemeEvents.php
Fixes padding issues of the sidebar's items
[bookstack] / app / Theming / ThemeEvents.php
1 <?php
2
3 namespace BookStack\Theming;
4
5 /**
6  * The ThemeEvents used within BookStack.
7  *
8  * This file details the events that BookStack may fire via the custom
9  * theme system, including event names, parameters and expected return types.
10  *
11  * This system is regarded as semi-stable.
12  * We'll look to fix issues with it or migrate old event types but
13  * events and their signatures may change in new versions of BookStack.
14  * We'd advise testing any usage of these events upon upgrade.
15  */
16 class ThemeEvents
17 {
18     /**
19      * Application boot-up.
20      * After main services are registered.
21      *
22      * @param \BookStack\Application $app
23      */
24     const APP_BOOT = 'app_boot';
25
26     /**
27      * Web before middleware action.
28      * Runs before the request is handled but after all other middleware apart from those
29      * that depend on the current session user (Localization for example).
30      * Provides the original request to use.
31      * Return values, if provided, will be used as a new response to use.
32      *
33      * @param \Illuminate\Http\Request $request
34      * @returns \Illuminate\Http\Response|null
35      */
36     const WEB_MIDDLEWARE_BEFORE = 'web_middleware_before';
37
38     /**
39      * Web after middleware action.
40      * Runs after the request is handled but before the response is sent.
41      * Provides both the original request and the currently resolved response.
42      * Return values, if provided, will be used as a new response to use.
43      *
44      * @param \Illuminate\Http\Request                                                      $request
45      * @param \Illuminate\Http\Response|Symfony\Component\HttpFoundation\BinaryFileResponse $response
46      * @returns \Illuminate\Http\Response|null
47      */
48     const WEB_MIDDLEWARE_AFTER = 'web_middleware_after';
49
50     /**
51      * Auth login event.
52      * Runs right after a user is logged-in to the application by any authentication
53      * system as a standard app user. This includes a user becoming logged in
54      * after registration. This is not emitted upon API usage.
55      *
56      * @param string               $authSystem
57      * @param \BookStack\Auth\User $user
58      */
59     const AUTH_LOGIN = 'auth_login';
60
61     /**
62      * Auth register event.
63      * Runs right after a user is newly registered to the application by any authentication
64      * system as a standard app user. This includes auto-registration systems used
65      * by LDAP, SAML and social systems. It only includes self-registrations.
66      *
67      * @param string               $authSystem
68      * @param \BookStack\Auth\User $user
69      */
70     const AUTH_REGISTER = 'auth_register';
71
72     /**
73      * Commonmark environment configure.
74      * Provides the commonmark library environment for customization
75      * before its used to render markdown content.
76      * If the listener returns a non-null value, that will be used as an environment instead.
77      *
78      * @param \League\CommonMark\ConfigurableEnvironmentInterface $environment
79      * @returns \League\CommonMark\ConfigurableEnvironmentInterface|null
80      */
81     const COMMONMARK_ENVIRONMENT_CONFIGURE = 'commonmark_environment_configure';
82 }