Skip to content
Snippets Groups Projects
Commit 520fbf4f authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

make table of unregistered plugins sortable, fixes #4927

Closes #4927

Merge request studip/studip!3698
parent c20978de
No related branches found
No related tags found
No related merge requests found
...@@ -509,7 +509,11 @@ class Admin_PluginController extends AuthenticatedController ...@@ -509,7 +509,11 @@ class Admin_PluginController extends AuthenticatedController
public function unregistered_action() public function unregistered_action()
{ {
$this->unknown_plugins = $this->plugin_admin->scanPluginDirectory(); $plugins = $this->plugin_admin->scanPluginDirectory();
usort($plugins, function ($a, $b) {
return $a['pluginname'] <=> $b['pluginname'];
});
$this->unknown_plugins = $plugins;
} }
/** /**
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
* @var array $unknown_plugins * @var array $unknown_plugins
*/ */
?> ?>
<table class="default"> <table class="default sortable-table" data-sortlist="[[0, 0]]">
<caption> <caption>
<?= _('Im Pluginverzeichnis vorhandene Plugins registrieren') ?> <?= _('Im Pluginverzeichnis vorhandene Plugins registrieren') ?>
</caption> </caption>
<thead> <thead>
<tr> <tr>
<th><?= _('Name') ?></th> <th data-sort="text"><?= _('Name') ?></th>
<th><?= _('Pluginklasse') ?></th> <th data-sort="text"><?= _('Pluginklasse') ?></th>
<th><?= _('Version') ?></th> <th data-sort="digit"><?= _('Version') ?></th>
<th><?= _('Ursprung') ?></th> <th data-sort="text"><?= _('Ursprung') ?></th>
<th><?= _('Registrieren') ?></th> <th><?= _('Registrieren') ?></th>
</tr> </tr>
</thead> </thead>
......
...@@ -405,9 +405,12 @@ class PluginAdministration ...@@ -405,9 +405,12 @@ class PluginAdministration
$basepath = Config::get()->PLUGINS_PATH; $basepath = Config::get()->PLUGINS_PATH;
$plugin_manager = PluginManager::getInstance(); $plugin_manager = PluginManager::getInstance();
$iterator = new RegexIterator( $iterator = new RegexIterator(
new RecursiveIteratorIterator( new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($basepath, FilesystemIterator::FOLLOW_SYMLINKS | FilesystemIterator::UNIX_PATHS)), new RecursiveDirectoryIterator($basepath, FilesystemIterator::FOLLOW_SYMLINKS | FilesystemIterator::UNIX_PATHS)
'/plugin\.manifest$/', RecursiveRegexIterator::MATCH); ),
'/plugin\.manifest$/',
RegexIterator::MATCH
);
foreach ($iterator as $manifest_file) { foreach ($iterator as $manifest_file) {
$manifest = $plugin_manager->getPluginManifest($manifest_file->getPath()); $manifest = $plugin_manager->getPluginManifest($manifest_file->getPath());
if (!isset($manifest['pluginclassname'])) { if (!isset($manifest['pluginclassname'])) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment