#!/usr/local/bin/perl
# index.cgi
# Lists all installed packages

require './software-lib.pl';
&header($text{'index_title'}, "", "intro", 0, 1, 0,
	&help_search_link(&package_help(), "man", "doc"));
print "<hr>\n";

print "<h3>$text{'index_installed'}</h3>\n";
print "<table width=100%><tr><form action=search.cgi>\n";
print "<td><input type=submit value=\"$text{'index_search'}\">\n";
print "<input name=search size=30></td>\n";
print "</form>\n";

print "<form action=tree.cgi>\n";
print "<td align=right><input type=submit value='$text{'index_tree'}'></td>\n";
print "</form></tr></table>\n";

print "<hr>\n";
print "<h3>$text{'index_install'}</h3>\n";
print &text('index_installmsg', &package_system()),"<p>\n";
print "<form action=install_pack.cgi method=post ",
      "enctype=multipart/form-data>\n";
print "<input type=radio name=source value=0 checked> $text{'index_local'}\n";
print "<input name=local size=50>\n";
print &file_chooser_button("local", 0, 2); print "<br>\n";
print "<input type=radio name=source value=1> $text{'index_uploaded'}\n";
print "<input type=file name=upload size=20><br>\n";
print "<input type=radio name=source value=2> $text{'index_ftp'}\n";
print "<input name=url size=50>\n";
print &search_system_input() if ($has_search_system);
print "<br>\n";
if ($has_update_system) {
	print "<input type=radio name=source value=3>\n";
	print &update_system_input(),"<br>\n";
	}
print "<input type=submit value=\"$text{'index_installok'}\">\n";
print "</form>\n";

print "<hr>\n";
print "<h3>$text{'index_ident'}</h3>\n";
print &text('index_identmsg', &package_system()),"<br>\n";
print "<form action=file_info.cgi>\n";
print "<input type=submit value=\"$text{'index_identok'}\">\n";
print "<input name=file size=30>\n";
print &file_chooser_button("file", 0, 3);
print "</form>\n";

if ($has_update_system && defined(&update_system_form)) {
	print "<hr>\n";
	&update_system_form();
	}

print "<hr>\n";
&footer("/", $text{'index'});


