Language.php in Views (for Drupal 7) 8.3
Same filename in this branch
- 8.3 lib/Views/node/Plugin/views/field/Language.php
- 8.3 lib/Views/user/Plugin/views/field/Language.php
- 8.3 lib/Views/language/Plugin/views/filter/Language.php
- 8.3 lib/Views/language/Plugin/views/argument/Language.php
- 8.3 lib/Views/language/Plugin/views/field/Language.php
- 8.3 lib/Views/taxonomy/Plugin/views/field/Language.php
Definition of Views\language\Plugin\views\argument\Language.
Namespace
Views\language\Plugin\views\argumentFile
lib/Views/language/Plugin/views/argument/Language.phpView source
<?php
/**
* @file
* Definition of Views\language\Plugin\views\argument\Language.
*/
namespace Views\language\Plugin\views\argument;
use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
use Drupal\Core\Annotation\Plugin;
/**
* Argument handler to accept a language.
*
* @ingroup views_argument_handlers
*
* @Plugin(
* id = "language",
* module = "language"
* )
*/
class Language extends ArgumentPluginBase {
/**
* Override the behavior of summary_name(). Get the user friendly version
* of the language.
*/
function summary_name($data) {
return $this
->language($data->{$this->name_alias});
}
/**
* Override the behavior of title(). Get the user friendly version
* of the language.
*/
function title() {
return $this
->language($this->argument);
}
function language($langcode) {
$languages = views_language_list();
return isset($languages[$langcode]) ? $languages[$langcode] : t('Unknown language');
}
}