function Language::render_link

Overrides User::render_link

1 call to Language::render_link()
Language::render in drupal/core/modules/user/lib/Drupal/user/Plugin/views/field/Language.php
Render the field.

File

drupal/core/modules/user/lib/Drupal/user/Plugin/views/field/Language.php, line 24
Definition of Drupal\user\Plugin\views\field\Language.

Class

Language
Views field handler for user language.

Namespace

Drupal\user\Plugin\views\field

Code

function render_link($data, $values) {
  $uid = $this
    ->get_value($values, 'uid');
  if (!empty($this->options['link_to_user'])) {
    $uid = $this
      ->get_value($values, 'uid');
    if (user_access('access user profiles') && $uid) {
      $this->options['alter']['make_link'] = TRUE;
      $this->options['alter']['path'] = 'user/' . $uid;
    }
  }
  if (empty($data)) {
    $lang = language_default();
  }
  else {
    $lang = language_list();
    $lang = $lang[$data];
  }
  return $this
    ->sanitizeValue($lang->name);
}