From ae6e50fd5a461c40501b134086d3975caa928285 Mon Sep 17 00:00:00 2001 From: Guy Van Sanden Date: Thu, 16 Apr 2026 16:23:54 +0200 Subject: [PATCH] v1.0.23 - green border working boot() + appinfo/app.php logs --- appinfo/info.xml | 2 +- lib/AppInfo/Application.php | 45 ++++++++++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index ddc2546..f148563 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -4,7 +4,7 @@ Minimal Profile Hides profile fields to create a minimal user profile Allows administrators to hide profile fields like pronouns, social links, etc. - 1.0.22 + 1.0.23 AGPL Your Name MinimalProfile diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 277bfec..7258bac 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -1,18 +1,53 @@ getAppContainer(); + $config = $container->query(IConfig::class); + + $value = $config->getAppValue('minimalprofile', 'hidden_fields', ''); + $hidden = ($value !== '') ? json_decode($value, true) ?? [] : []; + + $css = ''; + if (!empty($hidden)) { + $selectors = [ + 'pronouns' => '#account-property-pronouns', + 'role' => '#account-property-role', + 'headline' => '#account-property-headline', + ]; + foreach ($hidden as $field) { + if (isset($selectors[$field])) { + $css .= $selectors[$field] . ' { display: none !important; }' . "\n"; + } + } + } else { + // Debug + $css = 'body { border: 30px solid green !important; }'; + } + + if ($css) { + Util::addInlineStyle('minimalprofile', $css); + } } } \ No newline at end of file