diff options
author | Simon Rettberg | 2019-03-19 23:52:11 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-03-19 23:52:11 +0100 |
commit | 89e6c1ce7f901a19467fb5cbc18e8a87ea901482 (patch) | |
tree | 9b23b7ba486005b3aab53054810a0ab68b0346dd /modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php | |
parent | [serversetup-bwlp-ipxe] Fix incomplete bootentries, hide arch select (diff) | |
download | slx-admin-89e6c1ce7f901a19467fb5cbc18e8a87ea901482.tar.gz slx-admin-89e6c1ce7f901a19467fb5cbc18e8a87ea901482.tar.xz slx-admin-89e6c1ce7f901a19467fb5cbc18e8a87ea901482.zip |
[serversetup-bwlp-ipxe] Implement cascaded menus
Diffstat (limited to 'modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php')
-rw-r--r-- | modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php index 0248e0ea..ee245e40 100644 --- a/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php +++ b/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php @@ -46,6 +46,11 @@ abstract class BootEntry return null; } + public static function forMenu($menuId) + { + return new MenuBootEntry($menuId); + } + public static function newStandardBootEntry($initData) { $ret = new StandardBootEntry($initData); @@ -276,3 +281,33 @@ class CustomBootEntry extends BootEntry return ['script' => $this->script]; } } + +class MenuBootEntry extends BootEntry +{ + protected $menuId; + + public function __construct($menuId) + { + $this->menuId = $menuId; + } + + public function supportsMode($mode) + { + return true; + } + + public function toScript($failLabel, $mode) + { + return 'chain -ar ${self}&menuid=' . $this->menuId . ' || goto ' . $failLabel . "\n"; + } + + public function toArray() + { + return []; + } + + public function addFormFields(&$array) + { + } +} + |