]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/country.cgi
samba: Use full page width for all tables
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / country.cgi
index 8df2427a9eb10d24fd43bd8c5ce1b36cceecb416..b519d89b3c98e381339c91e093a19a7f3a43f545 100644 (file)
 
 use strict;
 
-use Locale::Codes::Country;
-
 my $col;
 my $lines = '1';
 my $lines2 = '';
 
 require '/var/ipfire/general-functions.pl';
-require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/location-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
+require "${General::swroot}/location-functions.pl";
+
 &Header::showhttpheaders();
 
 &Header::openpage($Lang::tr{'countries'}, 1, '');
@@ -52,8 +52,11 @@ print<<END;
        </tr>
 END
 
+# Init libloc database connection.
+my $db_handle = &Location::Functions::init();
+
 # Get a list of all supported country codes.
-my @countries = Locale::Codes::Country::all_country_codes();
+my @countries = &Location::database_countries($db_handle);
 
 # Loop through whole country list.
 foreach my $country (@countries) {
@@ -63,10 +66,10 @@ foreach my $country (@countries) {
        $country = uc($country);
 
        # Get flag icon for of the country.
-       my $flag_icon = &GeoIP::get_flag_icon($country);
+       my $flag_icon = &Location::Functions::get_flag_icon($country);
 
        # Get country name.
-       my $name = &GeoIP::get_full_country_name($country);
+       my $name = &Location::Functions::get_full_country_name($country);
 
        if ($lines % 2) {
                print "<td $col><a id='$country'><img src='$flag_icon' alt='$country' title='$country'/></a></td>";