public static function prettyFormatLocation($locationInfo, $newline = "\n", $includeExtra = false)
    {
        if ($locationInfo === false) {
            return Piwik::translate('General_Unknown');
        }

        // add latitude/longitude line
        $lines = array();
        if (!empty($locationInfo[self::LATITUDE_KEY])
            && !empty($locationInfo[self::LONGITUDE_KEY])
        ) {
            $lines[] = '(' . $locationInfo[self::LATITUDE_KEY] . ', ' . $locationInfo[self::LONGITUDE_KEY] . ')';
        }

        // add city/state line
        $cityState = array();
        if (!empty($locationInfo[self::CITY_NAME_KEY])) {
            $cityState[] = $locationInfo[self::CITY_NAME_KEY];
        }

        if (!empty($locationInfo[self::REGION_CODE_KEY])) {
            $cityState[] = $locationInfo[self::REGION_CODE_KEY];
        } else if (!empty($locationInfo[self::REGION_NAME_KEY])) {
            $cityState[] = $locationInfo[self::REGION_NAME_KEY];
        }

        if (!empty($cityState)) {
            $lines[] = implode(', ', $cityState);
        }

        // add postal code line
        if (!empty($locationInfo[self::POSTAL_CODE_KEY])) {
            $lines[] = $locationInfo[self::POSTAL_CODE_KEY];
        }

        // add country line
        if (!empty($locationInfo[self::COUNTRY_NAME_KEY])) {
            $lines[] = $locationInfo[self::COUNTRY_NAME_KEY];
        } else if (!empty($locationInfo[self::COUNTRY_CODE_KEY])) {
            $lines[] = $locationInfo[self::COUNTRY_CODE_KEY];
        }

        // add extra information (ISP/Organization)
        if ($includeExtra) {
            $lines[] = '';

            $unknown = Piwik::translate('General_Unknown');

            $org = !empty($locationInfo[self::ORG_KEY]) ? $locationInfo[self::ORG_KEY] : $unknown;
            $lines[] = "Org: $org";

            $isp = !empty($locationInfo[self::ISP_KEY]) ? $locationInfo[self::ISP_KEY] : $unknown;
            $lines[] = "ISP: $isp";
        }

        return implode($newline, $lines);
    }
public static function prettyFormatLocation($locationInfo, $newline = "\n", $includeExtra = false)
    {
        if ($locationInfo === false) {
            return Piwik::translate('General_Unknown');
        }

        // add latitude/longitude line
        $lines = array();
        if (!empty($locationInfo[self::LATITUDE_KEY])
            && !empty($locationInfo[self::LONGITUDE_KEY])
        ) {
            $lines[] = '(' . $locationInfo[self::LATITUDE_KEY] . ', ' . $locationInfo[self::LONGITUDE_KEY] . ')';
        }

        // add city/state line
        $cityState = array();
        if (!empty($locationInfo[self::CITY_NAME_KEY])) {
            $cityState[] = $locationInfo[self::CITY_NAME_KEY];
        }

        if (!empty($locationInfo[self::REGION_CODE_KEY])) {
            $cityState[] = $locationInfo[self::REGION_CODE_KEY];
        } else if (!empty($locationInfo[self::REGION_NAME_KEY])) {
            $cityState[] = $locationInfo[self::REGION_NAME_KEY];
        }

        if (!empty($cityState)) {
            $lines[] = implode(', ', $cityState);
        }

        // add postal code line
        if (!empty($locationInfo[self::POSTAL_CODE_KEY])) {
            $lines[] = $locationInfo[self::POSTAL_CODE_KEY];
        }

        // add country line
        if (!empty($locationInfo[self::COUNTRY_NAME_KEY])) {
            $lines[] = $locationInfo[self::COUNTRY_NAME_KEY];
        } else if (!empty($locationInfo[self::COUNTRY_CODE_KEY])) {
            $lines[] = $locationInfo[self::COUNTRY_CODE_KEY];
        }

        // add extra information (ISP/Organization)
        if ($includeExtra) {
            $lines[] = '';

            $unknown = Piwik::translate('General_Unknown');

            $org = !empty($locationInfo[self::ORG_KEY]) ? $locationInfo[self::ORG_KEY] : $unknown;
            $lines[] = "Org: $org";

            $isp = !empty($locationInfo[self::ISP_KEY]) ? $locationInfo[self::ISP_KEY] : $unknown;
            $lines[] = "ISP: $isp";
        }

        return implode($newline, $lines);
    }
public static function prettyFormatLocation ( $ locationInfo , $ newline = "\n" , $ includeExtra = false ) { if ( $ locationInfo === false ) { return Piwik :: translate ( 'General_Unknown' ) ; } // add latitude/longitude line $ lines = array ( ) ; if ( ! empty ( $ locationInfo [ self :: LATITUDE_KEY ] ) && ! empty ( $ locationInfo [ self :: LONGITUDE_KEY ] ) ) { $ lines [ ] = '(' . $ locationInfo [ self :: LATITUDE_KEY ] . ', ' . $ locationInfo [ self :: LONGITUDE_KEY ] . ')' ; } // add city/state line $ cityState = array ( ) ; if ( ! empty ( $ locationInfo [ self :: CITY_NAME_KEY ] ) ) { $ cityState [ ] = $ locationInfo [ self :: CITY_NAME_KEY ] ; } if ( ! empty ( $ locationInfo [ self :: REGION_CODE_KEY ] ) ) { $ cityState [ ] = $ locationInfo [ self :: REGION_CODE_KEY ] ; } else if ( ! empty ( $ locationInfo [ self :: REGION_NAME_KEY ] ) ) { $ cityState [ ] = $ locationInfo [ self :: REGION_NAME_KEY ] ; } if ( ! empty ( $ cityState ) ) { $ lines [ ] = implode ( ', ' , $ cityState ) ; } // add postal code line if ( ! empty ( $ locationInfo [ self :: POSTAL_CODE_KEY ] ) ) { $ lines [ ] = $ locationInfo [ self :: POSTAL_CODE_KEY ] ; } // add country line if ( ! empty ( $ locationInfo [ self :: COUNTRY_NAME_KEY ] ) ) { $ lines [ ] = $ locationInfo [ self :: COUNTRY_NAME_KEY ] ; } else if ( ! empty ( $ locationInfo [ self :: COUNTRY_CODE_KEY ] ) ) { $ lines [ ] = $ locationInfo [ self :: COUNTRY_CODE_KEY ] ; } // add extra information (ISP/Organization) if ( $ includeExtra ) { $ lines [ ] = '' ; $ unknown = Piwik :: translate ( 'General_Unknown' ) ; $ org = ! empty ( $ locationInfo [ self :: ORG_KEY ] ) ? $ locationInfo [ self :: ORG_KEY ] : $ unknown ; $ lines [ ] = "Org: $org" ; $ isp = ! empty ( $ locationInfo [ self :: ISP_KEY ] ) ? $ locationInfo [ self :: ISP_KEY ] : $ unknown ; $ lines [ ] = "ISP: $isp" ; } return implode ( $ newline , $ lines ) ; }
Returns a prettified location result.

@param array|false $locationInfo
@param string $newline The line separator (ie, \n or <br/>).
@param bool $includeExtra Whether to include ISP/Organization info.
@return string
Returns a prettified location result .