Simplify: Use CSS in info.xml that always loads
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<name>Minimal Profile</name>
|
<name>Minimal Profile</name>
|
||||||
<summary>Hides profile fields to create a minimal user profile</summary>
|
<summary>Hides profile fields to create a minimal user profile</summary>
|
||||||
<description>Allows administrators to hide profile fields like pronouns, social links, etc.</description>
|
<description>Allows administrators to hide profile fields like pronouns, social links, etc.</description>
|
||||||
<version>1.0.5</version>
|
<version>1.0.8</version>
|
||||||
<licence>AGPL</licence>
|
<licence>AGPL</licence>
|
||||||
<author>Your Name</author>
|
<author>Your Name</author>
|
||||||
<namespace>MinimalProfile</namespace>
|
<namespace>MinimalProfile</namespace>
|
||||||
@@ -14,4 +14,7 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<nextcloud min-version="33" max-version="33"/>
|
<nextcloud min-version="33" max-version="33"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
<css>
|
||||||
|
<file>css/minimalprofile.css</file>
|
||||||
|
</css>
|
||||||
</info>
|
</info>
|
||||||
2
css/minimalprofile.css
Normal file
2
css/minimalprofile.css
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
/* Hide profile fields */
|
||||||
|
.personal-settings-setting-box:has(#account-property-pronouns) { display: none !important; }
|
||||||
@@ -8,9 +8,6 @@ use OCP\AppFramework\App;
|
|||||||
use OCP\AppFramework\Bootstrap\IBootContext;
|
use OCP\AppFramework\Bootstrap\IBootContext;
|
||||||
use OCP\AppFramework\Bootstrap\IBootstrap;
|
use OCP\AppFramework\Bootstrap\IBootstrap;
|
||||||
use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
||||||
use OCP\AppFramework\Http\TemplateResponse;
|
|
||||||
use OCP\EventDispatcher\Event;
|
|
||||||
use OCP\EventDispatcher\IEventListener;
|
|
||||||
|
|
||||||
class Application extends App implements IBootstrap {
|
class Application extends App implements IBootstrap {
|
||||||
|
|
||||||
@@ -21,23 +18,8 @@ class Application extends App implements IBootstrap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function register(IRegistrationContext $context): void {
|
public function register(IRegistrationContext $context): void {
|
||||||
$context->registerEventListener(
|
|
||||||
TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS,
|
|
||||||
LoadScriptsListener::class
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function boot(IBootContext $context): void {
|
public function boot(IBootContext $context): void {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class LoadScriptsListener implements IEventListener {
|
|
||||||
|
|
||||||
public function handle(Event $event): void {
|
|
||||||
if (!$event instanceof TemplateResponse) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$event->addScript('minimalprofile');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user