19 lines
503 B
PHP
19 lines
503 B
PHP
<?php
|
|
|
|
class ArticlesHelper {
|
|
|
|
static function getRequestedLanguage(): array {
|
|
list($lang) = input('lang');
|
|
$pl = null;
|
|
$default_explicitly_requested = false;
|
|
if ($lang) {
|
|
$pl = PostLanguage::tryFrom($lang);
|
|
if ($pl && $pl == PostLanguage::getDefault())
|
|
$default_explicitly_requested = true;
|
|
}
|
|
if (!$pl)
|
|
$pl = PostLanguage::getDefault();
|
|
return [$pl, $default_explicitly_requested];
|
|
}
|
|
|
|
} |