You are here

function themekey_purl_dummy2active_modifier in ThemeKey 7.3

Same name and namespace in other branches
  1. 7.2 modules/themekey.purl.inc \themekey_purl_dummy2active_modifier()

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

src: system:dummy dst: purl:active_modifier

Return value

string or NULL if no value could be mapped

1 string reference to 'themekey_purl_dummy2active_modifier'
themekey_purl_themekey_properties in modules/themekey.purl.inc
Implements hook_themekey_properties().

File

modules/themekey.purl.inc, line 109
@author Markus Kalkbrenner | bio.logis GmbH

Code

function themekey_purl_dummy2active_modifier() {

  // @see http://drupal.org/node/1529892
  purl_init();
  $active_modifiers = array();
  foreach (purl_active()
    ->get() as $method => $items) {
    if (is_array($items)) {
      foreach ($items as $item) {
        if (isset($item->id)) {
          $active_modifiers[] = $item->id;
        }
      }
    }
  }
  if (!empty($active_modifiers)) {
    return $active_modifiers;
  }
  return NULL;
}