You are here

function date_format_type_save in Date 6.2

Save a date format type to the database.

Parameters

$date_format_type: An array of attributes for a date format type.

2 calls to date_format_type_save()
date_date_time_settings_submit in date/date.module
Save date format type to database.
_date_formats_build in ./date_api.module
Builds and returns the list of available date formats.

File

./date_api.module, line 1976
This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.

Code

function date_format_type_save($date_format_type) {
  $type = array();
  $type['type'] = $date_format_type['type'];
  $type['title'] = $date_format_type['title'];
  $type['locked'] = $date_format_type['locked'];

  // Update date_format table.
  if (isset($date_format_type['is_new']) && !empty($date_format_type['is_new'])) {
    drupal_write_record('date_format_types', $type);
  }
  else {
    drupal_write_record('date_format_types', $type, 'type');
  }
}