You are here

function _ip_geoloc_extract_value in IP Geolocation Views & Maps 8

Same name and namespace in other branches
  1. 7 ip_geoloc.module \_ip_geoloc_extract_value()

Extracts a Views argument value from the supplied string.

Parameters

string $string: The string to parse.

array $view_args: The View arguments.

Return value

string The extracted value.

2 calls to _ip_geoloc_extract_value()
IpGeoLocGlobal::isInRange in src/Services/IpGeoLocGlobal.php
Determines if a value is within the supplied numeric or alphabetical range.
ip_geoloc_is_in_range in ./ip_geoloc.module
Determines if a value is within the supplied numeric or alphabetical range. String comparison is based on the ASCII/UTF8 order, so is case-sensitive.

File

./ip_geoloc.module, line 709
IPGV&M is a mapping engine for Views that contain locations of entities and/or visitors. Google Maps, Leaflet and OpenLayers2 maps are all supported and available through this module. Using a number of optional sources IPGV&M also retrieves…

Code

function _ip_geoloc_extract_value($string, array $view_args) {
  if (preg_match('/^!([0-9])/', $string, $matches)) {
    $arg = $matches[1];
    return isset($view_args[$arg - 1]) ? $view_args[$arg - 1] : arg($arg);
  }
  return $string;
}