Pathologic was missing because of a .git folder inside.
[yaffs-website] / web / modules / contrib / redirect / redirect.api.php
1 <?php
2
3 /**
4  * @file
5  * Hooks provided by the Redirect module.
6  */
7
8 /**
9  * @defgroup redirect_api_hooks Redirect API Hooks
10  * @{
11  * During redirect operations (create, update, view, delete, etc.), there are
12  * several sets of hooks that get invoked to allow modules to modify the
13  * redirect operation:
14  * - All-module hooks: Generic hooks for "redirect" operations. These are
15  *   always invoked on all modules.
16  * - Entity hooks: Generic hooks for "entity" operations. These are always
17  *   invoked on all modules.
18  *
19  * Here is a list of the redirect and entity hooks that are invoked, and other
20  * steps that take place during redirect operations:
21  * - Creating a new redirect (calling redirect_save() on a new redirect):
22  *   - hook_redirect_presave() (all)
23  *   - Redirect written to the database
24  *   - hook_redirect_insert() (all)
25  *   - hook_entity_insert() (all)
26  * - Updating an existing redirect (calling redirect_save() on an existing redirect):
27  *   - hook_redirect_presave() (all)
28  *   - Redirect written to the database
29  *   - hook_redirect_update() (all)
30  *   - hook_entity_update() (all)
31  * - Loading a redirect (calling redirect_load(), redirect_load_multiple(), or
32  *   entity_load() with $entity_type of 'redirect'):
33  *   - Redirect information is read from database.
34  *   - hook_entity_load() (all)
35  *   - hook_redirect_load() (all)
36  * - Deleting a redirect (calling redirect_delete() or redirect_delete_multiple()):
37  *   - Redirect is loaded (see Loading section above)
38  *   - Redirect information is deleted from database
39  *   - hook_redirect_delete() (all)
40  *   - hook_entity_delete() (all)
41  * - Preparing a redirect for editing (note that if it's
42  *   an existing redirect, it will already be loaded; see the Loading section
43  *   above):
44  *   - hook_redirect_prepare() (all)
45  * - Validating a redirect during editing form submit (calling
46  *   redirect_form_validate()):
47  *   - hook_redirect_validate() (all)
48  * @}
49  */
50
51 /**
52  * @addtogroup hooks
53  * @{
54  */
55
56 /**
57  * Act on redirects being loaded from the database.
58  *
59  * This hook is invoked during redirect loading, which is handled by
60  * entity_load(), via classes RedirectController and
61  * DrupalDefaultEntityController. After the redirect information is read from
62  * the database or the entity cache, hook_entity_load() is invoked on all
63  * implementing modules, and then hook_redirect_load() is invoked on all
64  * implementing modules.
65  *
66  * This hook should only be used to add information that is not in the redirect
67  * table, not to replace information that is in that table (which could
68  * interfere with the entity cache). For performance reasons, information for
69  * all available redirects should be loaded in a single query where possible.
70  *
71  * The $types parameter allows for your module to have an early return (for
72  * efficiency) if your module only supports certain redirect types.
73  *
74  * @param $redirects
75  *   An array of the redirects being loaded, keyed by rid.
76  * @param $types
77  *   An array containing the types of the redirects.
78  *
79  * @ingroup redirect_api_hooks
80  */
81 function hook_redirect_load(array &$redirects, $types) {
82
83 }
84
85 /**
86  * Alter the list of redirects matching a certain source.
87  *
88  * @param $redirects
89  *   An array of redirect objects.
90  * @param $source
91  *   The source request path.
92  * @param $context
93  *   An array with the following key/value pairs:
94  *   - language: The language code of the source request.
95  *   - query: An array of the source request query string.
96  *
97  * @see redirect_load_by_source()
98  * @ingroup redirect_api_hooks
99  */
100 function hook_redirect_load_by_source_alter(array &$redirects, $source, array $context) {
101   foreach ($redirects as $rid => $redirect) {
102     if ($redirect->source !== $source) {
103       // If the redirects to do not exactly match $source (e.g. case
104       // insensitive matches), then remove them from the results.
105       unset($redirects[$rid]);
106     }
107   }
108 }
109
110 /**
111  * Act on a redirect object about to be shown on the add/edit form.
112  *
113  * This hook is invoked from redirect_create().
114  *
115  * @param $redirect
116  *   The redirect that is about to be shown on the add/edit form.
117  *
118  * @ingroup redirect_api_hooks
119  */
120 function hook_redirect_prepare($redirect) {
121
122 }
123
124 /**
125  * Act on a redirect being redirected.
126  *
127  * This hook is invoked from redirect_redirect() before the redirect callback
128  * is invoked.
129  *
130  * @param $redirect
131  *   The redirect that is being used for the redirect.
132  *
133  * @see redirect_redirect()
134  * @see drupal_page_is_cacheable()
135  * @ingroup redirect_api_hooks
136  */
137 function hook_redirect_alter($redirect) {
138 }
139
140 /**
141  * @} End of "addtogroup hooks".
142  */