You are here

function i18n_string_pre_render_text_format in Internationalization 7

The '#pre_render' function to alter the text format element in a translation. The text format for a translation is taken form the original, so the text format drop down should be disabled.

Parameters

array $element: The text_format element which will be rendered.

Return value

array The altered text_format element with a disabled "Text format" select.

1 string reference to 'i18n_string_pre_render_text_format'
i18n_string_element_info_alter in i18n_string/i18n_string.module
Implements hook_element_info_alter().

File

i18n_string/i18n_string.module, line 292
Internationalization (i18n) package - translatable strings.

Code

function i18n_string_pre_render_text_format($element) {
  if (!empty($element['#i18n_string_is_translation'])) {
    $element['format']['format']['#attributes']['disabled'] = TRUE;
  }
  return $element;
}