You are here

function uc_extra_fields_pane_ucxf_field in Extra Fields Checkout Pane 7

Same name and namespace in other branches
  1. 6.2 uc_extra_fields_pane.module \uc_extra_fields_pane_ucxf_field()

Implementation of hook_ucxf_field().

Updates i18n translation sources for UCXF Fields. This includes:

  • field labels
  • field descriptions
  • default values for text fields.
  • option labels of select fields.

Parameters

UCXF_Field $field: An instance of UCXF_Field.

string $op: The action performed on the field (i.e. 'insert' or 'update').

Return value

void

File

./uc_extra_fields_pane.module, line 575
Module: uc_extra_fields_pane.module

Code

function uc_extra_fields_pane_ucxf_field($field, $op) {
  if (function_exists('i18n_string_update')) {
    switch ($op) {
      case 'insert':
      case 'update':

        // Get strings to update.
        module_load_include('i18n.inc', 'uc_extra_fields_pane');
        $strings = uc_extra_fields_pane_i18n_get_strings($field);
        foreach ($strings as $key => $string) {
          i18n_string_update('ucxf:field:' . $field->db_name . ':' . $key, $string);
        }
        break;
    }
  }
}