You are here

function _themekey_node_discover_properties in ThemeKey 6

Function _themekey_node_discover_properties().

1 call to _themekey_node_discover_properties()
_themekey_node_discover in ./themekey_build.inc
Function _themekey_node_discover().

File

./themekey_build.inc, line 228

Code

function _themekey_node_discover_properties($node, &$properties, $parents = array()) {
  foreach ($node as $property => $value) {
    if (!is_numeric($property) && !array_key_exists($property, $properties)) {
      if (is_array($value)) {
        array_push($parents, $property);
        _themekey_node_discover_properties($value, $properties, $parents);
        array_pop($parents);
      }
      else {
        $element = (count($parents) ? implode(':', $parents) : 'node') . ':' . $property;
        $element_path = (count($parents) ? implode('/', $parents) . '/' : '') . $property;
        $properties[$element] = $element_path;
      }
    }
  }
}