You are here

function i18n_form_alter_settings in Internationalization 5.3

Same name and namespace in other branches
  1. 5 i18n.module \i18n_form_alter_settings()
  2. 5.2 i18n.module \i18n_form_alter_settings()
  3. 6 i18n.module \i18n_form_alter_settings()

Check for multilingual variables in form

1 call to i18n_form_alter_settings()
i18n_form_alter in ./i18n.module
Implementation of hook_form_alter

File

./i18n.module, line 1051
Internationalization (i18n) module

Code

function i18n_form_alter_settings(&$form, &$variables) {
  $result = 0;
  foreach (element_children($form) as $field) {
    if ($form[$field]['#type'] == 'fieldset') {
      $result += i18n_form_alter_settings($form[$field], $variables);
    }
    elseif (in_array($field, $variables)) {
      $form[$field]['#description'] .= ' <strong>' . t('This is a multilingual variable.') . '</strong>';
      $result++;
    }
  }
  return $result;
}