#!/usr/local/bin/perl # index.cgi # Display GRUB menu titles require './grub-lib.pl'; &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, &help_search_link("grub", "man", "doc")); # Check that GRUB is installed if (!-r $config{'menu_file'}) { print "
",&text('index_efile', "$config{'menu_file'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"
\n"; &ui_print_footer("/", $text{'index'}); exit; } if (!&has_command($config{'grub_path'})) { print "
",&text('index_epath', "$config{'grub_path'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"
\n";
&ui_print_footer("/", $text{'index'});
exit;
}
# List the boot options
$conf = &get_menu_config();
$def = &find_value("default", $conf);
foreach $t (&find("title", $conf)) {
push(@icons, $t->{'chainloader'} ? "images/chain.gif"
: "images/kernel.gif");
local $tt = &html_escape($t->{'value'});
push(@titles, $def == $i ? "$tt" : $tt);
push(@links, "edit_title.cgi?idx=$t->{'index'}");
$i++;
}
if (@links) {
print "$text{'index_add'}
\n";
&icons_table(\@links, \@titles, \@icons, 4);
}
else {
print "$text{'index_none'}
\n"; } print "$text{'index_add'}
\n"; print "