@@ -96,11 +96,18 @@ public function getAllTypes()
9696 //print_r($res->getSQL());
9797 $ result = $ res -> executeQuery ()->fetchAllAssociative ();
9898
99+ $ listDone = false ;
100+ $ ctypeDone = false ;
99101 foreach ($ result as $ row ) {
100102 if ($ row ['list_type ' ]) {
103+ if (!$ listDone && $ ctypeDone ) {
104+ $ types ['3#0 ' ] = '--- list_types --- ' ;
105+ }
101106 $ types ['1# ' . $ row ['list_type ' ]] = $ row ['list_type ' ];
107+ $ listDone = true ;
102108 } elseif ($ row ['CType ' ] && $ row ['CType ' ] != 'list ' ) {
103109 $ types ['2# ' . $ row ['CType ' ]] = $ row ['CType ' ];
110+ $ ctypeDone = true ;
104111 }
105112 }
106113 return $ types ;
@@ -1438,23 +1445,20 @@ protected function getDomain($uid, $sys_language_uid = 0)
14381445 if (isset ($ root ['is_siteroot ' ])) {
14391446 try {
14401447 $ site = $ this ->siteFinder ->getSiteByPageId ($ root ['uid ' ]); // oder $uid;
1441- $ base = $ site ->getConfiguration ()['base ' ];
1448+ $ host = $ site ->getBase ()->getHost ();
1449+ $ scheme = $ site ->getBase ()->getScheme ();
1450+ $ domain = $ scheme . ':// ' . $ host ;
1451+ //$base = $site->getConfiguration()['base'];
14421452 $ lang = $ site ->getConfiguration ()['languages ' ];
14431453 $ lang = $ lang [$ sys_language_uid ]['base ' ] ?? '' ;
1444- if ((str_starts_with ((string )$ base , 'http ' )) && (str_starts_with ((string )$ lang , 'http ' ))) {
1445- // wenn die Domain beides mal benutzt wird, entfernen wir sie bei der Sprache
1446- $ parse_url = parse_url ((string )$ lang );
1447- $ lang = $ parse_url ['path ' ];
1454+ if (str_starts_with ((string )$ lang , 'http ' )) {
1455+ // Wenn die andere Sprache eine andere Domain hat, dann wird die Domain übernommen.
1456+ $ domain = $ lang ;
1457+ } else {
1458+ $ domain .= $ lang ;
14481459 }
1449- $ domain = rtrim ((string )$ base , '/ ' ) . rtrim ((string )$ lang , '/ ' );
1450- if ((!str_starts_with ((string )$ base , 'http ' )) && (strlen ((string )$ base ) > 4 )) {
1451- if (str_starts_with ((string )$ base , '// ' )) {
1452- // muss nicht sein: $domain = 'http:' . $domain;
1453- } elseif (str_starts_with ((string )$ base , '/ ' )) {
1454- $ domain = 'http:/ ' . $ domain ;
1455- } else {
1456- $ domain = 'http:// ' . $ domain ;
1457- }
1460+ if (str_ends_with ($ domain , '/ ' )) {
1461+ $ domain = substr ($ domain , 0 , -1 );
14581462 }
14591463 } catch (\Exception ) {
14601464 return '' ;
0 commit comments