id="ltsp_label".$label; $MenuEntry->label= "menu label ${label}"; //$MenuEntry->label=$this->label; $MenuEntry->menuString="\n # {$label} LABEL {$label} KERNEL pxe-ltsp/{$id}/{$kernel} INITRD pxe-ltsp/ltsp.img,pxe-ltsp/{$id}/{$init} APPEND net.ifnames=0 root=/dev/nfs nfsroot={$server}:/opt/ltsp/{$id}/ {$kernel_extra_params} \n \n"; array_push($MenuEntryList, $MenuEntry); } while ($dir = readdir($dir_desc)){ if ( ($dir!=".") && ($dir!="..") && is_file($path.$dir."/vmlinuz") ){ if (is_dir($base_dir.$dir)){ try{ $string = file_get_contents("/etc/ltsp/images/".$dir.".json"); $json=json_decode($string,true); $name = getName($dir); $id = $json["id"]; if ($json["kernel_extra_params"] != "undefined"){ $kernel_extra_params = $json["kernel_extra_params"]; } else{ $kernel_extra_params = ""; } }catch( Exception $e){ $name = $dir; $id = $dir; $kernel_extra_params = ""; } add_entry( $name, $id ,"vmlinuz", "initrd.img",$kernel_extra_params); } } } // "Return" MenuEntryListObject $MenuEntryListObject=$MenuEntryList; ?>