Add new anonymous page hooks

- ADD_CSS_ANONYMOUS_PAGE
- ADD_JAVASCRIPT_ANONYMOUS_PAGE
- ADD_JAVASCRIPT_MODULE_ANONYMOUS_PAGE
- ADD_HEADER_TAG_ANONYMOUS
This commit is contained in:
Langlois Gaëtan
2024-12-19 22:03:21 +01:00
committed by GitHub
parent 115c355eb2
commit c9a7a4f412
4 changed files with 114 additions and 0 deletions

View File

@ -200,6 +200,31 @@ function plugin_init_example() {
],
];
// Add specific files to add to the header into anonymous page : javascript or css
$PLUGIN_HOOKS[Hooks::ADD_CSS_ANONYMOUS_PAGE]['example'] = 'example_anonymous.css';
$PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT_MODULE_ANONYMOUS_PAGE]['example'] = 'mymodule_anonymous.js';
$PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT_ANONYMOUS_PAGE]['example'] = 'example_anonymous.js';
// Add specific tags to the header into anonymous page
$PLUGIN_HOOKS[Hooks::ADD_HEADER_TAG_ANONYMOUS_PAGE]['example'] = [
[
'tag' => 'meta',
'properties' => [
'name' => 'robots',
'content' => 'noindex, nofollow',
]
],
[
'tag' => 'link',
'properties' => [
'rel' => 'alternate',
'type' => 'application/rss+xml',
'title' => 'The company RSS feed',
'href' => 'https://example.org/feed.xml',
]
],
];
// request more attributes from ldap
//$PLUGIN_HOOKS['retrieve_more_field_from_ldap']['example']="plugin_retrieve_more_field_from_ldap_example";