Skip to content
Code-Schnipsel Gruppen Projekte
Commit 67eedf58 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

Merge branch 'next' into 'master'

feat!: quiqqer v2

See merge request !25
Übergeordnete 8c378527 e0e0bf33
Branches 2.x
Tags 2.13.0
2 Merge Requests!34Update 'next-4.x' with latest changes from 'main',!25feat!: quiqqer v2
Pipeline #7411 bestanden mit Phase
in 1 Minute und 2 Sekunden
werden angezeigt mit 110 Ergänzungen und 86 Löschungen
tools/
phpstan.neon
.phpunit.result.cache
phpunit.xml
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="^1.10.67" installed="1.10.67" location="./tools/phpstan" copy="false"/>
</phive>
...@@ -12,13 +12,16 @@ ...@@ -12,13 +12,16 @@
* *
* @return array * @return array
*/ */
use QUI\Menu\Independent\Factory;
QUI::$Ajax->registerFunction( QUI::$Ajax->registerFunction(
'package_quiqqer_menu_ajax_backend_independent_create', 'package_quiqqer_menu_ajax_backend_independent_create',
function ($title, $workingTitle) { function ($title, $workingTitle) {
$title = json_decode($title, true); $title = json_decode($title, true);
$workingTitle = json_decode($workingTitle, true); $workingTitle = json_decode($workingTitle, true);
$Menu = \QUI\Menu\Independent\Factory::createMenu(); $Menu = Factory::createMenu();
$Menu->setTitle($title); $Menu->setTitle($title);
$Menu->setWorkingTitle($workingTitle); $Menu->setWorkingTitle($workingTitle);
$Menu->save(); $Menu->save();
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* This file contains package_quiqqer_menu_ajax_backend_independent_get * This file contains package_quiqqer_menu_ajax_backend_independent_get
*/ */
use QUI\Menu\Independent\Items\AbstractMenuItem;
QUI::$Ajax->registerFunction( QUI::$Ajax->registerFunction(
'package_quiqqer_menu_ajax_backend_independent_get', 'package_quiqqer_menu_ajax_backend_independent_get',
function ($id) { function ($id) {
...@@ -21,7 +23,7 @@ function parseChildren(&$data) ...@@ -21,7 +23,7 @@ function parseChildren(&$data)
continue; continue;
} }
/* @var $Item \QUI\Menu\Independent\Items\AbstractMenuItem */ /* @var $Item AbstractMenuItem */
$Item = new $entry['type']($entry); $Item = new $entry['type']($entry);
$icon = QUI\Menu\Independent\Items\Site::itemIcon(); // default $icon = QUI\Menu\Independent\Items\Site::itemIcon(); // default
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
/** /**
* Return the item name * Return the item name
*/ */
use QUI\Menu\Independent\Items\AbstractMenuItem;
QUI::$Ajax->registerFunction( QUI::$Ajax->registerFunction(
'package_quiqqer_menu_ajax_backend_independent_getItemName', 'package_quiqqer_menu_ajax_backend_independent_getItemName',
function ($item) { function ($item) {
...@@ -16,7 +19,7 @@ function ($item) { ...@@ -16,7 +19,7 @@ function ($item) {
return ''; return '';
} }
/* @var $Item \QUI\Menu\Independent\Items\AbstractMenuItem */ /* @var $Item AbstractMenuItem */
$Item = new $item['type']($item); $Item = new $item['type']($item);
return $Item->getName(); return $Item->getName();
}, },
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
/** /**
* Return the item name * Return the item name
*/ */
use QUI\Menu\Independent\Items\AbstractMenuItem;
QUI::$Ajax->registerFunction( QUI::$Ajax->registerFunction(
'package_quiqqer_menu_ajax_backend_independent_getItemTitle', 'package_quiqqer_menu_ajax_backend_independent_getItemTitle',
function ($item) { function ($item) {
...@@ -16,7 +19,7 @@ function ($item) { ...@@ -16,7 +19,7 @@ function ($item) {
return ''; return '';
} }
/* @var $Item \QUI\Menu\Independent\Items\AbstractMenuItem */ /* @var $Item AbstractMenuItem */
$Item = new $item['type']($item); $Item = new $item['type']($item);
return $Item->getTitle(); return $Item->getTitle();
}, },
......
{ {
"name": "quiqqer\/menu", "name": "quiqqer/menu",
"type": "quiqqer-module", "type": "quiqqer-module",
"description": "The Plugin menu provides various menu controls.", "description": "The Plugin menu provides various menu controls.",
"license": [ "license": [
...@@ -10,21 +10,21 @@ ...@@ -10,21 +10,21 @@
{ {
"name": "Henning Leutz", "name": "Henning Leutz",
"email": "leutz@pcsg.de", "email": "leutz@pcsg.de",
"homepage": "http:\/\/www.pcsg.de", "homepage": "https://www.pcsg.de",
"role": "Developer" "role": "Developer"
} }
], ],
"support": { "support": {
"email": "support@pcsg.de", "email": "support@pcsg.de",
"url": "http:\/\/www.pcsg.de" "url": "https://www.pcsg.de"
}, },
"require": { "require": {
"php": ">=5.3", "php": "^8.1",
"quiqqer\/quiqqer": "*@dev" "quiqqer/core": "^2"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"QUI\\Menu\\": "src\/QUI\/Menu" "QUI\\Menu\\": "src/QUI/Menu"
} }
} }
} }
\ No newline at end of file
includes:
- phpstan-baseline.neon
parameters:
level: 1
paths:
- src
- ajax
bootstrapFiles:
- tests/phpstan-bootstrap.php
\ No newline at end of file
...@@ -15,12 +15,12 @@ abstract class AbstractMenu extends QUI\Control ...@@ -15,12 +15,12 @@ abstract class AbstractMenu extends QUI\Control
/** /**
* @var string * @var string
*/ */
protected $append = ''; protected string $append = '';
/** /**
* @var string * @var string
*/ */
protected $prepend = ''; protected string $prepend = '';
/** /**
* append html to the menu * append html to the menu
...@@ -28,7 +28,7 @@ abstract class AbstractMenu extends QUI\Control ...@@ -28,7 +28,7 @@ abstract class AbstractMenu extends QUI\Control
* *
* @param string $html * @param string $html
*/ */
public function appendHTML($html) public function appendHTML(string $html): void
{ {
$this->append = $html; $this->append = $html;
} }
...@@ -39,7 +39,7 @@ public function appendHTML($html) ...@@ -39,7 +39,7 @@ public function appendHTML($html)
* *
* @param string $html * @param string $html
*/ */
public function prependHTML($html) public function prependHTML(string $html): void
{ {
$this->prepend = $html; $this->prepend = $html;
} }
......
...@@ -21,7 +21,7 @@ class FloatedNav extends QUI\Control ...@@ -21,7 +21,7 @@ class FloatedNav extends QUI\Control
* *
* @param array $attributes * @param array $attributes
*/ */
public function __construct($attributes = []) public function __construct(array $attributes = [])
{ {
// default options // default options
$this->setAttributes([ $this->setAttributes([
...@@ -60,7 +60,7 @@ public function __construct($attributes = []) ...@@ -60,7 +60,7 @@ public function __construct($attributes = [])
* *
* @see \QUI\Control::create() * @see \QUI\Control::create()
*/ */
public function getBody() public function getBody(): string
{ {
$Engine = QUI::getTemplateManager()->getEngine(); $Engine = QUI::getTemplateManager()->getEngine();
$LangSwitch = null; $LangSwitch = null;
...@@ -73,11 +73,8 @@ public function getBody() ...@@ -73,11 +73,8 @@ public function getBody()
return ''; return '';
} }
if (!$IndependentMenu) {
return '';
}
$showToggleButton = true; $showToggleButton = true;
switch ($this->getAttribute('showToggleButton')) { switch ($this->getAttribute('showToggleButton')) {
case 'always': case 'always':
$this->setJavaScriptControlOption('showtogglebutton', 'always'); $this->setJavaScriptControlOption('showtogglebutton', 'always');
...@@ -94,26 +91,15 @@ public function getBody() ...@@ -94,26 +91,15 @@ public function getBody()
break; break;
} }
switch ($this->getAttribute('size')) { $size = match ($this->getAttribute('size')) {
case 'small': 'small', 'medium', 'large' => 'quiqqer-floatedNavControl__size-' . $this->getAttribute('size'),
case 'medium': default => 'quiqqer-floatedNavControl__size-medium',
case 'large': };
$size = 'quiqqer-floatedNavControl__size-' . $this->getAttribute('size');
break;
default:
$size = 'quiqqer-floatedNavControl__size-medium';
}
switch ($this->getAttribute('design')) {
case 'flat':
$design = 'quiqqer-floatedNavControl__design-' . $this->getAttribute('design');
break;
case 'iconBar': $design = match ($this->getAttribute('design')) {
default: 'flat' => 'quiqqer-floatedNavControl__design-' . $this->getAttribute('design'),
$design = 'quiqqer-floatedNavControl__design-iconsBar'; default => 'quiqqer-floatedNavControl__design-iconsBar',
} };
switch ($this->getAttribute('posX')) { switch ($this->getAttribute('posX')) {
case 'left': case 'left':
...@@ -130,14 +116,10 @@ public function getBody() ...@@ -130,14 +116,10 @@ public function getBody()
} }
if ($this->getAttribute('showLangSwitch')) { if ($this->getAttribute('showLangSwitch')) {
try { $LangSwitch = new QUI\Bricks\Controls\LanguageSwitches\Flags([
$LangSwitch = new QUI\Bricks\Controls\LanguageSwitches\Flags([ 'showFlags' => 0,
'showFlags' => 0, 'class' => 'quiqqer-floatedNav-entry'
'class' => 'quiqqer-floatedNav-entry' ]);
]);
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeException($Exception);
}
} }
$animation = ''; $animation = '';
...@@ -187,7 +169,7 @@ public function getBody() ...@@ -187,7 +169,7 @@ public function getBody()
* *
* @return false|mixed|string * @return false|mixed|string
*/ */
public function getAnimationEasingName() public function getAnimationEasingName(): mixed
{ {
switch ($this->getAttribute('animationEasing')) { switch ($this->getAttribute('animationEasing')) {
case 'easeInQuad': case 'easeInQuad':
......
...@@ -21,7 +21,7 @@ class Tabs extends QUI\Control ...@@ -21,7 +21,7 @@ class Tabs extends QUI\Control
* *
* @param array $attributes * @param array $attributes
*/ */
public function __construct($attributes = []) public function __construct(array $attributes = [])
{ {
// default options // default options
$this->setAttributes([ $this->setAttributes([
...@@ -63,7 +63,7 @@ public function __construct($attributes = []) ...@@ -63,7 +63,7 @@ public function __construct($attributes = [])
* *
* @see \QUI\Control::create() * @see \QUI\Control::create()
*/ */
public function getBody() public function getBody(): string
{ {
$Engine = QUI::getTemplateManager()->getEngine(); $Engine = QUI::getTemplateManager()->getEngine();
$entries = $this->getAttribute('entries'); $entries = $this->getAttribute('entries');
...@@ -78,7 +78,7 @@ public function getBody() ...@@ -78,7 +78,7 @@ public function getBody()
continue; continue;
} }
array_push($enabledEntries, $entry); $enabledEntries[] = $entry;
} }
$active = 1; $active = 1;
......
...@@ -7,10 +7,18 @@ ...@@ -7,10 +7,18 @@
namespace QUI\Menu; namespace QUI\Menu;
use QUI; use QUI;
use QUI\Exception;
use QUI\Interfaces\Projects\Site;
use function array_filter;
use function dirname;
use function is_object;
use function md5;
use function serialize;
/** /**
* Class DropDownMenu * Class DropDownMenu
* Creates an Drop Down Menu * Creates a Drop-Down Menu
* *
* @package QUI\Menu * @package QUI\Menu
* @author www.pcsg.de (Henning Leutz) * @author www.pcsg.de (Henning Leutz)
...@@ -20,7 +28,7 @@ class DropDownMenu extends QUI\Control ...@@ -20,7 +28,7 @@ class DropDownMenu extends QUI\Control
/** /**
* @param array $attributes * @param array $attributes
*/ */
public function __construct($attributes = []) public function __construct(array $attributes = [])
{ {
$this->setAttribute('class', 'qui-menu-dropdown'); $this->setAttribute('class', 'qui-menu-dropdown');
$this->setAttribute('qui-class', 'package/quiqqer/menu/bin/DropDownMenu'); $this->setAttribute('qui-class', 'package/quiqqer/menu/bin/DropDownMenu');
...@@ -28,7 +36,7 @@ public function __construct($attributes = []) ...@@ -28,7 +36,7 @@ public function __construct($attributes = [])
parent::__construct($attributes); parent::__construct($attributes);
$this->addCSSFile(\dirname(__FILE__) . '/DropDownMenu.css'); $this->addCSSFile(dirname(__FILE__) . '/DropDownMenu.css');
} }
/** /**
...@@ -37,23 +45,23 @@ public function __construct($attributes = []) ...@@ -37,23 +45,23 @@ public function __construct($attributes = [])
* @return string * @return string
* @throws QUI\Exception * @throws QUI\Exception
*/ */
public function getBody() public function getBody(): string
{ {
$cache = EventHandler::menuCacheName() . '/dropDownMenu/'; $cache = EventHandler::menuCacheName() . '/dropDownMenu/';
$attributes = $this->getAttributes(); $attributes = $this->getAttributes();
$attributes = \array_filter($attributes, function ($entry) { $attributes = array_filter($attributes, function ($entry) {
return \is_object($entry) === false; return is_object($entry) === false;
}); });
$cache .= \md5( $cache .= md5(
$this->getSite()->getCachePath() . $this->getSite()->getCachePath() .
\serialize($attributes) serialize($attributes)
); );
try { try {
return QUI\Cache\Manager::get($cache); return QUI\Cache\Manager::get($cache);
} catch (QUI\Exception $Exception) { } catch (QUI\Exception) {
} }
$Engine = QUI::getTemplateManager()->getEngine(); $Engine = QUI::getTemplateManager()->getEngine();
...@@ -62,10 +70,10 @@ public function getBody() ...@@ -62,10 +70,10 @@ public function getBody()
'this' => $this, 'this' => $this,
'Site' => $this->getSite(), 'Site' => $this->getSite(),
'Project' => $this->getProject(), 'Project' => $this->getProject(),
'FileMenu' => \dirname(__FILE__) . '/DropDownMenu.Children.html' 'FileMenu' => dirname(__FILE__) . '/DropDownMenu.Children.html'
]); ]);
$result = $Engine->fetch(\dirname(__FILE__) . '/DropDownMenu.html'); $result = $Engine->fetch(dirname(__FILE__) . '/DropDownMenu.html');
QUI\Cache\Manager::set($cache, $result); QUI\Cache\Manager::set($cache, $result);
...@@ -75,9 +83,10 @@ public function getBody() ...@@ -75,9 +83,10 @@ public function getBody()
/** /**
* Return the current site * Return the current site
* *
* @return mixed|QUI\Projects\Site * @return Site
* @throws Exception
*/ */
protected function getSite() protected function getSite(): QUI\Interfaces\Projects\Site
{ {
if ($this->getAttribute('Site')) { if ($this->getAttribute('Site')) {
return $this->getAttribute('Site'); return $this->getAttribute('Site');
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
namespace QUI\Menu; namespace QUI\Menu;
use Exception;
use QUI; use QUI;
/** /**
...@@ -20,7 +21,7 @@ class Elastic extends QUI\Control ...@@ -20,7 +21,7 @@ class Elastic extends QUI\Control
/** /**
* @param array $attributes * @param array $attributes
*/ */
public function __construct($attributes = []) public function __construct(array $attributes = [])
{ {
parent::__construct($attributes); parent::__construct($attributes);
} }
...@@ -28,8 +29,9 @@ public function __construct($attributes = []) ...@@ -28,8 +29,9 @@ public function __construct($attributes = [])
/** /**
* @return string * @return string
* @throws QUI\Exception * @throws QUI\Exception
* @throws Exception
*/ */
public function getBody() public function getBody(): string
{ {
$Engine = QUI::getTemplateManager()->getEngine(); $Engine = QUI::getTemplateManager()->getEngine();
...@@ -48,8 +50,9 @@ public function getBody() ...@@ -48,8 +50,9 @@ public function getBody()
* Return the current site * Return the current site
* *
* @return mixed|QUI\Projects\Site * @return mixed|QUI\Projects\Site
* @throws QUI\Exception
*/ */
protected function getSite() protected function getSite(): mixed
{ {
if ($this->getAttribute('Site')) { if ($this->getAttribute('Site')) {
return $this->getAttribute('Site'); return $this->getAttribute('Site');
......
...@@ -25,7 +25,7 @@ public static function menuCacheName(): string ...@@ -25,7 +25,7 @@ public static function menuCacheName(): string
/** /**
* @param Site $Site * @param Site $Site
*/ */
public static function onSiteSave(Site $Site) public static function onSiteSave(Site $Site): void
{ {
QUI\Cache\Manager::clear(self::menuCacheName()); QUI\Cache\Manager::clear(self::menuCacheName());
} }
...@@ -35,7 +35,7 @@ public static function onSiteSave(Site $Site) ...@@ -35,7 +35,7 @@ public static function onSiteSave(Site $Site)
* *
* @return void * @return void
*/ */
public static function onProjectConfigSave() public static function onProjectConfigSave(): void
{ {
QUI\Cache\Manager::clear(self::menuCacheName()); QUI\Cache\Manager::clear(self::menuCacheName());
} }
...@@ -47,7 +47,7 @@ public static function onProjectConfigSave() ...@@ -47,7 +47,7 @@ public static function onProjectConfigSave()
* @param Smarty $Smarty * @param Smarty $Smarty
* @throws SmartyException * @throws SmartyException
*/ */
public static function onSmartyInit(Smarty $Smarty) public static function onSmartyInit(Smarty $Smarty): void
{ {
if ( if (
!isset($Smarty->registered_plugins['function']) !isset($Smarty->registered_plugins['function'])
...@@ -62,7 +62,7 @@ public static function onSmartyInit(Smarty $Smarty) ...@@ -62,7 +62,7 @@ public static function onSmartyInit(Smarty $Smarty)
* *
* @return void * @return void
*/ */
public static function onAdminLoadFooter() public static function onAdminLoadFooter(): void
{ {
$jsFile = URL_OPT_DIR . 'quiqqer/menu/bin/onAdminLoadFooter.js'; $jsFile = URL_OPT_DIR . 'quiqqer/menu/bin/onAdminLoadFooter.js';
echo '<script src="' . $jsFile . '" async></script>'; echo '<script src="' . $jsFile . '" async></script>';
...@@ -72,7 +72,7 @@ public static function onAdminLoadFooter() ...@@ -72,7 +72,7 @@ public static function onAdminLoadFooter()
* @param $menuId * @param $menuId
* @return void * @return void
*/ */
public static function onQuiqqerMenuIndependentClear($menuId) public static function onQuiqqerMenuIndependentClear($menuId): void
{ {
QUI\Cache\Manager::clear(self::menuCacheName()); QUI\Cache\Manager::clear(self::menuCacheName());
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace QUI\Menu\Independent; namespace QUI\Menu\Independent;
use Exception;
use QUI; use QUI;
/** /**
...@@ -29,7 +30,7 @@ public static function createMenu(): Menu ...@@ -29,7 +30,7 @@ public static function createMenu(): Menu
try { try {
QUI::getEvents()->fireEvent('quiqqerMenuIndependentCreate', [$Menu]); QUI::getEvents()->fireEvent('quiqqerMenuIndependentCreate', [$Menu]);
} catch (\Exception $Exception) { } catch (Exception $Exception) {
QUI\System\Log::writeException($Exception); QUI\System\Log::writeException($Exception);
} }
...@@ -42,7 +43,7 @@ public static function createMenu(): Menu ...@@ -42,7 +43,7 @@ public static function createMenu(): Menu
* @throws QUI\Database\Exception * @throws QUI\Database\Exception
* @throws QUI\Permissions\Exception * @throws QUI\Permissions\Exception
*/ */
public static function deleteMenu(int $menuId) public static function deleteMenu(int $menuId): void
{ {
QUI\Permissions\Permission::checkPermission('quiqqer.menu.delete'); QUI\Permissions\Permission::checkPermission('quiqqer.menu.delete');
...@@ -52,7 +53,7 @@ public static function deleteMenu(int $menuId) ...@@ -52,7 +53,7 @@ public static function deleteMenu(int $menuId)
try { try {
QUI::getEvents()->fireEvent('quiqqerMenuIndependentDelete', [$menuId]); QUI::getEvents()->fireEvent('quiqqerMenuIndependentDelete', [$menuId]);
} catch (\Exception $Exception) { } catch (Exception $Exception) {
QUI\System\Log::writeException($Exception); QUI\System\Log::writeException($Exception);
} }
} }
......
...@@ -36,7 +36,7 @@ public static function getMenu(int $menuId): Menu ...@@ -36,7 +36,7 @@ public static function getMenu(int $menuId): Menu
* @param QUI\Projects\Project|null $Project * @param QUI\Projects\Project|null $Project
* @return string * @return string
*/ */
public static function getMenuCacheName($menuId = false, QUI\Projects\Project $Project = null): string public static function getMenuCacheName(bool|int $menuId = false, QUI\Projects\Project $Project = null): string
{ {
if ($Project) { if ($Project) {
$project = $Project->getName(); $project = $Project->getName();
......
...@@ -112,7 +112,7 @@ public function getName(Locale $Locale = null): string ...@@ -112,7 +112,7 @@ public function getName(Locale $Locale = null): string
/** /**
* alias for name * alias for name
* - can be use for the `a title=""` attribute * - can be used for the `a title=""` attribute
* *
* @param Locale|null $Locale * @param Locale|null $Locale
* @return string * @return string
...@@ -209,7 +209,7 @@ public function getMenuType(): string ...@@ -209,7 +209,7 @@ public function getMenuType(): string
/** /**
* @return mixed * @return mixed
*/ */
public function getCustomData() public function getCustomData(): mixed
{ {
if (isset($this->attributes['data'])) { if (isset($this->attributes['data'])) {
return $this->attributes['data']; return $this->attributes['data'];
...@@ -352,7 +352,7 @@ public function getChildren(bool $onlyActive = true): array ...@@ -352,7 +352,7 @@ public function getChildren(bool $onlyActive = true): array
* *
* @param AbstractMenuItem $Item * @param AbstractMenuItem $Item
*/ */
public function appendChild(AbstractMenuItem $Item) public function appendChild(AbstractMenuItem $Item): void
{ {
$this->children[] = $Item; $this->children[] = $Item;
} }
......
...@@ -35,7 +35,7 @@ public function getUrl(): string ...@@ -35,7 +35,7 @@ public function getUrl(): string
if ($Site) { if ($Site) {
try { try {
$url .= $Site->getUrlRewritten(); $url .= $Site->getUrlRewritten();
} catch (QUI\Exception $Exception) { } catch (QUI\Exception) {
} }
} }
...@@ -66,7 +66,7 @@ public function getSite(): ?QUI\Projects\Site ...@@ -66,7 +66,7 @@ public function getSite(): ?QUI\Projects\Site
try { try {
$siteUrl = $data['site']; $siteUrl = $data['site'];
$Site = QUI\Projects\Site\Utils::getSiteByLink($siteUrl); $Site = QUI\Projects\Site\Utils::getSiteByLink($siteUrl);
} catch (QUI\Exception $Exception) { } catch (QUI\Exception) {
return null; return null;
} }
...@@ -79,7 +79,7 @@ public function getSite(): ?QUI\Projects\Site ...@@ -79,7 +79,7 @@ public function getSite(): ?QUI\Projects\Site
$langId = $Site->getId($current); $langId = $Site->getId($current);
$LangProject = QUI::getProject($Project->getName(), $current); $LangProject = QUI::getProject($Project->getName(), $current);
return $LangProject->get($langId); return $LangProject->get($langId);
} catch (QUI\Exception $exception) { } catch (QUI\Exception) {
return null; return null;
} }
} }
......
...@@ -58,7 +58,7 @@ public function getSite(): ?QUI\Projects\Site ...@@ -58,7 +58,7 @@ public function getSite(): ?QUI\Projects\Site
try { try {
$siteUrl = $data['site']; $siteUrl = $data['site'];
$Site = QUI\Projects\Site\Utils::getSiteByLink($siteUrl); $Site = QUI\Projects\Site\Utils::getSiteByLink($siteUrl);
} catch (QUI\Exception $Exception) { } catch (QUI\Exception) {
return null; return null;
} }
...@@ -72,7 +72,7 @@ public function getSite(): ?QUI\Projects\Site ...@@ -72,7 +72,7 @@ public function getSite(): ?QUI\Projects\Site
$LangProject = QUI::getProject($Project->getName(), $current); $LangProject = QUI::getProject($Project->getName(), $current);
return $LangProject->get($langId); return $LangProject->get($langId);
} catch (QUI\Exception $exception) { } catch (QUI\Exception) {
return null; return null;
} }
} }
...@@ -136,7 +136,7 @@ public function getTitle(QUI\Locale $Locale = null): string ...@@ -136,7 +136,7 @@ public function getTitle(QUI\Locale $Locale = null): string
$Site = QUI\Projects\Site\Utils::getSiteByLink($siteUrl); $Site = QUI\Projects\Site\Utils::getSiteByLink($siteUrl);
return $Site->getAttribute('title'); return $Site->getAttribute('title');
} catch (QUI\Exception $Exception) { } catch (QUI\Exception) {
} }
return ''; return '';
...@@ -152,7 +152,7 @@ public function getUrl(): string ...@@ -152,7 +152,7 @@ public function getUrl(): string
if ($Site) { if ($Site) {
try { try {
return $Site->getUrlRewritten(); return $Site->getUrlRewritten();
} catch (QUI\Exception $Exception) { } catch (QUI\Exception) {
return ''; return '';
} }
} }
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren