1 drupal.inc system_get_date_types($type = NULL)

Alters Backdrop's list of defined date formats and attributes to return the expected date types and attributes for Drupal's system_get_date_types() function.

Deprecated

since 1.0.0

Related topics

File

core/includes/drupal.inc, line 2513
Contains constants and function wrappers for Drupal 7.x compatibility.

Code

function system_get_date_types($type = NULL) {
  watchdog_deprecated_function('drupal', __FUNCTION__);
  $formats = system_get_date_formats($type);

  if ($type) {
    foreach ($formats as &$format) {
      $format['type'] = $format['name'];
      $format['title'] = $format['label'];
      $format['locked'] = isset($format['hidden']) ? $format['hidden'] : '0';
      if (!isset($format['module'])) {
        $format['module'] = '';
      }
      $format['is_new'] = FALSE;
    }
  }
  else {
    $formats['type'] = $formats['name'];
    $formats['title'] = $formats['label'];
    $formats['locked'] = isset($formats['hidden']) ? $formats['hidden'] : '0';
    if (!isset($formats['module'])) {
      $formats['module'] = '';
    }
    $formats['is_new'] = FALSE;
  }

  return $formats;
}