MDL-87908 admin: Coding style fix thirdpartylibs

This commit is contained in:
Andrew Nicols
2026-03-09 14:08:19 +08:00
parent aa84ee7ed7
commit 3af446ebec
+11 -10
View File
@@ -23,8 +23,8 @@
*/
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/tablelib.php');
admin_externalpage_setup('thirdpartylibs');
@@ -39,25 +39,26 @@ $files = [
$plugintypes = core_component::get_plugin_types();
foreach ($plugintypes as $type => $ignored) {
$plugins = core_component::get_plugin_list_with_file($type, 'thirdpartylibs.xml', false);
foreach ($plugins as $path) {
foreach ($plugins as $path) {
$files[] = $path;
}
}
$table = new html_table();
$table->head = array(
$table->head = [
get_string('thirdpartylibrary', 'core_admin'), get_string('version'),
get_string('thirdpartylibrarylocation', 'core_admin'), get_string('license'));
$table->align = array('left', 'left', 'left', 'left');
get_string('thirdpartylibrarylocation', 'core_admin'), get_string('license'),
];
$table->align = ['left', 'left', 'left', 'left'];
$table->id = 'thirdpartylibs';
$table->attributes['class'] = 'admintable table generaltable table-hover';
$table->data = array();
$table->data = [];
foreach ($files as $xmlpath) {
$xml = simplexml_load_file($xmlpath);
foreach ($xml as $lib) {
$base = realpath(dirname($xmlpath));
$location = substr($base, strlen($CFG->root)).'/'.$lib->location;
$location = substr($base, strlen($CFG->root)) . '/' . $lib->location;
if (is_dir($CFG->dirroot . $location)) {
$location .= '/';
}
@@ -67,10 +68,10 @@ foreach ($files as $xmlpath) {
}
$license = $lib->license;
if (!empty($lib->licenseversion)) {
$license .= ' '.$lib->licenseversion;
$license .= ' ' . $lib->licenseversion;
}
$table->data[] = new html_table_row(array($lib->name, $version, $location, $license));
$table->data[] = new html_table_row([$lib->name, $version, $location, $license]);
}
}