You are here

function _themekey_properties_discover in ThemeKey 6

Function _themekey_properties_discover().

1 call to _themekey_properties_discover()
_themekey_settings_form in ./themekey_admin.inc
Function _themekey_settings_form().

File

./themekey_build.inc, line 248

Code

function _themekey_properties_discover($nodediscover = FALSE) {
  $properties = array();

  // Module-exposed properties
  $attributes = variable_get('themekey_attributes', array());
  foreach ($attributes as $property => $details) {
    if (isset($details['path'])) {
      $properties[$property] = $details['path'];
    }
  }

  // URL argument properties
  $result = db_query('SELECT wildcards FROM {themekey_paths} WHERE custom = 0');
  while ($item = db_fetch_array($result)) {
    $item['wildcards'] = unserialize($item['wildcards']);
    foreach ($item['wildcards'] as $wildcard) {
      if (!array_key_exists($wildcard, $properties)) {
        $properties[$wildcard] = $wildcard;
      }
    }
  }

  // Node properties
  if ($nodediscover) {
    $properties = array_merge($properties, _themekey_node_discover());
  }
  return $properties;
}