Move front-end assets to be compatible with GLPI 11.0

This commit is contained in:
Cédric Anne 2024-12-03 14:43:53 +01:00
parent 115c355eb2
commit 478423a03b
5 changed files with 38 additions and 4 deletions

View File

@ -26,4 +26,4 @@
* -------------------------------------------------------------------------
*/
/* empty file */
/* empty CSS file */

View File

@ -26,4 +26,4 @@
* -------------------------------------------------------------------------
*/
/* empty file */
/* empty JS file */

View File

@ -0,0 +1,30 @@
/**
* -------------------------------------------------------------------------
* Example plugin for GLPI
* -------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of Example.
*
* Example is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Example is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Example. If not, see <http://www.gnu.org/licenses/>.
* -------------------------------------------------------------------------
* @copyright Copyright (C) 2006-2022 by Example plugin team.
* @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/pluginsGLPI/example
* -------------------------------------------------------------------------
*/
/* empty JS module file */
export {};

View File

@ -0,0 +1,3 @@
{
"type": "module"
}

View File

@ -177,8 +177,9 @@ function plugin_init_example() {
$PLUGIN_HOOKS['assign_to_ticket']['example'] = 1;
// Add specific files to add to the header : javascript or css
$PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['example'] = 'example.js';
$PLUGIN_HOOKS[Hooks::ADD_CSS]['example'] = 'example.css';
$PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT]['example'] = 'js/example.js';
$PLUGIN_HOOKS[Hooks::ADD_JAVASCRIPT_MODULE]['example'] = 'js/modules/mymodule.js';
$PLUGIN_HOOKS[Hooks::ADD_CSS]['example'] = 'css/example.css';
// Add specific tags to the header
$PLUGIN_HOOKS[Hooks::ADD_HEADER_TAG]['example'] = [