function _get_facebook_locale in Facebook social plugins integration 6
Same name and namespace in other branches
- 6.2 fb_social.admin.inc \_get_facebook_locale()
- 7.2 fb_social.admin.inc \_get_facebook_locale()
1 call to _get_facebook_locale()
- fb_social_settings_form in ./
fb_social.admin.inc - Settings form for global fb_social custimazation
File
- ./
fb_social.admin.inc, line 84
Code
function _get_facebook_locale() {
$fb_locale = array();
$cache = cache_get('fb_social');
if (empty($cache->data)) {
$result = drupal_http_request("http://www.facebook.com/translations/FacebookLocales.xml");
$xml = simplexml_load_string($result->data);
foreach ($xml->locale as $line) {
$representation = (array) $line->codes->code->standard->representation;
$name = (array) $line->englishName;
$key = $representation[0];
$value = $name[0];
$fb_locale[$key] = $value;
}
cache_set('fb_social', serialize($fb_locale), 'cache');
}
else {
$fb_locale = unserialize($cache->data);
}
return $fb_locale;
}