You are here

function i18n_string_allowed_format in Internationalization 7

Check whether a string format is allowed for translation.

3 calls to i18n_string_allowed_format()
i18n_string_textgroup_default::string_check in i18n_string/i18n_string.inc
Check if string is ok for translation
i18n_string_translate_access in i18n_string/i18n_string.module
Check user access to translate a specific string.
i18n_string_translate_check_string in i18n_string/i18n_string.module
Check whether there is any problem for the user to translate a specific string.

File

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

Code

function i18n_string_allowed_format($format_id = NULL) {
  if (!$format_id || $format_id === I18N_STRING_FILTER_XSS || $format_id === I18N_STRING_FILTER_XSS_ADMIN) {
    return TRUE;
  }
  else {

    // Check the format still exists an it is in the allowed formats list.
    return filter_format_load($format_id) && in_array($format_id, variable_get('i18n_string_allowed_formats', array(
      filter_fallback_format(),
    )), TRUE);
  }
}