22 $factory = $this->dic->ui()->factory();
23 $request = $this->dic->http()->request();
24 $languages = $this->dic->language()->getInstalledLanguages();
27 return $this->
if->identifier($id);
30 $txt =
function (
string $id) :
string {
31 return $this->dic->language()->txt($id);
37 if ($ref_id = $request->getQueryParams()[
'ref_id']) {
39 if (
$type !=
"root") {
42 } elseif ($target = $request->getQueryParams()[
'target']) {
43 $target = rawurlencode($target);
44 $target_str =
'target=' . $target .
'&';
47 $login_glyph =
$factory->symbol()->glyph()->login();
48 $login = $this->meta_bar->topLinkItem(
$if(
'login'))
49 ->withAction(
"login.php?" . $target_str .
"client_id=" . rawurlencode(
CLIENT_ID) .
"&cmd=force_login&lang=" . $this->dic->user()->getCurrentLanguage())
52 ->withTitle(
$txt(
'log_in'))
53 ->withAvailableCallable(
function () {
56 ->withVisibilityCallable(
function () {
61 $language_selection = $this->meta_bar->topParentItem(
$if(
'language_selection'))
62 ->withSymbol(
$factory->symbol()->glyph()->language())
64 ->withAvailableCallable(
function () {
67 ->withVisibilityCallable(
function () use ($languages) {
68 return count($languages) > 1;
70 ->withTitle(
$txt(
'language'));
77 foreach ($languages as $lang_key) {
79 $language_name = $this->dic->language()->_lookupEntry($lang_key,
"meta",
"meta_l_" . $lang_key);
81 $language_icon =
$factory->symbol()->icon()->standard(
"none", $language_name)
82 ->withAbbreviation($lang_key);
84 $s = $this->meta_bar->linkItem(
$if($lang_key))
85 ->withSymbol($language_icon)
87 ->withTitle($language_name);
89 $language_selection->appendChild($s);
101 return (!$this->dic->user()->isAnonymous() && $this->dic->user()->getId() != 0);
107 $b = preg_match(
"%^.*/login.php$%",
$_SERVER[
"SCRIPT_NAME"]) === 1;
115 $url = (is_int(strpos($existing_url,
"?")))
116 ? $existing_url .
"&" . $addition
117 : $existing_url .
"?" . $addition;
119 $url = str_replace(
"?&",
"?",
$url);
129 return preg_replace(
"/&*lang=[a-z]{2}&*/",
"",
$base);
Interface IdentificationInterface.
withSymbol(Symbol $symbol)
static _lookupType($a_id, $a_reference=false)
lookup object type