You are here

function messaging_array_info in Messaging 6.4

Same name and namespace in other branches
  1. 6.3 messaging.module \messaging_array_info()
  2. 7 messaging.module \messaging_array_info()

Helper function to get property from an info array

Depending on method and property, returns the full array or a specific property

5 calls to messaging_array_info()
messaging_address_info in ./messaging.module
Returns messaging address properties
messaging_method_info in ./messaging.module
Returns messaging methods properties
messaging_template_message_group in messaging_template/messaging_template.module
Returns information about message groups
messaging_template_type_info in messaging_template/messaging_template.module
Get template type information. It will try to retrieve just this type
messaging_text_filter_info in includes/text.inc
Get information of available filters for message texts

File

./messaging.module, line 818

Code

function messaging_array_info($info, $method = NULL, $property = NULL, $default = NULL) {
  if ($method && $property) {
    return isset($info[$method][$property]) ? $info[$method][$property] : $default;
  }
  elseif ($method) {
    return isset($info[$method]) ? $info[$method] : $default;
  }
  elseif ($property) {

    // Get this property as a list indexed by method
    $props = array();
    foreach ($info as $method => $values) {
      if (isset($values[$property])) {
        $props[$method] = $values[$property];
      }
    }
    return $props;
  }
  else {
    return $info;
  }
}