3 # Display main menu of cfengine options
5 require './cfengine-lib.pl';
7 # Check if cfengine command exists
8 if (!&has_command($config{'cfengine'})) {
9 &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1);
10 print &text('index_ecommand', "<tt>$config{'cfengine'}</tt>",
11 "$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
12 &ui_print_footer("/", $text{'index'});
16 # Make sure it is actually cfengine, and get the version
17 $ver = &get_cfengine_version(\$out);
19 &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1);
20 print &text('index_eversion', "<tt>$config{'cfengine'} -v</tt>",
21 "<pre>$out</pre>"),"<p>\n";
22 &ui_print_footer("/", $text{'index'});
26 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, undef,
27 &help_search_link("cfengine", "man", "doc", "google"), undef, undef,
28 &text('index_version', $ver));
30 # Only versions 1.x are supported yet
32 print &text('index_eversion2', "<tt>$config{'cfengine'}</tt>",
33 "<tt>$ver</tt>", "<tt>1.x</tt>"),"<p>\n";
34 &ui_print_footer("/", $text{'index'});
38 # Check if config file exists
39 if (!-r $cfengine_conf || -d $config{'cfengine_conf'}) {
40 print &text('index_econfig', "<tt>$cfengine_conf</tt>",
41 "$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
42 &ui_print_footer("/", $text{'index'});
46 # Display table of sections
47 $conf = &get_config();
48 @secs = grep { $_->{'type'} eq 'section' } @$conf;
49 &show_classes_table(\@secs, 0);
51 # Display option icons
53 print &ui_subheading($text{'index_options'});
54 @links = ( "run_form.cgi", "list_hosts.cgi", "edit_cfd.cgi", "edit_push.cgi" );
55 @titles = ( $text{'run_title'}, $text{'hosts_title'}, $text{'cfd_title'},
56 $text{'push_title'} );
57 @icons = ( "images/run.gif", "images/hosts.gif", "images/cfd.gif",
59 &icons_table(\@links, \@titles, \@icons);
61 &ui_print_footer("/", $text{'index'});