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.
7 calls to system_get_date_types()
- locale_date_format_form in modules/
locale/ locale.admin.inc - Provide date localization configuration options to users.
- locale_date_format_form_submit in modules/
locale/ locale.admin.inc - Submit handler for configuring localized date formats on the locale_date_format_form.
- locale_get_localized_date_format in includes/
locale.inc - Select locale date format details from database.
- system_add_date_format_type_form_validate in modules/
system/ system.admin.inc - Validate system_add_date_format_type form submissions.
- system_date_time_settings in modules/
system/ system.admin.inc - Form builder; Configure the site date and time settings.
2 string references to 'system_get_date_types'
- system_add_date_format_type_form in modules/
system/ system.admin.inc - Add new date type.
- system_date_time_settings in modules/
system/ system.admin.inc - Form builder; Configure the site date and time settings.
File
- modules/
system/ system.module, line 3606 - 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;
}