$target_uuid = $_GET['uuid']; } if (isset($_GET['mod'])) { $mod = $_GET['mod']; } else { $mod = "none"; } switch ($mod) { case 'add': service_add($type, $target_uuid); break; case 'edit': service_edit($type, $target_uuid); break; default: service_add($type, $target_uuid); break; } function service_add($type, $target_uuid) { $params = getParams(); $item_uuid = $_GET['itemid']; $label = urldecode($_GET['itemlabel']); $f = new PopupForm(sprintf(_T("Add the boot service <b>%s</b> to <b>%s</b>", "imaging"), $label, $params['hostname'])); # Need to get the name of the target $f->push(new Table()); // form preseeding $f->add(new HiddenTpl("itemid"), array("value" => $item_uuid, "hide" => True)); $f->add(new HiddenTpl("itemlabel"), array("value" => $label, "hide" => True)); $f->add(new HiddenTpl("gid"), array("value" => $_GET['gid'], "hide" => True)); $f->add(new HiddenTpl("uuid"), array("value" => $_GET['uuid'], "hide" => True));
} } if (isset($_GET['mod'])) { $mod = $_GET['mod']; } else { $mod = "none"; } switch ($mod) { case 'add': service_add($location); break; case 'edit': service_edit($location); break; default: service_add($location); break; } function service_add($location) { $params = getParams(); $item_uuid = $_GET['itemid']; $label = urldecode($_GET['itemlabel']); $f = new PopupForm(sprintf(_T("Add the boot service <b>%s</b> to the default boot menu", "imaging"), $label)); $f->push(new Table()); // form preseeding $f->add(new HiddenTpl("location"), array("value" => $location, "hide" => True)); $f->add(new HiddenTpl("itemlabel"), array("value" => $label, "hide" => True)); $f->add(new HiddenTpl("itemid"), array("value" => $item_uuid, "hide" => True)); $f->add(new HiddenTpl("default_mi_label"), array("value" => $label, "hide" => True)); # $input = new TrFormElement(_T('Default menu item label', 'imaging'), new InputTpl("default_mi_label"));