Gets the list of available date types and attributes.
Parameters
$type:
(optional) The date type name.
Return value
An associative array of date type information keyed by the date type name.
Each date type information array has the following elements:
- type: The machine-readable name of the date type.
- title: The human-readable name of the date type.
- locked: A boolean indicating whether or not this date type should be
configurable from the user interface.
- module: The name of the module that defined this date type in its
hook_date_format_types(). An empty string if the date type was
user-defined.
- is_new: A boolean indicating whether or not this date type is as of yet
unsaved in the database.
If $type was defined, only a single associative array with the above
elements is returned.
File
- drupal/modules/system/system.module, line 3586
- Configuration system that lets administrators modify the workings of the site.
Code
function system_get_date_types($type = NULL) {
$types =& drupal_static(__FUNCTION__);
if (!isset($types)) {
$types = _system_date_format_types_build();
}
return $type ? isset($types[$type]) ? $types[$type] : FALSE : $types;
}