aboutsummaryrefslogtreecommitdiff
path: root/mod/translation_editor/views/default/core/settings/account/language.php
blob: 225bccc9731cac9362e8461fb807c4b6c3acda08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
 * Provide a way of setting your language prefs
 *
 * @package Elgg
 * @subpackage Core
 */

if ($user = elgg_get_page_owner_entity()) {
	translation_editor_unregister_translations();
	
	$translations = get_installed_translations();
	
	$value = $CONFIG->language;
	if (!empty($user->language)) {
		$value = $user->language;
	}
	
	if(count($translations ) > 1){
	?>
	<div class="elgg-module elgg-module-info">
		<div class="elgg-head">
			<h3><?php echo elgg_echo('user:set:language'); ?></h3>
		</div>
		<div class="elgg-body">
			<p>
				<?php echo elgg_echo('user:language:label'); ?>:
				<?php
				echo elgg_view("input/dropdown", array(
					'name' => 'language',
					'value' => $value,
					'options_values' => $translations 
				));
				?>
			</p>
		</div>
	</div>
	<?php
	} else {
		echo elgg_view("input/hidden", array("name" => "language", "value" => $value));
	}
}