21 $factory = $this->dic->ui()->factory();
22 $request = $this->dic->http()->request();
23 $languages = $this->dic->language()->getInstalledLanguages();
26 return $this->
if->identifier(
$id);
29 $txt =
function (
string $id):
string {
30 return $this->dic->language()->txt(
$id);
36 if (isset($request->getQueryParams()[
'ref_id']) &&
$ref_id = $request->getQueryParams()[
'ref_id']) {
38 if (
$type !=
"root") {
41 } elseif (isset($request->getQueryParams()[
'target']) && $target = $request->getQueryParams()[
'target']) {
42 $target = rawurlencode($target);
43 $target_str =
'target=' . $target .
'&';
46 $login_glyph =
$factory->symbol()->glyph()->login();
47 $login = $this->meta_bar->topLinkItem(
$if(
'login'))
48 ->withAction(
"login.php?" . $target_str .
"client_id=" . rawurlencode(
CLIENT_ID) .
"&cmd=force_login&lang=" . $this->dic->user()->getCurrentLanguage())
51 ->withTitle(
$txt(
'log_in'))
52 ->withAvailableCallable(
function () {
55 ->withVisibilityCallable(
function () use ($request) {
60 $language_selection = $this->meta_bar->topParentItem(
$if(
'language_selection'))
61 ->withSymbol(
$factory->symbol()->glyph()->language())
63 ->withAvailableCallable(
function () {
66 ->withVisibilityCallable(
function () use ($languages) {
67 return count($languages) > 1;
69 ->withTitle(
$txt(
'language'));
73 foreach ($languages as $lang_key) {
75 $language_name = $this->dic->language()->_lookupEntry($lang_key,
"meta",
"meta_l_" . $lang_key);
77 $language_icon =
$factory->symbol()->icon()->standard(
"none", $language_name)
78 ->withAbbreviation($lang_key);
80 $s = $this->meta_bar->linkItem(
$if($lang_key))
81 ->withSymbol($language_icon)
83 ->withTitle($language_name);
85 $language_selection->appendChild($s);
96 return (!$this->dic->user()->isAnonymous() && $this->dic->user()->getId() != 0);
101 $b = preg_match(
"%^.*/login.php$%", $uri->getPath()) === 1;
108 $url = (is_int(strpos($existing_url,
"?")))
109 ? $existing_url .
"&" . $addition
110 : $existing_url .
"?" . $addition;
112 $url = str_replace(
"?&",
"?",
$url);
119 $base = substr($uri->__toString(), strrpos($uri->__toString(),
"/") + 1);
120 return preg_replace(
"/&*lang=[a-z]{2}&*/",
"",
$base);
Interface IdentificationInterface.
withSymbol(Symbol $symbol)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static _lookupType(int $id, bool $reference=false)