From d10a3a96e0538b8347472d6c2d350dc2bee86501 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 24 Sep 2019 15:25:32 +0200 Subject: [serversetup-bwlp-ipxe] --- .../inc/bootentryhook.inc.php | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php (limited to 'modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php') diff --git a/modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php new file mode 100644 index 00000000..2e2e5009 --- /dev/null +++ b/modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php @@ -0,0 +1,91 @@ +groupsInternal(); + foreach ($groups as $group) { + foreach ($group->entries as $entry) { + if ($entry->id === $this->selectedId) { + $entry->selected = 'selected'; + } + } + } + return $groups; + } + + public function setSelected($id) + { + $this->selectedId = $id; + } + +} + +class HookEntryGroup +{ + /** + * @var string + */ + public $groupName; + /** + * @var HookEntry[] + */ + public $entries; + + public function __construct($groupName, $entries) + { + $this->groupName = $groupName; + $this->entries = $entries; + } +} + +class HookEntry +{ + /** + * @var string + */ + public $id; + /** + * @var string + */ + public $name; + /** + * @var string internal - to be set by ipxe module + */ + public $selected; + + public function __construct($id, $name) + { + $this->id = $id; + $this->name = $name; + } +} \ No newline at end of file -- cgit v1.2.3-55-g7522