Returns a prettified location result.
/** * Echo's a pretty formatted location using a specific LocationProvider. * * Input: * The 'id' query parameter must be set to the ID of the LocationProvider to use. * * Output: * The pretty formatted location that was obtained. Will be HTML. */ public function getLocationUsingProvider() { $providerId = Common::getRequestVar('id'); $provider = LocationProvider::getProviderById($providerId); if (empty($provider)) { throw new Exception("Invalid provider ID: '{$providerId}'."); } $location = $provider->getLocation(array('ip' => IP::getIpFromHeader(), 'lang' => Common::getBrowserLanguage(), 'disable_fallbacks' => true)); $location = LocationProvider::prettyFormatLocation($location, $newline = '<br/>', $includeExtra = true); return $location; }