summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2019-12-11 15:17:06 +0100
committerSimon Rettberg2019-12-11 15:17:06 +0100
commit9d4dd4c1c3964272ae04b193ea70cc44b643e6cd (patch)
tree33aaf01e2d27538edaad18d55ee1ecf1cdaee550 /modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php
parent[rebootcontrol] Fix: Replace \r\n by \n for exec script (diff)
parent[statistics/roomplanner] Update translations (diff)
downloadslx-admin-9d4dd4c1c3964272ae04b193ea70cc44b643e6cd.tar.gz
slx-admin-9d4dd4c1c3964272ae04b193ea70cc44b643e6cd.tar.xz
slx-admin-9d4dd4c1c3964272ae04b193ea70cc44b643e6cd.zip
Merge branch 'master' into wol
Diffstat (limited to 'modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php')
-rw-r--r--modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php
index cf180006..73611b0a 100644
--- a/modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/inc/bootentryhook.inc.php
@@ -26,6 +26,10 @@ abstract class BootEntryHook
*/
public abstract function extraFields();
+ /**
+ * @param string $id
+ * @return bool
+ */
public abstract function isValidId($id);
/**
@@ -63,16 +67,30 @@ abstract class BootEntryHook
return $this->getBootEntryInternal($data);
}
- public function setSelected($id)
+ /**
+ * @param string $mixed either the plain ID if the entry to be marked as selected, or the JSON string representing
+ * the entire entry, which must have a key called 'id' that will be used as the ID then.
+ */
+ public function setSelected($mixed)
{
- $json = @json_decode($id, true);
+ $json = @json_decode($mixed, true);
if (is_array($json)) {
$id = $json['id'];
$this->data = $json;
+ } else {
+ $id = $mixed;
}
$this->selectedId = $id;
}
+ /**
+ * @return string ID of entry that was marked as selected by setSelected()
+ */
+ public function getSelected()
+ {
+ return $this->selectedId;
+ }
+
public function renderExtraFields()
{
$list = $this->extraFields();