]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
location-functions.pl: Add get_continent_code() function.
authorStefan Schantl <stefan.schantl@ipfire.org>
Sat, 7 Nov 2020 18:47:22 +0000 (19:47 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 9 Nov 2020 14:07:09 +0000 (14:07 +0000)
This tiny function is used to get the continent code for a given
country code.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/cfgroot/location-functions.pl

index 4837030161c1ed14093837dea2e839c58b0a4c15..e8db4ba9b788fe9a57ec10db61a4e7a5f39173d9 100644 (file)
@@ -190,6 +190,16 @@ sub get_locations() {
        return @sorted_locations;
 }
 
+# Function to get the continent code of a given country code.
+sub get_continent_code($) {
+       my ($country_code) = @_;
+
+       # Use location module to grab the continent code.
+       my $continent_code = &Location::get_continent_code($db_handle, $country_code);
+
+       return $continent_code;
+}
+
 # Function to check if a given address has one ore more special flags.
 sub address_has_flags($) {
        my ($address) = @_;