diff --git a/css/login.base.css b/css/login.base.css deleted file mode 100644 index 6f86054..0000000 --- a/css/login.base.css +++ /dev/null @@ -1,11 +0,0 @@ -#logo_login { - background: none; - margin: 0; - padding: 38px 0; - text-align: center; -} - -#logo_login img { - display: block; - margin: 0 auto; -} diff --git a/front/internal.css.php b/front/internal.css.php index e7c7224..9853530 100644 --- a/front/internal.css.php +++ b/front/internal.css.php @@ -10,7 +10,7 @@ if (isset($_SESSION['glpi_currentpage']) && strpos($_SESSION['glpi_currentpage'] // Redirect if is a not cached URL if (!isset($_GET['_'])) { - $timestamp = PluginButterflyToolbox::getTimestamp(); + $timestamp = \GlpiPlugin\Butterfly\Toolbox::getTimestamp(); // Disable cache and redirect to cached URL header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); @@ -29,29 +29,29 @@ if (!isset($_GET['_'])) { $name = 'internal'; $css = ""; -$picture = PluginButterflyConfig::getConfig("{$name}_picture", ''); +$picture = \GlpiPlugin\Butterfly\Config::getConfig("{$name}_picture", ''); if ($picture) { $css .= ".page .glpi-logo {"; - $css .= " width: " . PluginButterflyConfig::getConfig("{$name}_picture_width", '100px') . " !important;"; - $css .= " height: " . PluginButterflyConfig::getConfig("{$name}_picture_height", '55px') . " !important;"; + $css .= " width: " . \GlpiPlugin\Butterfly\Config::getConfig("{$name}_picture_width", '100px') . " !important;"; + $css .= " height: " . \GlpiPlugin\Butterfly\Config::getConfig("{$name}_picture_height", '55px') . " !important;"; $css .= " background-size: contain !important;"; $css .= " background-repeat: no-repeat !important;"; $css .= " background-position: center !important;"; - $css .= " background-image: url(\"" . PluginButterflyToolbox::getPictureUrl($picture) . "\") !important;"; + $css .= " background-image: url(\"" . \GlpiPlugin\Butterfly\Toolbox::getPictureUrl($picture) . "\") !important;"; $css .= "}"; } -$css_type = PluginButterflyConfig::getConfig("{$name}_css_type", 'scss'); -$css_custom = PluginButterflyConfig::getConfig("{$name}_css_custom", ''); +$css_type = \GlpiPlugin\Butterfly\Config::getConfig("{$name}_css_type", 'scss'); +$css_custom = \GlpiPlugin\Butterfly\Config::getConfig("{$name}_css_custom", ''); $css_custom = html_entity_decode($css_custom); -if ($css_type === 'scss' && $css_custom && PluginButterflyScss::hasScssSuport()) { +if ($css_type === 'scss' && $css_custom && \GlpiPlugin\Butterfly\Scss::hasScssSuport()) { try { $variables = []; - $variables['butterfly_timestamp'] = PluginButterflyToolbox::getTimestamp(); + $variables['butterfly_timestamp'] = \GlpiPlugin\Butterfly\Toolbox::getTimestamp(); - $css .= PluginButterflyScss::compileScss($css_custom, $variables); + $css .= \GlpiPlugin\Butterfly\Scss::compileScss($css_custom, $variables); } catch (\Throwable $th) { // Log error safely - check if ErrorHandler class exists $errorHandlerClass = '\Glpi\Application\ErrorHandler'; diff --git a/front/internal.js.php b/front/internal.js.php index 8874598..9c37b81 100644 --- a/front/internal.js.php +++ b/front/internal.js.php @@ -10,7 +10,7 @@ if (isset($_SESSION['glpi_currentpage']) && strpos($_SESSION['glpi_currentpage'] // Redirect if is a not cached URL if (!isset($_GET['_'])) { - $timestamp = PluginButterflyToolbox::getTimestamp(); + $timestamp = \GlpiPlugin\Butterfly\Toolbox::getTimestamp(); // Disable cache and redirect to cached URL header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); @@ -47,16 +47,16 @@ if (false) { $('link[href*="butterfly/front/internal.css.php"]').appendTo($('head')) var $icon = $('link[rel*=icon]'); $icon.attr('type', null); $icon.attr('href', ); var $title = $('title'); @@ -65,8 +65,8 @@ if (false) { $('a[id^=show_about_modal_]').hide(); diff --git a/front/picture.send.php b/front/picture.send.php index 51a8cdb..5615148 100644 --- a/front/picture.send.php +++ b/front/picture.send.php @@ -26,9 +26,9 @@ if ($path === '') { } if ($theme !== '') { - $baseDir = PluginButterflyTheme::getThemeFolder() . '/' . $theme; + $baseDir = \GlpiPlugin\Butterfly\Theme::getThemeFolder() . '/' . $theme; } else { - $baseDir = PluginButterflyToolbox::getStorageBasePath(); + $baseDir = \GlpiPlugin\Butterfly\Toolbox::getStorageBasePath(); } $fullPath = $baseDir . '/' . ltrim($path, '/'); diff --git a/hook.php b/hook.php index bf0351b..230d1bf 100644 --- a/hook.php +++ b/hook.php @@ -10,26 +10,20 @@ function plugin_butterfly_display_login() { $themeInfo = null; if ($requestedTheme) { - $themeInfo = PluginButterflyTheme::getThemeInfo($requestedTheme); + $themeInfo = \GlpiPlugin\Butterfly\Theme::getThemeInfo($requestedTheme); } if (!$themeInfo) { - $theme = PluginButterflyConfig::getConfig("login_theme", ''); - $themeInfo = PluginButterflyTheme::getThemeInfo($theme); + $theme = \GlpiPlugin\Butterfly\Config::getConfig("login_theme", ''); + $themeInfo = \GlpiPlugin\Butterfly\Theme::getThemeInfo($theme); } - $loginPicture = PluginButterflyConfig::getConfig('login_picture'); + $loginPicture = \GlpiPlugin\Butterfly\Config::getConfig('login_picture'); if (!$loginPicture && $themeInfo && !empty($themeInfo['login-logo'])) { $loginPicture = $themeInfo['login-logo'] . '&theme=' . $themeInfo['id']; } - if ($loginPicture && version_compare(GLPI_VERSION, '9.5.0', '<')) { - echo Html::css("/plugins/butterfly/css/login.base.css", [ - 'version' => PLUGIN_BUTTERFLY_VERSION, - ]); - } - - $loginCss = PluginButterflyScss::getLoginCSS($requestedTheme); + $loginCss = \GlpiPlugin\Butterfly\Scss::getLoginCSS($requestedTheme); if (!empty($loginCss)) { echo ""; } @@ -37,9 +31,9 @@ function plugin_butterfly_display_login() { ?>