1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15:
16: class Horde_Core_Ui_Language {
17:
18: 19: 20: 21: 22: 23: 24: 25:
26: static public function render()
27: {
28: global $prefs, $registry, $session;
29:
30: $html = '';
31:
32: if (!$prefs->isLocked('language')) {
33: $session->set('horde', 'language', $registry->preferredLang());
34: $html = sprintf('<form name="language" action="%s">',
35: Horde::url($registry->get('webroot', 'horde') . '/services/language.php', false, -1));
36: $html .= '<input type="hidden" name="url" value="' . @htmlspecialchars(Horde::selfUrl(false, false, true)) . '" />';
37: $html .= '<select name="new_lang" onchange="document.language.submit()">';
38: foreach ($registry->nlsconfig->languages as $key => $val) {
39: $sel = ($key == $session->get('horde', 'language')) ? ' selected="selected"' : '';
40: $html .= "<option value=\"$key\"$sel>$val</option>";
41: }
42: $html .= '</select></form>';
43: }
44:
45: return $html;
46: }
47:
48: }
49: