You are here

function _datalayer_collect_meta_properties in dataLayer 7

Same name and namespace in other branches
  1. 8 datalayer.module \_datalayer_collect_meta_properties()

Collects up meta data for output.

Parameters

string $type: Entity type to collect meta from, defaults to generic.

Return value

array Array of all candidate entity properties.

3 calls to _datalayer_collect_meta_properties()
datalayer_get_user_data in ./datalayer.module
Return all user data based on configured URL patterns.
datalayer_settings_form in ./datalayer.admin.inc
Form callback for module configuration.
_datalayer_get_entity_data in ./datalayer.module
Collect entity data for output and altering.

File

./datalayer.module, line 141
Client-side data space.

Code

function _datalayer_collect_meta_properties($type = '') {
  $hooks = array();
  if (is_string($type) && !empty($type)) {
    $hooks[] = "datalayer_{$type}_meta";
  }
  $hooks[] = 'datalayer_meta';

  // Avoid duplicate builds.
  $properties =& drupal_static(__FUNCTION__ . $type);
  if (!isset($properties)) {
    $properties = array();
    foreach ($hooks as $hook) {
      foreach (module_implements($hook) as $module) {

        // Call modules implementing datalayer_meta() and combine results.
        $properties = array_merge($properties, module_invoke($module, $hook));
      }
      if (!empty($properties)) {
        break;
      }
    }
    drupal_alter($hooks, $properties);
  }
  return $properties;
}