diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 70ea7f3..95d2019 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -29,24 +29,25 @@ class Application extends App implements IBootstrap { $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', ]; - $css = ''; foreach ($hidden as $field) { if (isset($selectors[$field])) { $css .= $selectors[$field] . ' { display: none !important; }' . "\n"; + $css .= '.personal-settings-setting-box:has(' . $selectors[$field] . ') { display: none !important; }' . "\n"; } } - - if ($css) { - Util::addInlineStyle('minimalprofile', $css); - } } - file_put_contents('/tmp/minimalprofile_debug.log', date('Y-m-d H:i:s') . ' boot done, hidden: ' . print_r($hidden, true) . "\n", FILE_APPEND); + if ($css) { + Util::addInlineStyle($css); + } + + file_put_contents('/tmp/minimalprofile_debug.log', date('Y-m-d H:i:s') . ' Added CSS: ' . $css . "\n", FILE_APPEND); } } \ No newline at end of file