2007-04-12 20:24:50 +00:00
|
|
|
#!/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 "<p>",&text('index_efile', "<tt>$config{'menu_file'}</tt>",
|
2021-09-28 16:30:05 +03:00
|
|
|
"@{[&get_webprefix()]}/config.cgi?$module_name"),"<p>\n";
|
2007-04-12 20:24:50 +00:00
|
|
|
&ui_print_footer("/", $text{'index'});
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
if (!&has_command($config{'grub_path'})) {
|
|
|
|
print "<p>",&text('index_epath', "<tt>$config{'grub_path'}</tt>",
|
2021-09-28 16:30:05 +03:00
|
|
|
"@{[&get_webprefix()]}/config.cgi?$module_name"),"<p>\n";
|
2007-04-12 20:24:50 +00:00
|
|
|
&ui_print_footer("/", $text{'index'});
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
# List the boot options
|
2014-06-08 11:46:00 -04:00
|
|
|
@crlinks = ( &ui_link("edit_title.cgi?new=1",$text{'index_add'}) );
|
2007-04-12 20:24:50 +00:00
|
|
|
$conf = &get_menu_config();
|
|
|
|
$def = &find_value("default", $conf);
|
2010-10-15 16:48:34 -07:00
|
|
|
@t = &find("title", $conf);
|
|
|
|
$i = 0;
|
|
|
|
foreach $t (@t) {
|
2007-04-12 20:24:50 +00:00
|
|
|
push(@icons, $t->{'chainloader'} ? "images/chain.gif"
|
|
|
|
: "images/kernel.gif");
|
|
|
|
local $tt = &html_escape($t->{'value'});
|
|
|
|
push(@titles, $def == $i ? "<b>$tt</b>" : $tt);
|
|
|
|
push(@links, "edit_title.cgi?idx=$t->{'index'}");
|
2010-10-15 16:48:34 -07:00
|
|
|
push(@befores, $i == 0 ? "<< | " :
|
2014-07-04 17:57:18 -07:00
|
|
|
&ui_link("up.cgi?idx=$i", "<<")." | ");
|
2010-10-15 16:48:34 -07:00
|
|
|
push(@afters, $i == @t-1 ? " | >>" :
|
2014-07-04 17:57:18 -07:00
|
|
|
" | ".&ui_link("down.cgi?idx=$i",
|
|
|
|
">>"));
|
2007-04-12 20:24:50 +00:00
|
|
|
$i++;
|
|
|
|
}
|
|
|
|
if (@links) {
|
2008-01-04 07:30:37 +00:00
|
|
|
print &ui_links_row(\@crlinks);
|
2010-10-15 16:48:34 -07:00
|
|
|
&icons_table(\@links, \@titles, \@icons, 4, undef, undef, undef,
|
|
|
|
\@befores, \@afters);
|
2007-04-12 20:24:50 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
print "<b>$text{'index_none'}</b><p>\n";
|
|
|
|
}
|
2008-01-04 07:30:37 +00:00
|
|
|
print &ui_links_row(\@crlinks);
|
2008-05-10 03:07:43 +00:00
|
|
|
print &ui_hr();
|
2007-04-12 20:24:50 +00:00
|
|
|
|
2008-01-04 07:30:37 +00:00
|
|
|
print &ui_buttons_start();
|
2007-04-12 20:24:50 +00:00
|
|
|
|
2008-01-04 07:30:37 +00:00
|
|
|
# Global options button
|
|
|
|
print &ui_buttons_row("edit_global.cgi", $text{'index_global'},
|
|
|
|
$text{'index_globalmsg'});
|
|
|
|
|
|
|
|
# Install button
|
2007-04-12 20:24:50 +00:00
|
|
|
%flang = &load_language('fdisk');
|
|
|
|
$text{'select_part'} = $flang{'select_part'};
|
|
|
|
$text{'select_device'} = $flang{'select_device'};
|
|
|
|
$text{'select_fd'} = $flang{'select_fd'};
|
|
|
|
$r = $config{'install'};
|
|
|
|
$dev = &bios_to_linux($r);
|
|
|
|
&foreign_require("mount", "mount-lib.pl");
|
|
|
|
$dev = &mount::device_name($dev);
|
2008-01-04 07:30:37 +00:00
|
|
|
print &ui_buttons_row("install.cgi", $text{'index_install'},
|
|
|
|
&text('index_installmsg', $dev),
|
|
|
|
&ui_hidden("dev", $dev));
|
2007-04-12 20:24:50 +00:00
|
|
|
|
2008-01-04 07:30:37 +00:00
|
|
|
print &ui_buttons_end();
|
2007-04-12 20:24:50 +00:00
|
|
|
|
|
|
|
&ui_print_footer("/", $text{'index'});
|
|
|
|
|