Skip to content

Commit 161828d

Browse files
authored
Update YformButton.php
1 parent f7588ff commit 161828d

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

lib/QuickNavigation/Button/YformButton.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@ class YformButton implements ButtonInterface
1919
{
2020
public function get(): string
2121
{
22-
if (!rex_addon::get('yform')->isAvailable() || !rex_plugin::get('yform', 'manager')->isAvailable()) {
23-
return '';
24-
}
25-
22+
23+
return match (true) {
24+
!$yform->isAvailable() => '',
25+
version_compare($yform->getVersion(), '5.0.0', '<') && !rex_plugin::get('yform', 'manager')->isAvailable() => '',
26+
default => function() {
27+
return '';
28+
}
29+
} ();
2630
$tables = rex_yform_manager_table::getAll();
27-
$yform = rex_addon::get('yform');
31+
2832
$yperm_suffix = '';
2933
if (version_compare($yform->getVersion(), '4.0.0-dev', '>=')) {
3034
$yperm_suffix = '_edit';

0 commit comments

Comments
 (0)