You are here

function themekey_dummy2query_string in ThemeKey 7.2

Same name and namespace in other branches
  1. 7.3 modules/themekey.system.inc \themekey_dummy2query_string()
  2. 7 modules/themekey.system.inc \themekey_dummy2query_string()

ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).

src: system:dummy dst: system:query_string

Parameters

$dummy: string containing current value of ThemeKey property system:dummy

Return value

system:query_string as string or NULL if no value could be mapped

1 string reference to 'themekey_dummy2query_string'
themekey_system_themekey_properties in modules/themekey.system.inc
Implements hook_themekey_properties().

File

modules/themekey.system.inc, line 482
Provides some ThemeKey properties.

Code

function themekey_dummy2query_string($dummy) {
  if (!empty($_SERVER['QUERY_STRING'])) {
    $query_string = trim(preg_replace("/q=[^&]*/", '', $_SERVER['QUERY_STRING']), '&');
    if (!empty($query_string)) {
      return $query_string;
    }
  }
  return NULL;
}