You are here

function _i18n_string_translate_format_help in Internationalization 7

Help for text format.

1 call to _i18n_string_translate_format_help()
i18n_string_locale_translate_edit_form in i18n_string/i18n_string.pages.inc
User interface for string editing.

File

i18n_string/i18n_string.pages.inc, line 435
Internationalization (i18n) package - translatable strings reusable admin UI.

Code

function _i18n_string_translate_format_help($format_id) {
  $output = '';
  if ($format = filter_format_load($format_id)) {
    $title = t('Text format: @name', array(
      '@name' => $format->name,
    ));
    $tips = theme('filter_tips', array(
      'tips' => _filter_tips($format_id, FALSE),
    ));
  }
  elseif ($format_id == I18N_STRING_FILTER_XSS) {
    $title = t('Standard XSS filter.');
    $allowed_html = '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>';
    $tips[] = t('Allowed HTML tags: @tags', array(
      '@tags' => $allowed_html,
    ));
  }
  elseif ($format_id == I18N_STRING_FILTER_XSS_ADMIN) {
    $title = t('Administration XSS filter.');
    $tips[] = t('It will allow most HTML tags but not scripts nor styles.');
  }
  elseif ($format_id) {
    $title = t('Unknown filter: @name', array(
      '@name' => $format_id,
    ));
  }
  if (!empty($title)) {
    $output .= '<h5>' . $title . '</h5>';
  }
  if (!empty($tips)) {
    $output .= is_array($tips) ? theme('item_list', array(
      'items' => $tips,
    )) : $tips;
  }
  return $output;
}