Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show overview of modules in the admin plugin #1561

Merged
merged 1 commit into from Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions modules/admin/lib/Controller/Config.php
Expand Up @@ -137,13 +137,23 @@ public function main(/** @scrutinizer ignore-unused */ Request $request): Templa
],
'funcmatrix' => $this->getPrerequisiteChecks(),
'logouturl' => $this->authUtils->getAdminLogoutURL(),
'modulelist' => $this->getModuleList(),
];

Module::callHooks('configpage', $t);
$this->menu->addOption('logout', $this->authUtils->getAdminLogoutURL(), Translate::noop('Log out'));
return $this->menu->insert($t);
}

protected function getModuleList(): array
{
$modules = Module::getModules();
$modulestates = [];
foreach ($modules as $module) {
$modulestates[$module] = Module::isModuleEnabled($module);
}
return $modulestates;
}

/**
* Display the output of phpinfo().
Expand Down
13 changes: 11 additions & 2 deletions modules/admin/templates/config.twig
Expand Up @@ -24,11 +24,20 @@
</div>
<h2>{% trans %}Configuration{% endtrans %}</h2>
<div class="enablebox mini">
<table>
<table class="pure-table">
<thead><tr><th>{% trans %}Module/function{% endtrans %}</th><th>{% trans %}Enabled?{% endtrans %}</th></tr></thead>
<tbody>
<tr class="{%- if enablematrix.saml20idp %}enabled{% else %}disabled{% endif -%}">
<td>SAML 2.0 IdP</td>
<td><i class="fa fa-{%- if enablematrix.saml20idp %}check{% else %}ban{% endif %}"></i></td>
<td><i class="fa fa-{%- if enablematrix.saml20idp %}check" title="{% trans %}enabled{% endtrans %}"{% else %}ban" title="{% trans %}disabled{% endtrans %}"{% endif %}></i></td>
</tr>
{% for module, enabled in modulelist %}
<tr class="{%- if enabled %}enabled{% else %}disabled{% endif -%}">
<td>{{ module }}</td>
<td><i class="fa fa-{%- if enabled %}check" title="{% trans %}enabled{% endtrans %}"{% else %}ban" title="{% trans %}disabled{% endtrans %}"{% endif %}></i></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<ul>
Expand Down