@@ -251,13 +251,12 @@ function plugin_init_glpiinventory()
251251 || str_ends_with ($ current_url , "front/printer.form.php " )
252252 || str_ends_with ($ current_url , "front/computer.form.php " )
253253 ) {
254- $ PLUGIN_HOOKS [Hooks::ADD_CSS ]['glpiinventory ' ][] = "css/views.css " ;
255- $ PLUGIN_HOOKS [Hooks::ADD_CSS ]['glpiinventory ' ][] = "css/deploy.css " ;
256-
254+ $ PLUGIN_HOOKS [Hooks::ADD_CSS ]['glpiinventory ' ][] = "css/views " . ($ debug_mode || !file_exists (__DIR__ . '/public/css/views.min.css ' ) ? "" : ".min " ) . ".css " ;
255+ $ PLUGIN_HOOKS [Hooks::ADD_CSS ]['glpiinventory ' ][] = "css/deploy " . ($ debug_mode || !file_exists (__DIR__ . '/public/css/deploy.min.css ' ) ? "" : ".min " ) . ".css " ;
257256 $ PLUGIN_HOOKS [Hooks::ADD_JAVASCRIPT ]['glpiinventory ' ][] = "lib/d3/d3 " . ($ debug_mode ? "" : ".min " ) . ".js " ;
258257 }
259258 if (plugin_glpiinventory_script_endswith ("timeslot.form.php " )) {
260- $ PLUGIN_HOOKS [Hooks::ADD_JAVASCRIPT ]['glpiinventory ' ][] = "lib/timeslot " . ($ debug_mode ? "" : ".min " ) . ".js " ;
259+ $ PLUGIN_HOOKS [Hooks::ADD_JAVASCRIPT ]['glpiinventory ' ][] = "lib/timeslot " . ($ debug_mode || ! file_exists ( __DIR__ . ' /public/lib/timeslot.min.js ' ) ? "" : ".min " ) . ".js " ;
261260 }
262261 if (plugin_glpiinventory_script_endswith ("deploypackage.form.php " )) {
263262 $ PLUGIN_HOOKS [Hooks::ADD_CSS ]['glpiinventory ' ][] = "lib/extjs/resources/css/ext-all.css " ;
@@ -266,17 +265,17 @@ function plugin_init_glpiinventory()
266265 $ PLUGIN_HOOKS [Hooks::ADD_JAVASCRIPT ]['glpiinventory ' ][] = "lib/REDIPS_drag/redips-drag " . ($ debug_mode ? "-source " : "-min " ) . ".js " ;
267266 $ PLUGIN_HOOKS [Hooks::ADD_JAVASCRIPT ]['glpiinventory ' ][] = "lib/REDIPS_drag/drag_table_rows.js " ;
268267 $ PLUGIN_HOOKS [Hooks::ADD_JAVASCRIPT ]['glpiinventory ' ][] = "lib/plusbutton " . ($ debug_mode ? "" : ".min " ) . ".js " ;
269- $ PLUGIN_HOOKS [Hooks::ADD_JAVASCRIPT ]['glpiinventory ' ][] = "lib/deploy_editsubtype " . ($ debug_mode ? "" : ".min " ) . ".js " ;
268+ $ PLUGIN_HOOKS [Hooks::ADD_JAVASCRIPT ]['glpiinventory ' ][] = "lib/deploy_editsubtype " . ($ debug_mode || ! file_exists ( __DIR__ . ' /public/lib/deploy_editsubtype.min.js ' ) ? "" : ".min " ) . ".js " ;
270269 }
271270 if (plugin_glpiinventory_script_endswith ("task.form.php " )
272271 || plugin_glpiinventory_script_endswith ("taskjob.php " )
273272 || plugin_glpiinventory_script_endswith ("iprange.form.php " )) {
274273 $ PLUGIN_HOOKS [Hooks::ADD_JAVASCRIPT ]['glpiinventory ' ][] = "lib/lazy.js-0.5.1/lazy " . ($ debug_mode ? "" : ".min " ) . ".js " ;
275274 $ PLUGIN_HOOKS [Hooks::ADD_JAVASCRIPT ]['glpiinventory ' ][] = "lib/mustache.js-2.3.0/mustache " . ($ debug_mode ? "" : ".min " ) . ".js " ;
276- $ PLUGIN_HOOKS [Hooks::ADD_JAVASCRIPT ]['glpiinventory ' ][] = "js/taskjobs " . ($ debug_mode || !file_exists (' js/taskjobs.min.js ' ) ? "" : ".min " ) . ".js " ;
275+ $ PLUGIN_HOOKS [Hooks::ADD_JAVASCRIPT ]['glpiinventory ' ][] = "js/taskjobs " . ($ debug_mode || !file_exists (__DIR__ . ' /public/ js/taskjobs.min.js ' ) ? "" : ".min " ) . ".js " ;
277276 }
278277 if (plugin_glpiinventory_script_endswith ("menu.php " )) {
279- $ PLUGIN_HOOKS [Hooks::ADD_JAVASCRIPT ]['glpiinventory ' ][] = "js/stats " . ($ debug_mode || !file_exists (' js/stats.min.js ' ) ? "" : ".min " ) . ".js " ;
278+ $ PLUGIN_HOOKS [Hooks::ADD_JAVASCRIPT ]['glpiinventory ' ][] = "js/stats " . ($ debug_mode || !file_exists (__DIR__ . ' /public/ js/stats.min.js ' ) ? "" : ".min " ) . ".js " ;
280279 }
281280
282281 if (
@@ -320,13 +319,13 @@ function plugin_init_glpiinventory()
320319 if ($ pfDeployPackage ->canUserDeploySelf ()) {
321320 $ PLUGIN_HOOKS [Hooks::HELPDESK_MENU_ENTRY ]['glpiinventory ' ] = '/front/deploypackage.public.php ' ;
322321 $ PLUGIN_HOOKS [Hooks::HELPDESK_MENU_ENTRY_ICON ]['glpiinventory ' ] = 'ti ti-package ' ;
323- $ PLUGIN_HOOKS [Hooks::ADD_CSS ]['glpiinventory ' ][] = "css/views.css " ;
322+ $ PLUGIN_HOOKS [Hooks::ADD_CSS ]['glpiinventory ' ][] = "css/views " . ( $ debug_mode || ! file_exists ( __DIR__ . ' /public/css/views.min.css ' ) ? "" : " .min " ) . " .css " ;
324323 }
325324 }
326325
327326 // load task view css for computer self deploy (tech)
328327 if (str_ends_with ($ current_url , "front/computer.form.php " )) {
329- $ PLUGIN_HOOKS [Hooks::ADD_CSS ]['glpiinventory ' ][] = "css/views.css " ;
328+ $ PLUGIN_HOOKS [Hooks::ADD_CSS ]['glpiinventory ' ][] = "css/views " . ( $ debug_mode || ! file_exists ( __DIR__ . ' /public/css/views.min.css ' ) ? "" : " .min " ) . " .css " ;
330329 }
331330
332331 if (isset ($ _SESSION ["glpiname " ])) {
@@ -350,7 +349,7 @@ function plugin_init_glpiinventory()
350349 $ PLUGIN_HOOKS [Hooks::ADD_CSS ]['glpiinventory ' ] = array_merge (
351350 $ PLUGIN_HOOKS [Hooks::ADD_CSS ]['glpiinventory ' ],
352351 [
353- "lib/nvd3/nv.d3.css " ,
352+ "lib/nvd3/nv.d3.min. css " ,
354353 ]
355354 );
356355 }
0 commit comments