function system_date_format_type_save

Saves a date type to the database.

Parameters

$type: A date type array containing the following keys:

  • 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.
  • is_new: A boolean indicating whether or not this date type is as of yet unsaved in the database.
2 calls to system_date_format_type_save()
system_add_date_format_type_form_submit in modules/system/system.admin.inc
Process system_add_date_format_type form submissions.
_system_date_formats_build in modules/system/system.module
Builds and returns information about available date formats.

File

modules/system/system.module, line 3911

Code

function system_date_format_type_save($type) {
  $info = array();
  $info['type'] = $type['type'];
  $info['title'] = $type['title'];
  $info['locked'] = $type['locked'];
  // Update date_format table.
  if (!empty($type['is_new'])) {
    drupal_write_record('date_format_type', $info);
  }
  else {
    drupal_write_record('date_format_type', $info, 'type');
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.