blob: 7be57ef187bbd49182df4ec28c42f73b6db4dfce (
plain) (
tree)
|
|
<?php
/**
* Class representing a parsed pxelinux menu. Members
* will be set to their annotated type if present or
* be null otherwise, except for present-only boolean
* options, which will default to false.
*/
class PxeMenu
{
/**
* @var string menu title, shown at the top of the menu
*/
public $title;
/**
* @var int initial timeout after which $timeoutLabel would be executed
*/
public $timeoutMs;
/**
* @var int if the user canceled the timeout by pressing a key, this timeout would still eventually
* trigger and launch the $timeoutLabel section
*/
public $totalTimeoutMs;
/**
* @var string label of section which will execute if the timeout expires
*/
public $timeoutLabel;
/**
* @var bool hide menu and just show background after triggering an entry
*/
public $menuClear = false;
/**
* @var bool boot the associated entry directly if its corresponding hotkey is pressed instead of just highlighting
*/
public $immediateHotkeys = false;
/**
* @var PxeSection[] list of sections the menu contains
*/
public $sections = [];
/**
* @var string The DEFAULT entry of the menu. Usually refers either to a
* LABEL, or a loadable module (like vesamenu.c32)
*/
public $default;
/**
* Check if any of the sections has the given label.
*/
public function hasLabel(string $label): bool
{
foreach ($this->sections as $section) {
if ($section->label === $label)
return true;
}
return false;
}
}
|