1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Definition of views_handler_field_user_language.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Views field handler for user language.
|
10
|
*
|
11
|
* @ingroup views_field_handlers
|
12
|
*/
|
13
|
class views_handler_field_user_language extends views_handler_field_user {
|
14
|
|
15
|
/**
|
16
|
* {@inheritdoc}
|
17
|
*/
|
18
|
public function render_link($data, $values) {
|
19
|
$uid = $this->get_value($values, 'uid');
|
20
|
if (!empty($this->options['link_to_user'])) {
|
21
|
$uid = $this->get_value($values, 'uid');
|
22
|
if (user_access('access user profiles') && $uid) {
|
23
|
$this->options['alter']['make_link'] = TRUE;
|
24
|
$this->options['alter']['path'] = 'user/' . $uid;
|
25
|
}
|
26
|
}
|
27
|
if (empty($data)) {
|
28
|
$lang = language_default();
|
29
|
}
|
30
|
else {
|
31
|
$lang = language_list();
|
32
|
$lang = $lang[$data];
|
33
|
}
|
34
|
|
35
|
return $this->sanitize_value($lang->name);
|
36
|
}
|
37
|
|
38
|
}
|