You are here

function _custom_formatter_convert in Custom Formatters 6

2 calls to _custom_formatter_convert()
custom_formatters_bulk_convert_confirm_submit in ./custom_formatters.admin.inc
custom_formatters_formatter_convert_form_submit in ./custom_formatters.admin.inc

File

./custom_formatters.admin.inc, line 747
Contains administration functions for the Custom Formatters module.

Code

function _custom_formatter_convert($name) {
  $formatter = custom_formatters_formatter($name);

  // Prepare formatter for conversion.
  $formatter->field_types = unserialize($formatter->field_types);
  $formatter->mode = 'advanced';

  // Convert formatter code to advanced formatter code.
  $formatter->code = theme('custom_formatters_convert', $formatter->code);

  // Save formatter.
  drupal_write_record('formatters', $formatter, 'name');
  return $formatter;
}