minor fixes in pagination and alertbox stuff

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-03-04 16:12:25 +01:00
parent 30d64973c3
commit 8256f31374
11 changed files with 110 additions and 66 deletions

View File

@@ -138,7 +138,7 @@ class UI
* @return \Twig\Environment
*/
public static function twig(): ?\Twig\Environment
{
{
return self::$twig;
}
@@ -191,11 +191,9 @@ class UI
} catch (\Exception $e) {
// whoops, template error
$errtpl = 'alert_nosession.html.twig';
/*
if (\Froxlor\CurrentUser::hasSession()) {
if (self::activeUserSession()) {
$errtpl = 'alert.html.twig';
}
*/
$edata = array(
'type' => "danger",
'heading' => "Template error",
@@ -241,6 +239,11 @@ class UI
return self::$userinfo;
}
public static function activeUserSession(): bool
{
return !empty(self::$userinfo);
}
public static function setLng($lng = array())
{
self::$lng = $lng;
@@ -269,14 +272,14 @@ class UI
}
}
/**
* returns an array of available themes
*
* @return array
* @throws \Exception
*/
/**
* returns an array of available themes
*
* @return array
* @throws \Exception
*/
public static function getThemes(): array
{
{
$themespath = \Froxlor\FileDir::makeCorrectDir(\Froxlor\Froxlor::getInstallDir() . '/templates/');
$themes_available = array();