system_get_date_types

7 system.module system_get_date_types($type = NULL)
8 system.module 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.

7 calls to system_get_date_types()

2 string references to 'system_get_date_types'

File

modules/system/system.module, line 3528
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;
}
Login or register to post comments