Elgg  Version 3.0
language.php
Go to the documentation of this file.
1 <?php
10 
11 if (!$user instanceof ElggUser) {
12  return;
13 }
14 
16 
17 if (count($options) < 2) {
19  '#type' => 'hidden',
20  'name' => 'language',
21  'value' => $user->language,
22  ]);
23 
24  return;
25 }
26 
28  '#type' => 'select',
29  'name' => 'language',
30  'value' => $user->language,
31  'options_values' => $options,
32  '#label' => elgg_echo('user:language:label'),
33 ]);
34 
35 echo elgg_view_module('info', elgg_echo('user:set:language'), $content);
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1395
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$user
Definition: language.php:9
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:1198
elgg echo
Translates a string.
Definition: languages.js:43
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:65
if(count($options)< 2) $content
Definition: language.php:27
if(!$user instanceof ElggUser) $options
Definition: language.php:15
get_installed_translations($calculate_completeness=false)
Return an array of installed translations as an associative array "two letter code" => "native langua...
Definition: languages.php:68