system_get_date_types
function system_get_date_types
system_get_date_types($type = NULL)
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
- modules/system/system.module, line 3564
- 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; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.module/function/system_get_date_types/7.x