You are here

function i18nprofile_fields in Internationalization 5.2

Same name and namespace in other branches
  1. 5.3 i18nprofile/i18nprofile.module \i18nprofile_fields()
  2. 5 i18nprofile/i18nprofile.module \i18nprofile_fields()

Returns field translations

2 calls to i18nprofile_fields()
i18nprofile_form_translate in i18nprofile/i18nprofile.module
Translate form fields for a given category
i18nprofile_profile_alter in i18nprofile/i18nprofile.module
Implementation of hook_profile_alter()

File

i18nprofile/i18nprofile.module, line 438

Code

function i18nprofile_fields($category) {
  static $_fields;
  $language = i18n_get_lang();
  if (!isset($_fields[$category])) {
    $_fields[$category] = array();

    // Some special categories
    $result = db_query("SELECT p.name, p.type, t.* FROM {profile_fields} p INNER JOIN {i18n_profile_fields} t ON p.fid = t.fid WHERE LOWER(p.category) = LOWER('%s') AND t.language='%s'", $category, $language);
    while ($field = db_fetch_object($result)) {
      $_fields[$category][$field->name] = $field;
    }
  }
  return $_fields[$category];
}