Skip to content

Commit

Permalink
Tableset, Pages mit Yform5
Browse files Browse the repository at this point in the history
  • Loading branch information
dergel committed Nov 15, 2024
1 parent 97a4268 commit 454bbb8
Show file tree
Hide file tree
Showing 4 changed files with 338 additions and 279 deletions.
20 changes: 14 additions & 6 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,30 @@
* @psalm-scope-this rex_addon
*/

// include __DIR__.'/vendor/guzzlehttp/promises/src/functions_include.php';
// include __DIR__.'/vendor/guzzlehttp/guzzle/src/functions_include.php';
//

rex_ycom_auth::addInjection(new rex_ycom_injection_otp(), 1);
rex_ycom_auth::addInjection(new rex_ycom_injection_passwordchange(), 4);
rex_ycom_auth::addInjection(new rex_ycom_injection_termsofuse(), 8);

if (rex::isBackend()) {
rex_extension::register('PACKAGES_INCLUDED', static function ($params) {
$addon = rex_addon::get('yform');
$plugin = rex_plugin::get('yform', 'manager');

if ($plugin->isAvailable()) {
// YForm <= 5
$pages = $plugin->getProperty('pages');
$ycom_tables = rex_ycom::getTables();

if (isset($pages) && is_array($pages)) {
foreach ($pages as $page) {
if (in_array($page->getKey(), $ycom_tables, true)) {
$page->setBlock('ycom');
// $page->setRequiredPermissions('ycom[]');
}
}
}
} else {
// YForm >= 5
$pages = $addon->getProperty('pages');
$ycom_tables = rex_ycom::getTables();
if (isset($pages) && is_array($pages)) {
foreach ($pages as $page) {
if (in_array($page->getKey(), $ycom_tables, true)) {
Expand Down
Loading

0 comments on commit 454bbb8

Please sign in to comment.