summaryrefslogtreecommitdiffstats
path: root/modules-available/minilinux/page.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2020-08-28 18:52:57 +0200
committerSimon Rettberg2020-08-28 18:52:57 +0200
commitf72e4528dc0d4f8e34d9552bd833c4d9e9893647 (patch)
treea0f110f1bf1370fb01d1e74bfc8a767df643207d /modules-available/minilinux/page.inc.php
parent[serversetup-bwlp-ipxe] Fix UTF-8 fix, fix gaps not being displayed (diff)
downloadslx-admin-f72e4528dc0d4f8e34d9552bd833c4d9e9893647.tar.gz
slx-admin-f72e4528dc0d4f8e34d9552bd833c4d9e9893647.tar.xz
slx-admin-f72e4528dc0d4f8e34d9552bd833c4d9e9893647.zip
[minilinux] Show which menu(entries) and locations use a version
Diffstat (limited to 'modules-available/minilinux/page.inc.php')
-rw-r--r--modules-available/minilinux/page.inc.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/modules-available/minilinux/page.inc.php b/modules-available/minilinux/page.inc.php
index 6e7fe8e2..03ec121e 100644
--- a/modules-available/minilinux/page.inc.php
+++ b/modules-available/minilinux/page.inc.php
@@ -41,11 +41,12 @@ class Page_MiniLinux extends Page
// List branches and versions
$branches = Database::queryAll('SELECT sourceid, branchid, title, description FROM minilinux_branch ORDER BY title ASC');
$versions = MiniLinux::queryAllVersionsByBranch();
- // Group by branch for detailed listing
+ $usage = MiniLinux::getBootMenuUsage();
+ // Group by branch for detailed listing, add usage info
foreach ($branches as &$branch) {
$branch['bid'] = 'div-' . str_replace('/', '-', $branch['branchid']);
if (isset($versions[$branch['branchid']])) {
- $branch['versionlist'] = $this->renderVersionList($versions[$branch['branchid']]);
+ $branch['versionlist'] = $this->renderVersionList($versions[$branch['branchid']], $usage);
}
}
unset($branch);
@@ -83,10 +84,10 @@ class Page_MiniLinux extends Page
}
}
- private function renderVersionList($versions)
+ private function renderVersionList($versions, $usage)
{
$def = Property::get(MiniLinux::PROPERTY_DEFAULT_BOOT);
- $eff = Property::get(MiniLinux::PROPERTY_DEFAULT_BOOT_EFFECTIVE);
+ //$eff = Property::get(MiniLinux::PROPERTY_DEFAULT_BOOT_EFFECTIVE);
foreach ($versions as &$version) {
$version['dateline_s'] = Util::prettyTime($version['dateline']);
$version['orphan'] = ($version['orphan'] > 0 && !$version['installed']) || ($version['orphan'] > 1);
@@ -100,6 +101,9 @@ class Page_MiniLinux extends Page
$version['default_class'] = 'bg-danger';
}
}
+ if (isset($usage[$version['versionid']])) {
+ $version['usage'] = $usage[$version['versionid']];
+ }
}
return Render::parse('versionlist', ['versions' => array_values($versions)]);
}