]> git.mxchange.org Git - friendica.git/commitdiff
Move style logic from Addon class to BaseAdmin module
authorArt4 <art4@wlabs.de>
Tue, 4 Feb 2025 14:44:46 +0000 (14:44 +0000)
committerArt4 <art4@wlabs.de>
Tue, 4 Feb 2025 14:44:46 +0000 (14:44 +0000)
src/Module/BaseAdmin.php

index 3d1188395fbfde89d64630b1bbb39c5ecadb7683..2bede256b2d66d378565d8a8c7cd769e50a85feb 100644 (file)
@@ -8,7 +8,6 @@
 namespace Friendica\Module;
 
 use Friendica\BaseModule;
-use Friendica\Core\Addon;
 use Friendica\Core\Renderer;
 use Friendica\DI;
 use Friendica\Network\HTTPException;
@@ -98,9 +97,19 @@ abstract class BaseAdmin extends BaseModule
                        ]],
                ];
 
+               $addons_admin = [];
+
+               foreach (DI::addonHelper()->getEnabledAddonsWithAdminSettings() as $addonId) {
+                       $addons_admin[$addonId] = [
+                               'url'   => 'admin/addons/' . $addonId,
+                               'name'  => $addonId,
+                               'class' => 'addon',
+                       ];
+               }
+
                $t = Renderer::getMarkupTemplate('admin/aside.tpl');
                DI::page()['aside'] .= Renderer::replaceMacros($t, [
-                       '$admin' => ['addons_admin' => Addon::getAdminList()],
+                       '$admin' => ['addons_admin' => $addons_admin],
                        '$subpages' => $aside_sub,
                        '$admtxt' => DI::l10n()->t('Admin'),
                        '$plugadmtxt' => DI::l10n()->t('Addon Features'),