diff --git a/components/ILIAS/Accessibility/classes/Criteria/class.ilAccessibilityNullCriterion.php b/components/ILIAS/Accessibility/classes/Criteria/class.ilAccessibilityNullCriterion.php index d933efa319e9..5f252acc0b8d 100755 --- a/components/ILIAS/Accessibility/classes/Criteria/class.ilAccessibilityNullCriterion.php +++ b/components/ILIAS/Accessibility/classes/Criteria/class.ilAccessibilityNullCriterion.php @@ -67,7 +67,7 @@ public function getValuePresentation( ilAccessibilityCriterionConfig $config, Factory $uiFactory ): Component { - return $uiFactory->legacy('-'); + return $uifactory->legacy()->content('-'); } public function getSelection(ilAccessibilityCriterionConfig $config): ilSelectInputGUI diff --git a/components/ILIAS/Accessibility/classes/Criteria/class.ilAccessibilityUserHasLanguageCriterionGUI.php b/components/ILIAS/Accessibility/classes/Criteria/class.ilAccessibilityUserHasLanguageCriterionGUI.php index a57c6440aac6..8ccf6271b786 100755 --- a/components/ILIAS/Accessibility/classes/Criteria/class.ilAccessibilityUserHasLanguageCriterionGUI.php +++ b/components/ILIAS/Accessibility/classes/Criteria/class.ilAccessibilityUserHasLanguageCriterionGUI.php @@ -100,9 +100,9 @@ public function getValuePresentation(ilAccessibilityCriterionConfig $config, Fac $lng = $config['lng'] ?? ''; if (!is_string($lng) || 2 !== strlen($lng)) { - return $uiFactory->legacy(''); + return $uifactory->legacy()->content(''); } - return $uiFactory->legacy($this->lng->txt('meta_l_' . $lng)); + return $uifactory->legacy()->content($this->lng->txt('meta_l_' . $lng)); } } diff --git a/components/ILIAS/Accessibility/classes/Document/class.ilAccessibilityDocumentTableGUI.php b/components/ILIAS/Accessibility/classes/Document/class.ilAccessibilityDocumentTableGUI.php index f72640d751af..7ff9d93e6c9e 100755 --- a/components/ILIAS/Accessibility/classes/Document/class.ilAccessibilityDocumentTableGUI.php +++ b/components/ILIAS/Accessibility/classes/Document/class.ilAccessibilityDocumentTableGUI.php @@ -283,7 +283,7 @@ protected function formatCriterionAssignments(string $column, array $row): strin $typeGui->getIdentPresentation(), ($this->isEditable ? $this->uiRenderer->render($dropDown) : '') ])] = - $this->uiFactory->legacy( + $this->uiFactory->legacy()->content( $this->uiRenderer->render( $typeGui->getValuePresentation( $criterion->getCriterionValue(), diff --git a/components/ILIAS/Administration/GlobalScreen/classes/AdministrationMainBarProvider.php b/components/ILIAS/Administration/GlobalScreen/classes/AdministrationMainBarProvider.php index 9be4159ee0d9..6f1d179185ae 100755 --- a/components/ILIAS/Administration/GlobalScreen/classes/AdministrationMainBarProvider.php +++ b/components/ILIAS/Administration/GlobalScreen/classes/AdministrationMainBarProvider.php @@ -101,7 +101,7 @@ public function getStaticSubItems(): array ->withParent($top) ->withPosition($position * 10) ->withAlwaysAvailable(true) - ->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt('item_must_be_always_active')}")) + ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt('item_must_be_always_active')}")) ->withVisibilityCallable( $access_helper->hasAdministrationAccess() )->withAvailableCallable( diff --git a/components/ILIAS/Administration/GlobalScreen/classes/class.ilAdminGSToolProvider.php b/components/ILIAS/Administration/GlobalScreen/classes/class.ilAdminGSToolProvider.php index 1af42f04f436..34bf036ce61e 100755 --- a/components/ILIAS/Administration/GlobalScreen/classes/class.ilAdminGSToolProvider.php +++ b/components/ILIAS/Administration/GlobalScreen/classes/class.ilAdminGSToolProvider.php @@ -1,7 +1,5 @@ identification_provider->contextAwareIdentifier($id, true); }; $l = function (string $content) { - return $this->dic->ui()->factory()->legacy($content); + return $this->dic->ui()->factory()->legacy()->content($content); }; $tools[] = $this->factory->tool($iff("tree")) ->withTitle("Tree") diff --git a/components/ILIAS/Awareness/GlobalScreen/classes/class.ilAwarenessMetaBarProvider.php b/components/ILIAS/Awareness/GlobalScreen/classes/class.ilAwarenessMetaBarProvider.php index 5339c57fc4a2..c65a388728c6 100755 --- a/components/ILIAS/Awareness/GlobalScreen/classes/class.ilAwarenessMetaBarProvider.php +++ b/components/ILIAS/Awareness/GlobalScreen/classes/class.ilAwarenessMetaBarProvider.php @@ -70,7 +70,7 @@ public function getMetaBarItems(): array $result = $gui->getAwarenessList(true); $online = explode(":", $result["cnt"]); $online = (int) $online[0]; - $content = $this->dic->ui()->factory()->legacy($result["html"]); + $content = $this->dic->ui()->factory()->legacy()->content($result["html"]); if ($online === 0) { $is_widget_visible = false; } diff --git a/components/ILIAS/BackgroundTasks_/classes/class.ilBTPopOverGUI.php b/components/ILIAS/BackgroundTasks_/classes/class.ilBTPopOverGUI.php index a878f1b94ce7..714e9559a40d 100755 --- a/components/ILIAS/BackgroundTasks_/classes/class.ilBTPopOverGUI.php +++ b/components/ILIAS/BackgroundTasks_/classes/class.ilBTPopOverGUI.php @@ -23,7 +23,7 @@ use ILIAS\BackgroundTasks\Task\UserInteraction; use ILIAS\UI\Component\Button\Button; use ILIAS\UI\Component\Button\Shy; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; /** * Class ilBTPopOverGUI @@ -97,11 +97,11 @@ public function getItemForObserver(Bucket $observer): ILIAS\UI\Component\Item\No } $item = $f->item()->notification($title, $icon); -// $item = $item->withProperties([ -// $this->dic->language()->txt('nc_mail_prop_time') => \ilDatePresentation::formatDate( -// new \ilDateTime(time(), IL_CAL_UNIX) -// ) -// ]); + // $item = $item->withProperties([ + // $this->dic->language()->txt('nc_mail_prop_time') => \ilDatePresentation::formatDate( + // new \ilDateTime(time(), IL_CAL_UNIX) + // ) + // ]); $item = $item->withActions($f->dropdown()->standard($actions)); $input = $current_task->getInput(); @@ -123,7 +123,7 @@ public function getItemForObserver(Bucket $observer): ILIAS\UI\Component\Item\No if ($state === State::RUNNING) { $url = $this->getRefreshUrl($observer); //Running Items probably need to refresh themselves, right? - $item = $item->withAdditionalOnLoadCode(fn ($id) => "var notification_item = il.UI.item.notification.getNotificationItemObject($('#$id')); + $item = $item->withAdditionalOnLoadCode(fn($id) => "var notification_item = il.UI.item.notification.getNotificationItemObject($('#$id')); il.BGTask.refreshItem(notification_item,'$url');"); $expected = $current_task->getExpectedTimeOfTaskInSeconds(); @@ -140,14 +140,14 @@ public function getItemForObserver(Bucket $observer): ILIAS\UI\Component\Item\No } - private function getDefaultCardContent(Bucket $observer): Legacy + private function getDefaultCardContent(Bucket $observer): Content { return $this->getProgressbar($observer); } /** - * @return \ILIAS\UI\Component\Legacy\Legacy[]|\ILIAS\UI\Component\Button\Shy[] + * @return \ILIAS\UI\Component\Legacy\Content[]|\ILIAS\UI\Component\Button\Shy[] */ public function getUserInteractionContent(Bucket $observer, string $redirect_uri): array { @@ -157,7 +157,7 @@ public function getUserInteractionContent(Bucket $observer, string $redirect_uri $ctrl = $this->dic->ctrl(); if (!$observer->getCurrentTask() instanceof UserInteraction) { - return [$factory->legacy('')]; + return [$factory->legacy()->content('')]; } /** @var UserInteraction $userInteraction */ $userInteraction = $observer->getCurrentTask(); @@ -193,7 +193,7 @@ function (UserInteraction\Option $option) use ($ctrl, $factory, $observer, $pers } - private function getProgressbar(Bucket $observer): Legacy + private function getProgressbar(Bucket $observer): Content { $percentage = $observer->getOverallPercentage(); @@ -212,7 +212,7 @@ private function getProgressbar(Bucket $observer): Legacy break; } - return $this->dic->ui()->factory()->legacy("
' . print_r($vc_container->getData(), true) . ''), + $f->legacy()->content('
' . print_r($vc_container->getData(), true) . ''), $f->divider()->horizontal(), $vc_container ]); diff --git a/components/ILIAS/UI/src/examples/Input/ViewControl/FieldSelection/base.php b/components/ILIAS/UI/src/examples/Input/ViewControl/FieldSelection/base.php index 59ea936b7eb3..6ba7a5faa9ac 100755 --- a/components/ILIAS/UI/src/examples/Input/ViewControl/FieldSelection/base.php +++ b/components/ILIAS/UI/src/examples/Input/ViewControl/FieldSelection/base.php @@ -32,7 +32,7 @@ function base() ->withRequest($DIC->http()->request()); return $r->render([ - $f->legacy('
' . print_r($vc_container->getData(), true) . ''), + $f->legacy()->content('
' . print_r($vc_container->getData(), true) . ''), $f->divider()->horizontal(), $vc_container ]); diff --git a/components/ILIAS/UI/src/examples/Input/ViewControl/Group/base.php b/components/ILIAS/UI/src/examples/Input/ViewControl/Group/base.php index 16fa159fe512..f44195a00d40 100755 --- a/components/ILIAS/UI/src/examples/Input/ViewControl/Group/base.php +++ b/components/ILIAS/UI/src/examples/Input/ViewControl/Group/base.php @@ -42,7 +42,7 @@ function base(): string ); return $r->render([ - $f->legacy('
' . print_r($vc_container->getData(), true) . ''), + $f->legacy()->content('
' . print_r($vc_container->getData(), true) . ''), $vc_container ]); } diff --git a/components/ILIAS/UI/src/examples/Input/ViewControl/NullControl/base.php b/components/ILIAS/UI/src/examples/Input/ViewControl/NullControl/base.php index 367af6d687a6..c0f3da4a38a0 100644 --- a/components/ILIAS/UI/src/examples/Input/ViewControl/NullControl/base.php +++ b/components/ILIAS/UI/src/examples/Input/ViewControl/NullControl/base.php @@ -24,7 +24,7 @@ function base() ->withRequest($DIC->http()->request()); return $r->render([ - $f->legacy('
' . print_r($vc_container->getData(), true) . ''), + $f->legacy()->content('
' . print_r($vc_container->getData(), true) . ''), $f->divider()->horizontal(), $vc_container ]); diff --git a/components/ILIAS/UI/src/examples/Input/ViewControl/Pagination/base.php b/components/ILIAS/UI/src/examples/Input/ViewControl/Pagination/base.php index bb2292750f85..2be5d714b042 100755 --- a/components/ILIAS/UI/src/examples/Input/ViewControl/Pagination/base.php +++ b/components/ILIAS/UI/src/examples/Input/ViewControl/Pagination/base.php @@ -28,7 +28,7 @@ function base() ->withRequest($DIC->http()->request()); return $r->render([ - $f->legacy('
' . print_r($vc_container->getData(), true) . ''), + $f->legacy()->content('
' . print_r($vc_container->getData(), true) . ''), $f->divider()->horizontal(), $vc_container ]); diff --git a/components/ILIAS/UI/src/examples/Input/ViewControl/Pagination/with_one_page.php b/components/ILIAS/UI/src/examples/Input/ViewControl/Pagination/with_one_page.php index f4b970e9ef04..b498a81be2f7 100644 --- a/components/ILIAS/UI/src/examples/Input/ViewControl/Pagination/with_one_page.php +++ b/components/ILIAS/UI/src/examples/Input/ViewControl/Pagination/with_one_page.php @@ -28,7 +28,7 @@ function with_one_page() ->withRequest($DIC->http()->request()); return $r->render([ - $f->legacy('
' . print_r($vc_container->getData(), true) . ''), + $f->legacy()->content('
' . print_r($vc_container->getData(), true) . ''), $f->divider()->horizontal(), $vc_container ]); diff --git a/components/ILIAS/UI/src/examples/Input/ViewControl/Sortation/base.php b/components/ILIAS/UI/src/examples/Input/ViewControl/Sortation/base.php index 50f535c6f1b8..45ee2c876dee 100755 --- a/components/ILIAS/UI/src/examples/Input/ViewControl/Sortation/base.php +++ b/components/ILIAS/UI/src/examples/Input/ViewControl/Sortation/base.php @@ -31,7 +31,7 @@ function base() ->withRequest($DIC->http()->request()); return $r->render([ - $f->legacy('
' . print_r($vc_container->getData(), true) . ''), + $f->legacy()->content('
' . print_r($vc_container->getData(), true) . ''), $f->divider()->horizontal(), $vc_container ]); diff --git a/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/DynamicallyDistributed/base.php b/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/DynamicallyDistributed/base.php index b388cb488da5..9d92d886296a 100755 --- a/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/DynamicallyDistributed/base.php +++ b/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/DynamicallyDistributed/base.php @@ -19,9 +19,9 @@ function base() $tpl->addCss('assets/ui-examples/css/alignment_examples.css'); $blocks = [ - $ui_factory->legacy('
some content
') + $f->legacy()->content('some content
') ); return $f->mainControls()->metaBar() @@ -399,7 +399,7 @@ function getDemoEntryAchievements(\ILIAS\UI\Factory $f): \ILIAS\UI\Component\Mai return $f->maincontrols()->slate()->legacy( 'Achievements', $symbol, - $f->legacy('content: Achievements') + $f->legacy()->content('content: Achievements') ); } @@ -411,7 +411,7 @@ function getDemoEntryCommunication(\ILIAS\UI\Factory $f): \ILIAS\UI\Component\Ma return $f->maincontrols()->slate()->legacy( 'Communication', $symbol, - $f->legacy('content: Communication') + $f->legacy()->content('content: Communication') ); } @@ -448,7 +448,7 @@ function getDemoEntryAdministration(\ILIAS\UI\Factory $f): \ILIAS\UI\Component\M return $f->maincontrols()->slate()->legacy( 'Administration', $symbol, - $f->legacy('content: Administration') + $f->legacy()->content('content: Administration') ); } @@ -462,7 +462,7 @@ function getDemoEntryTools(\ILIAS\UI\Factory $f): array $slate = $f->maincontrols()->slate()->legacy( 'Help', $symbol, - $f->legacy(' + $f->legacy()->content('Some Text for help entry @@ -482,7 +482,7 @@ function getDemoEntryTools(\ILIAS\UI\Factory $f): array $slate = $f->maincontrols()->slate()->legacy( 'Editor', $symbol, - $f->legacy(' + $f->legacy()->content('
Some Text for editor entry diff --git a/components/ILIAS/UI/src/examples/Layout/Page/Standard/ui_mainbar.php b/components/ILIAS/UI/src/examples/Layout/Page/Standard/ui_mainbar.php index 6f3933a38dbc..b5e17d55327b 100755 --- a/components/ILIAS/UI/src/examples/Layout/Page/Standard/ui_mainbar.php +++ b/components/ILIAS/UI/src/examples/Layout/Page/Standard/ui_mainbar.php @@ -136,7 +136,7 @@ function getUIMainbar(\ILIAS\UI\Factory $f, \ILIAS\Data\URI $uri, bool $condense EOT; $symbol = $f->symbol()->icon()->standard('cat', 'Takatuka Land'); - $slate02 = $f->mainControls()->slate()->legacy('Takatuka Land', $symbol, $f->legacy($contents)); + $slate02 = $f->mainControls()->slate()->legacy('Takatuka Land', $symbol, $f->legacy()->content($contents)); $symbol = $f->symbol()->icon()->standard('cat', 'Schweiz'); $slate03 = $f->mainControls()->slate()->combined('Schweiz', $symbol) @@ -169,7 +169,7 @@ function getUIMainbar(\ILIAS\UI\Factory $f, \ILIAS\Data\URI $uri, bool $condense $mainbar = $mainbar->withToolsButton($tools_btn); $symbol = $f->symbol()->icon()->custom('./components/ILIAS/UI/src/examples/Layout/Page/Standard/question.svg', '')->withSize('small'); - $slate = $f->mainControls()->slate()->legacy('Help', $symbol, $f->legacy('
Some Text for Tool 1 entry
')); + $slate = $f->mainControls()->slate()->legacy('Help', $symbol, $f->legacy()->content('Some Text for Tool 1 entry
')); $tools = ['tool1' => $slate]; foreach ($tools as $id => $entry) { $mainbar = $mainbar->withAdditionalToolEntry($id, $entry); @@ -198,41 +198,41 @@ function getUIContent(\ILIAS\UI\Factory $f, RequestInterface $request): array case 1: $t = 'Tier des Jahres: Fischotter3'; $c = [ - $f->legacy('Der Fischotter (Lutra lutra) ist ein an das Wasserleben angepasster Marder, der zu den besten Schwimmern unter den Landraubtieren zählt.
') + $f->legacy()->content('Der Fischotter (Lutra lutra) ist ein an das Wasserleben angepasster Marder, der zu den besten Schwimmern unter den Landraubtieren zählt.
') ,$f->link()->standard("Quelle: Wikipedia", "https://de.wikipedia.org/wiki/Tier_des_Jahres") ]; break; case 2: $t = 'Tier des Jahres: Maulwurf'; $c = [ - $f->legacy('Der Europäische Maulwurf ist ein mittelgroßer Vertreter der Eurasischen Maulwürfe (Talpa). Er erreicht eine Kopf-Rumpf-Länge von 11,3 bis 15,9 cm, der Schwanz wird 2,5 bis 4,0 cm lang.
') + $f->legacy()->content('Der Europäische Maulwurf ist ein mittelgroßer Vertreter der Eurasischen Maulwürfe (Talpa). Er erreicht eine Kopf-Rumpf-Länge von 11,3 bis 15,9 cm, der Schwanz wird 2,5 bis 4,0 cm lang.
') ,$f->link()->standard("Quelle: Wikipedia", "https://de.wikipedia.org/wiki/Tier_des_Jahres") ]; break; case 3: $t = 'Tier des Jahres: Reh'; $c = [ - $f->legacy('Das Reh springt hoch,
das Reh springt weit.
Warum auch nicht?
Es hat ja Zeit.
Das Reh springt hoch,
das Reh springt weit.
Warum auch nicht?
Es hat ja Zeit.
Der Bachflohkrebs (Gammarus fossarum) ist ein Flohkrebs aus der Familie der Gammaridae und ein typischer Bachbewohner.
Er reagiert als sogenanntes Zeigertier äußerst empfindlich auf Gewässerverschmutzungen.
Der Bachflohkrebs (Gammarus fossarum) ist ein Flohkrebs aus der Familie der Gammaridae und ein typischer Bachbewohner.
Er reagiert als sogenanntes Zeigertier äußerst empfindlich auf Gewässerverschmutzungen.
Die Europäische Wildkatze oder Waldkatze (Felis silvestris) ist eine Kleinkatze, die in Europa von der Iberischen Halbinsel bis Osteuropa (westliche Ukraine), in Italien, auf dem Balkan, in Anatolien, im Kaukasus und in den schottischen Highlands vorkommt.
') + $f->legacy()->content('Die Europäische Wildkatze oder Waldkatze (Felis silvestris) ist eine Kleinkatze, die in Europa von der Iberischen Halbinsel bis Osteuropa (westliche Ukraine), in Italien, auf dem Balkan, in Anatolien, im Kaukasus und in den schottischen Highlands vorkommt.
') ,$f->link()->standard("Quelle: Wikipedia", "https://de.wikipedia.org/wiki/Tier_des_Jahres") ]; break; case 6: $t = 'Frühbarock'; $c = [ - $f->legacy('Der Große Leuchtkäfer bzw. das Große Glühwürmchen oder Große Johannisglühwürmchen (Lampyris noctiluca) ist ein Käfer aus der Familie Leuchtkäfer (Lampyridae).
') + $f->legacy()->content('Der Große Leuchtkäfer bzw. das Große Glühwürmchen oder Große Johannisglühwürmchen (Lampyris noctiluca) ist ein Käfer aus der Familie Leuchtkäfer (Lampyridae).
') ,$f->link()->standard("Quelle: Wikipedia", "https://de.wikipedia.org/wiki/Tier_des_Jahres") ]; break; @@ -240,22 +240,22 @@ function getUIContent(\ILIAS\UI\Factory $f, RequestInterface $request): array case 7: $t = 'Frühbarock'; $c = [ - $f->legacy('etwa 1600 bis 1650
unter italienischer Dominanz, mit etwa Monteverdi, Gabrieli.
etwa 1600 bis 1650
unter italienischer Dominanz, mit etwa Monteverdi, Gabrieli.
etwa 1650 bis 1710
Das französische Musikleben des späten 17. Jahrhunderts wurde maßgeblich von Jean-Baptiste Lully (1632–1687) am Hofe Ludwigs XIV. geprägt.
etwa 1650 bis 1710
Das französische Musikleben des späten 17. Jahrhunderts wurde maßgeblich von Jean-Baptiste Lully (1632–1687) am Hofe Ludwigs XIV. geprägt.
etwa 1710 bis 1750
Entwickelte sich im Hochbarock die Musik noch unabhängig in verschiedenen Regionen Europas, so zeichnete sich der Spätbarock durch eine grenzübergreifende Verbreitung der Stile aus. Im deutschen Raum trieb Georg Philipp Telemann (1681–1767) diese Entwicklung voran und wurde schließlich zur „Ikone“ unter den Tonkünstlern.
etwa 1710 bis 1750
Entwickelte sich im Hochbarock die Musik noch unabhängig in verschiedenen Regionen Europas, so zeichnete sich der Spätbarock durch eine grenzübergreifende Verbreitung der Stile aus. Im deutschen Raum trieb Georg Philipp Telemann (1681–1767) diese Entwicklung voran und wurde schließlich zur „Ikone“ unter den Tonkünstlern.
Better head over to a preview of page to see a mainbar in its entire beauty...
'); + $txt = $f->legacy()->content('Better head over to a preview of page to see a mainbar in its entire beauty...
'); return $renderer->render([ $txt, $to_page diff --git a/components/ILIAS/UI/src/examples/MainControls/MetaBar/base_metabar.php b/components/ILIAS/UI/src/examples/MainControls/MetaBar/base_metabar.php index 35e32a9d261b..9a42da0ddb4c 100755 --- a/components/ILIAS/UI/src/examples/MainControls/MetaBar/base_metabar.php +++ b/components/ILIAS/UI/src/examples/MainControls/MetaBar/base_metabar.php @@ -19,7 +19,7 @@ function base_metabar(): string $renderer = $DIC->ui()->renderer(); $url = $DIC->http()->request()->getUri()->__toString() . '&new_metabar_ui=1'; - $txt = $f->legacy('+ $txt = $f->legacy()->content('
The Metabar Example opens in Fullscreen to showcase the behaviour of the metabar best. Note, an comprensive example for developers on how to access the JS API of the Metabar feature bellow in the second example. @@ -42,7 +42,7 @@ function buildMetabar(\ILIAS\UI\Factory $f): \ILIAS\UI\Component\MainControls\Me $notes = $f->mainControls()->slate()->legacy( 'Notification', $f->symbol()->glyph()->notification(), - $f->legacy('some content') + $f->legacy()->content('some content') ); return $f->mainControls()->metaBar() @@ -101,7 +101,7 @@ function pageMetabarDemoContent(\ILIAS\UI\Factory $f): array return [ $f->panel()->standard( 'All about the Meta Bar', - $f->legacy( + $f->legacy()->content( "See above" ) ), diff --git a/components/ILIAS/UI/src/examples/MainControls/MetaBar/extended_example_for_developers.php b/components/ILIAS/UI/src/examples/MainControls/MetaBar/extended_example_for_developers.php index fd1c2090bb5e..7714ee8ab447 100755 --- a/components/ILIAS/UI/src/examples/MainControls/MetaBar/extended_example_for_developers.php +++ b/components/ILIAS/UI/src/examples/MainControls/MetaBar/extended_example_for_developers.php @@ -64,7 +64,7 @@ function extended_example_for_developers(): string if ($request_wrapper->has('close_item') && $request_wrapper->retrieve('close_item', $refinery->kindlyTo()->string()) === "true") { //Note that we passe back JS logic here for further processing here - $js = $f->legacy("")->withOnLoadCode(function ($id) use ($async_replace_content_load_url) { + $js = $f->legacy()->content("")->withOnLoadCode(function ($id) use ($async_replace_content_load_url) { return " il.DemoScopeRemaining--; il.DemoScopeItem.replaceContentByAsyncItemContent('$async_replace_content_load_url',{remaining: il.DemoScopeRemaining,added: il.DemoScopeAdded}); diff --git a/components/ILIAS/UI/src/examples/MainControls/ModeInfo/modeinfo.php b/components/ILIAS/UI/src/examples/MainControls/ModeInfo/modeinfo.php index 816240ce162f..4aa37bea8378 100755 --- a/components/ILIAS/UI/src/examples/MainControls/ModeInfo/modeinfo.php +++ b/components/ILIAS/UI/src/examples/MainControls/ModeInfo/modeinfo.php @@ -26,7 +26,7 @@ function modeinfo(): string return $renderer->render([ $f->divider()->horizontal(), $f->link()->bulky($icon, 'See UI in fullscreen-mode', $target), - $f->legacy('
press the link above to init a page with Mode Info
press the link above to init a page with Mode Info
The Login Page
"); + $legacy = $f->legacy()->content("The Login Page
"); $modal = $f->modal()->roundtrip("Login", [$legacy])->withActionButtons([$button1, $button2]); } if ($page == "register") { - $legacy = $f->legacy("The Registration Page
"); + $legacy = $f->legacy()->content("The Registration Page
"); $modal = $f->modal()->roundtrip("Registration", [$legacy])->withActionButtons([$button1, $button2]); } diff --git a/components/ILIAS/UI/src/examples/Modal/RoundTrip/show_the_same_modal_with_different_buttons.php b/components/ILIAS/UI/src/examples/Modal/RoundTrip/show_the_same_modal_with_different_buttons.php index ffd0dd273e1a..d6c95fbf4d8f 100755 --- a/components/ILIAS/UI/src/examples/Modal/RoundTrip/show_the_same_modal_with_different_buttons.php +++ b/components/ILIAS/UI/src/examples/Modal/RoundTrip/show_the_same_modal_with_different_buttons.php @@ -21,7 +21,7 @@ function show_the_same_modal_with_different_buttons() $factory = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); - $modal = $factory->modal()->roundtrip('My Modal 1', $factory->legacy('My Content')) + $modal = $factory->modal()->roundtrip('My Modal 1', $factory->legacy()->content('My Content')) ->withActionButtons([ $factory->button()->primary('Primary Action', ''), $factory->button()->standard('Secondary Action', ''), diff --git a/components/ILIAS/UI/src/examples/Panel/Report/base.php b/components/ILIAS/UI/src/examples/Panel/Report/base.php index 6f65411d66e9..9638d71455fc 100755 --- a/components/ILIAS/UI/src/examples/Panel/Report/base.php +++ b/components/ILIAS/UI/src/examples/Panel/Report/base.php @@ -22,9 +22,9 @@ function base() $f = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); - $sub1 = $f->panel()->sub("Sub Panel Title 1", $f->legacy("Some Content")) - ->withFurtherInformation($f->card()->standard("Card Heading")->withSections(array($f->legacy("Card Content")))); - $sub2 = $f->panel()->sub("Sub Panel Title 2", $f->legacy("Some Content")); + $sub1 = $f->panel()->sub("Sub Panel Title 1", $f->legacy()->content("Some Content")) + ->withFurtherInformation($f->card()->standard("Card Heading")->withSections(array($f->legacy()->content("Card Content")))); + $sub2 = $f->panel()->sub("Sub Panel Title 2", $f->legacy()->content("Some Content")); $block = $f->panel()->report("Report Title", array($sub1,$sub2)); diff --git a/components/ILIAS/UI/src/examples/Panel/Report/with_view_controls.php b/components/ILIAS/UI/src/examples/Panel/Report/with_view_controls.php index acd9038c61b4..c5d310bc0120 100755 --- a/components/ILIAS/UI/src/examples/Panel/Report/with_view_controls.php +++ b/components/ILIAS/UI/src/examples/Panel/Report/with_view_controls.php @@ -56,9 +56,9 @@ static function ($carry, $item) use ($presentation_options, $url) { $content = "This is clearly a lot more information!"; } - $sub1 = $f->panel()->sub("Sub Panel Title 1", $f->legacy($content)) - ->withFurtherInformation($f->card()->standard("Card Heading")->withSections(array($f->legacy("Card Content")))); - $sub2 = $f->panel()->sub("Sub Panel Title 2", $f->legacy($content)); + $sub1 = $f->panel()->sub("Sub Panel Title 1", $f->legacy()->content($content)) + ->withFurtherInformation($f->card()->standard("Card Heading")->withSections(array($f->legacy()->content("Card Content")))); + $sub2 = $f->panel()->sub("Sub Panel Title 2", $f->legacy()->content($content)); $block = $f->panel()->report("Report Title", [$sub1, $sub2]) ->withActions($actions) diff --git a/components/ILIAS/UI/src/examples/Panel/Secondary/Legacy/base.php b/components/ILIAS/UI/src/examples/Panel/Secondary/Legacy/base.php index 820491234cad..50e6590e2815 100755 --- a/components/ILIAS/UI/src/examples/Panel/Secondary/Legacy/base.php +++ b/components/ILIAS/UI/src/examples/Panel/Secondary/Legacy/base.php @@ -24,7 +24,7 @@ function base() $factory->button()->shy("GitHub", "https://www.github.com") )); - $legacy = $factory->legacy("Legacy content"); + $legacy = $factory->legacy()->content("Legacy content"); $panel = $factory->panel()->secondary()->legacy( "Legacy panel title", diff --git a/components/ILIAS/UI/src/examples/Panel/Secondary/Legacy/with_all_view_controls.php b/components/ILIAS/UI/src/examples/Panel/Secondary/Legacy/with_all_view_controls.php index 9c05ce27b94c..1f643f638900 100755 --- a/components/ILIAS/UI/src/examples/Panel/Secondary/Legacy/with_all_view_controls.php +++ b/components/ILIAS/UI/src/examples/Panel/Secondary/Legacy/with_all_view_controls.php @@ -124,7 +124,7 @@ static function ($carry, $item) use ($presentation_options, $url) { $std_list = $f->panel()->secondary()->legacy( "List Title", - $f->legacy( + $f->legacy()->content( $renderer->render([ $f->item()->group("Subtitle 1", [ $item1, diff --git a/components/ILIAS/UI/src/examples/Panel/Secondary/Legacy/with_footer.php b/components/ILIAS/UI/src/examples/Panel/Secondary/Legacy/with_footer.php index d9eda258e434..dc339c7888a7 100755 --- a/components/ILIAS/UI/src/examples/Panel/Secondary/Legacy/with_footer.php +++ b/components/ILIAS/UI/src/examples/Panel/Secondary/Legacy/with_footer.php @@ -28,7 +28,7 @@ function with_footer() $html .= $renderer->render($factory->button()->tag($tag, "")); } - $legacy = $factory->legacy($html); + $legacy = $factory->legacy()->content($html); $link = $factory->button()->Shy("Edit Keywords", ""); $panel = $factory->panel()->secondary()->legacy("panel title", $legacy)->withFooter($link); diff --git a/components/ILIAS/UI/src/examples/Panel/Standard/base_text_block.php b/components/ILIAS/UI/src/examples/Panel/Standard/base_text_block.php index 233f273869c9..372a267fc75d 100755 --- a/components/ILIAS/UI/src/examples/Panel/Standard/base_text_block.php +++ b/components/ILIAS/UI/src/examples/Panel/Standard/base_text_block.php @@ -21,7 +21,7 @@ function base_text_block() $panel = $f->panel()->standard( "Panel Title", - $f->legacy("Some Content") + $f->legacy()->content("Some Content") ); return $renderer->render($panel); diff --git a/components/ILIAS/UI/src/examples/Panel/Standard/with_actions.php b/components/ILIAS/UI/src/examples/Panel/Standard/with_actions.php index 5dfca409cc61..4cf00f8cf34a 100755 --- a/components/ILIAS/UI/src/examples/Panel/Standard/with_actions.php +++ b/components/ILIAS/UI/src/examples/Panel/Standard/with_actions.php @@ -27,7 +27,7 @@ function with_actions() $panel = $f->panel()->standard( "Panel Title", - $f->legacy("Some Content") + $f->legacy()->content("Some Content") )->withActions($actions); return $renderer->render($panel); diff --git a/components/ILIAS/UI/src/examples/Panel/Sub/base.php b/components/ILIAS/UI/src/examples/Panel/Sub/base.php index 5d997852324b..15701a1c34df 100755 --- a/components/ILIAS/UI/src/examples/Panel/Sub/base.php +++ b/components/ILIAS/UI/src/examples/Panel/Sub/base.php @@ -22,7 +22,7 @@ function base() $block = $f->panel()->standard( "Panel Title", - $f->panel()->sub("Sub Panel Title", $f->legacy("Some Content")) + $f->panel()->sub("Sub Panel Title", $f->legacy()->content("Some Content")) ); return $renderer->render($block); diff --git a/components/ILIAS/UI/src/examples/Panel/Sub/with_actions.php b/components/ILIAS/UI/src/examples/Panel/Sub/with_actions.php index 32a05d213a46..5f9b48c5438d 100755 --- a/components/ILIAS/UI/src/examples/Panel/Sub/with_actions.php +++ b/components/ILIAS/UI/src/examples/Panel/Sub/with_actions.php @@ -28,7 +28,7 @@ function with_actions() $block = $f->panel()->standard( "Panel Title", - $f->panel()->sub("Sub Panel Title", $f->legacy("Some Content"))->withActions($actions) + $f->panel()->sub("Sub Panel Title", $f->legacy()->content("Some Content"))->withActions($actions) ); return $renderer->render($block); diff --git a/components/ILIAS/UI/src/examples/Panel/Sub/with_card.php b/components/ILIAS/UI/src/examples/Panel/Sub/with_card.php index a139a63df626..37a6929e665c 100755 --- a/components/ILIAS/UI/src/examples/Panel/Sub/with_card.php +++ b/components/ILIAS/UI/src/examples/Panel/Sub/with_card.php @@ -24,8 +24,8 @@ function with_card() $block = $f->panel()->standard( "Panel Title", - $f->panel()->sub("Sub Panel Title", $f->legacy("Some Content")) - ->withFurtherInformation($f->card()->standard("Card Heading")->withSections(array($f->legacy("Card Content")))) + $f->panel()->sub("Sub Panel Title", $f->legacy()->content("Some Content")) + ->withFurtherInformation($f->card()->standard("Card Heading")->withSections(array($f->legacy()->content("Card Content")))) ); return $renderer->render($block); diff --git a/components/ILIAS/UI/src/examples/Panel/Sub/with_secondary_panel.php b/components/ILIAS/UI/src/examples/Panel/Sub/with_secondary_panel.php index fb4f4a3221b0..0b71adba4348 100755 --- a/components/ILIAS/UI/src/examples/Panel/Sub/with_secondary_panel.php +++ b/components/ILIAS/UI/src/examples/Panel/Sub/with_secondary_panel.php @@ -50,7 +50,7 @@ function with_secondary_panel() $block = $f->panel()->standard( "Panel Title", - $f->panel()->sub("Sub Panel Title", $f->legacy("Some Content")) + $f->panel()->sub("Sub Panel Title", $f->legacy()->content("Some Content")) ->withFurtherInformation($panel) ); diff --git a/components/ILIAS/UI/src/examples/Popover/Standard/show_card_in_popover.php b/components/ILIAS/UI/src/examples/Popover/Standard/show_card_in_popover.php index 35bbe6254351..92f494d29317 100755 --- a/components/ILIAS/UI/src/examples/Popover/Standard/show_card_in_popover.php +++ b/components/ILIAS/UI/src/examples/Popover/Standard/show_card_in_popover.php @@ -28,7 +28,7 @@ function show_card_in_popover() $renderer = $DIC->ui()->renderer(); $image = $factory->image()->responsive("./assets/images/logo/HeaderIcon.svg", "Thumbnail Example"); - $card = $factory->card()->standard("Title", $image)->withSections(array($factory->legacy("Hello World, I'm a card"))); + $card = $factory->card()->standard("Title", $image)->withSections(array($factory->legacy()->content("Hello World, I'm a card"))); $popover = $factory->popover()->standard($card)->withTitle('Card'); $button = $factory->button()->standard('Show Card', '#') ->withOnClick($popover->getShowSignal()); diff --git a/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_async_loaded_content.php b/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_async_loaded_content.php index 45236160432f..9800b51fa8d2 100755 --- a/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_async_loaded_content.php +++ b/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_async_loaded_content.php @@ -33,13 +33,13 @@ function show_popover_with_async_loaded_content() // This is the ajax request to load the content of the popover. During the ajax request, // a loading spinner is presented to the user. Check the code below on how to construct the popover, // e.g. using Popover::withAsyncContentUrl(). - $content = $factory->legacy('This text is rendered async'); + $content = $factory->legacy()->content('This text is rendered async'); echo $renderer->render($content); exit(); } $async_url = $_SERVER['REQUEST_URI'] . '&renderPopoverAsync=1'; - $popover = $factory->popover()->standard($factory->legacy('')) + $popover = $factory->popover()->standard($factory->legacy()->content('')) ->withTitle('Popover') ->withAsyncContentUrl($async_url); $button = $factory->button()->standard('Show Popover', '#') diff --git a/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_different_positions.php b/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_different_positions.php index 2086eee3e0c0..362000ecf24c 100755 --- a/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_different_positions.php +++ b/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_different_positions.php @@ -26,18 +26,18 @@ function show_popover_with_different_positions() $factory = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); - $content = $factory->legacy('The position of this popover is calculated automatically based on the available space. Note that the max width CSS setting is used here, as this text is quite long.'); + $content = $factory->legacy()->content('The position of this popover is calculated automatically based on the available space. Note that the max width CSS setting is used here, as this text is quite long.'); $popover = $factory->popover()->standard($content); $button = $factory->button()->standard('Auto Popover', '#') ->withOnClick($popover->getShowSignal()); - $content = $factory->legacy('The position of this popover is either on top or bottom of the triggerer, based on the available space'); + $content = $factory->legacy()->content('The position of this popover is either on top or bottom of the triggerer, based on the available space'); $popover2 = $factory->popover()->standard($content) ->withVerticalPosition(); $button2 = $factory->button()->standard('Vertical Popover', '#') ->withOnClick($popover2->getShowSignal()); - $content = $factory->legacy('The position of this popover is either on the left or right of the triggerer, based on the available space'); + $content = $factory->legacy()->content('The position of this popover is either on the left or right of the triggerer, based on the available space'); $popover3 = $factory->popover()->standard($content) ->withHorizontalPosition(); $button3 = $factory->button()->standard('Horizontal Popover', '#') diff --git a/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_dynamic_changing_content.php b/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_dynamic_changing_content.php index f58b16221cac..3b1d5915e62c 100755 --- a/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_dynamic_changing_content.php +++ b/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_dynamic_changing_content.php @@ -62,13 +62,13 @@ function show_popover_with_dynamic_changing_content() $replaceSignal = new ReplaceContentSignal($signalId); $button = $factory->button()->standard('Back to Overview', '#') ->withOnClick($replaceSignal->withAsyncRenderUrl($url . '&page=overview&replaceSignal=' . $signalId)); - $intro = $factory->legacy("You are viewing page $page
"); + $intro = $factory->legacy()->content("You are viewing page $page
"); echo $renderer->renderAsync([$intro, $button]); exit(); } // This is the "normal" request to render the popover. Any content of the popover is rendered async. - $popover = $factory->popover()->standard($factory->legacy(''))->withTitle('Pages'); + $popover = $factory->popover()->standard($factory->legacy()->content(''))->withTitle('Pages'); $asyncUrl = $url . '&page=overview&replaceSignal=' . $popover->getReplaceContentSignal()->getId(); $popover = $popover->withAsyncContentUrl($asyncUrl); $button = $factory->button()->standard('Show Popover', '#') diff --git a/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_vertical_scrollbars.php b/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_vertical_scrollbars.php index dc0d58f39e0b..aa3a0d514d8f 100755 --- a/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_vertical_scrollbars.php +++ b/components/ILIAS/UI/src/examples/Popover/Standard/show_popover_with_vertical_scrollbars.php @@ -50,7 +50,7 @@ function show_popover_with_vertical_scrollbars() // height of the list to 200px and display vertical scrollbars, if needed. $content = "' . htmlentities($renderer->render($response)) . '' diff --git a/components/ILIAS/UI/src/examples/Table/Ordering/base.php b/components/ILIAS/UI/src/examples/Table/Ordering/base.php index 8fb0a0a8174e..2843cc781d9c 100644 --- a/components/ILIAS/UI/src/examples/Table/Ordering/base.php +++ b/components/ILIAS/UI/src/examples/Table/Ordering/base.php @@ -152,7 +152,7 @@ public function setOrder(array $ordered): void && $request_wrapper->retrieve('ordering_example', $refinery->kindlyTo()->int()) === 1 ) { if ($data = $table->getData()) { - $out[] = $f->legacy('
' . print_r($data, true) . ''); + $out[] = $f->legacy()->content('
' . print_r($data, true) . ''); } $data_retrieval->setOrder($data); } diff --git a/components/ILIAS/UI/tests/Base.php b/components/ILIAS/UI/tests/Base.php index e2a04591abeb..10468baf89ab 100755 --- a/components/ILIAS/UI/tests/Base.php +++ b/components/ILIAS/UI/tests/Base.php @@ -75,7 +75,7 @@ public function listing(): C\Listing\Factory public function image(): C\Image\Factory { } - public function legacy(string $content): C\Legacy\Legacy + public function legacy(): C\Legacy\Factory { } public function panel(): C\Panel\Factory diff --git a/components/ILIAS/UI/tests/Component/Card/CardTest.php b/components/ILIAS/UI/tests/Component/Card/CardTest.php index a4f159b481d8..a833c918e41a 100755 --- a/components/ILIAS/UI/tests/Component/Card/CardTest.php +++ b/components/ILIAS/UI/tests/Component/Card/CardTest.php @@ -33,10 +33,9 @@ class CardTest extends ILIAS_UI_TestBase public function getFactory(): NoUIFactory { return new class () extends NoUIFactory { - public function legacy($content): C\Legacy\Legacy + public function legacy(): C\Legacy\Factory { - $f = new I\Component\Legacy\Factory(new I\Component\SignalGenerator()); - return $f->legacy($content); + return new I\Component\Legacy\Factory(new I\Component\SignalGenerator()); } }; } @@ -138,7 +137,7 @@ public function testWithSection(): void { $f = $this->getFactory(); $c = $this->getBaseCard(); - $content = $f->legacy("Random Content"); + $content = $f->legacy()->content("Random Content"); $c = $c->withSections(array($content)); $this->assertEquals($c->getSections(), array($content)); @@ -148,7 +147,7 @@ public function testRenderContentFull(): void { $r = $this->getDefaultRenderer(); $c = $this->getBaseCard(); - $content = $this->getFactory()->legacy("Random Content"); + $content = $this->getfactory()->legacy()->content("Random Content"); $c = $c->withSections(array($content)); diff --git a/components/ILIAS/UI/tests/Component/Card/RepositoryObjectTest.php b/components/ILIAS/UI/tests/Component/Card/RepositoryObjectTest.php index 0e6efeb1f21b..313954b10e9c 100755 --- a/components/ILIAS/UI/tests/Component/Card/RepositoryObjectTest.php +++ b/components/ILIAS/UI/tests/Component/Card/RepositoryObjectTest.php @@ -44,10 +44,9 @@ public function __construct( protected array $mocks ) { } - public function legacy($content): C\Legacy\Legacy + public function legacy(): C\Legacy\Factory { - $f = new I\Component\Legacy\Factory(new I\Component\SignalGenerator()); - return $f->legacy($content); + return new I\Component\Legacy\Factory(new I\Component\SignalGenerator()); } public function button(): C\Button\Factory { diff --git a/components/ILIAS/UI/tests/Component/Dropzone/File/WrapperTest.php b/components/ILIAS/UI/tests/Component/Dropzone/File/WrapperTest.php index ce047d5a066b..fdc93c49d8b9 100755 --- a/components/ILIAS/UI/tests/Component/Dropzone/File/WrapperTest.php +++ b/components/ILIAS/UI/tests/Component/Dropzone/File/WrapperTest.php @@ -20,7 +20,7 @@ namespace ILIAS\Tests\UI\Component\Dropzone\File; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Implementation\Component\Input\Field\Text; require_once("./components/ILIAS/UI/tests/Component/Dropzone/File/FileTestBase.php"); @@ -54,7 +54,7 @@ public function testRenderWrapper(): void ' ); - $legacy_mock = $this->createMock(Legacy::class); + $legacy_mock = $this->createMock(Content::class); $legacy_mock->method('getCanonicalName')->willReturn($expected_legacy_html); $dropzone = $this->factory->wrapper($expected_title, $expected_url, $legacy_mock, $this->input); diff --git a/components/ILIAS/UI/tests/Component/Entity/EntityTest.php b/components/ILIAS/UI/tests/Component/Entity/EntityTest.php index 88ba38c74dee..caa040626299 100755 --- a/components/ILIAS/UI/tests/Component/Entity/EntityTest.php +++ b/components/ILIAS/UI/tests/Component/Entity/EntityTest.php @@ -24,7 +24,7 @@ use ILIAS\UI\Implementation\Component\Link; use ILIAS\UI\Implementation\Component\Image; use ILIAS\UI\Implementation\Component\Dropdown; -use ILIAS\UI\Implementation\Component\Legacy\Legacy; +use ILIAS\UI\Implementation\Component\Legacy\Content; use ILIAS\UI\Implementation\Component\SignalGenerator; use ILIAS\UI\Component as I; use ILIAS\UI\Factory as UIFactory; @@ -36,9 +36,9 @@ protected function getEntityFactory(): Entity\Factory return new Entity\Factory(); } - protected function legacy(string $string): Legacy + protected function legacy(string $string): Content { - return new Legacy($string, (new SignalGenerator())); + return new Content($string, (new SignalGenerator())); } public function testEntityFactory(): void diff --git a/components/ILIAS/UI/tests/Component/Input/Container/Filter/FilterInputTest.php b/components/ILIAS/UI/tests/Component/Input/Container/Filter/FilterInputTest.php index c24229aa3553..ac26920039d8 100644 --- a/components/ILIAS/UI/tests/Component/Input/Container/Filter/FilterInputTest.php +++ b/components/ILIAS/UI/tests/Component/Input/Container/Filter/FilterInputTest.php @@ -51,9 +51,9 @@ public function popover(): I\Popover\Factory return $this->popover_factory; } - public function legacy($content): I\Legacy\Legacy + public function legacy(): I\Legacy\Factory { - return $this->legacy_factory->legacy(""); + return $this->legacy_factory; } } @@ -100,7 +100,11 @@ protected function buildPopoverFactory(): I\Popover\Factory protected function buildLegacyFactory(): I\Legacy\Factory { - return new I\Legacy\Factory(new I\SignalGenerator()); + $mock = $this->createMock(I\Legacy\Factory::class); + $mock->method('content')->willReturn( + new I\Legacy\Content('', new I\SignalGenerator()) + ); + return $mock; } public function getUIFactory(): FilterInputsTestNoUIFactories diff --git a/components/ILIAS/UI/tests/Component/Input/Container/Filter/StandardFilterTest.php b/components/ILIAS/UI/tests/Component/Input/Container/Filter/StandardFilterTest.php index 19e33c6d59e7..674fada8ccef 100755 --- a/components/ILIAS/UI/tests/Component/Input/Container/Filter/StandardFilterTest.php +++ b/components/ILIAS/UI/tests/Component/Input/Container/Filter/StandardFilterTest.php @@ -62,9 +62,9 @@ public function popover(): I\Popover\Factory return $this->popover_factory; } - public function legacy($content): I\Legacy\Legacy + public function legacy(): I\Legacy\Factory { - return $this->legacy_factory->legacy(""); + return $this->legacy_factory; } public function listing(): I\Listing\Factory @@ -121,7 +121,11 @@ protected function buildPopoverFactory(): I\Popover\Factory protected function buildLegacyFactory(): I\Legacy\Factory { - return new I\Legacy\Factory(new I\SignalGenerator()); + $mock = $this->createMock(I\Legacy\Factory::class); + $mock->method('content')->willReturn( + new I\Legacy\Content('', new I\SignalGenerator()) + ); + return $mock; } protected function buildListingFactory(): I\Listing\Factory diff --git a/components/ILIAS/UI/tests/Component/Item/ItemNotificationTest.php b/components/ILIAS/UI/tests/Component/Item/ItemNotificationTest.php index 3e1718ed2662..0197a61652ff 100755 --- a/components/ILIAS/UI/tests/Component/Item/ItemNotificationTest.php +++ b/components/ILIAS/UI/tests/Component/Item/ItemNotificationTest.php @@ -167,7 +167,7 @@ public function testWithAdditionalContent(): void { $f = $this->getUIFactory()->item(); - $content = new I\Component\Legacy\Legacy("someContent", $this->sig_gen); + $content = new I\Component\Legacy\Content("someContent", $this->sig_gen); $c = $f->notification("title", $this->getIcon())->withAdditionalContent($content); $this->assertEquals($c->getAdditionalContent(), $content); @@ -207,7 +207,7 @@ public function getOnLoadCodeAsync(): string }); $props = array("prop1" => "val1", "prop2" => "val2"); - $content = new I\Component\Legacy\Legacy("someContent", $this->sig_gen); + $content = new I\Component\Legacy\Content("someContent", $this->sig_gen); $actions = new I\Component\Dropdown\Standard(array( new I\Component\Button\Shy("ILIAS", "https://www.ilias.de"), new I\Component\Button\Shy("GitHub", "https://www.github.com") diff --git a/components/ILIAS/UI/tests/Component/Layout/Alignment/AlignmentTest.php b/components/ILIAS/UI/tests/Component/Layout/Alignment/AlignmentTest.php index 71ec3672ad99..b84d485c827f 100755 --- a/components/ILIAS/UI/tests/Component/Layout/Alignment/AlignmentTest.php +++ b/components/ILIAS/UI/tests/Component/Layout/Alignment/AlignmentTest.php @@ -33,8 +33,8 @@ public function testAlignmentBasicConstruction(): void { $f = new C\Layout\Alignment\Factory(); $blocks = [ - new C\Legacy\Legacy('block', new C\SignalGenerator()), - new C\Legacy\Legacy('block', new C\SignalGenerator()) + new C\Legacy\Content('block', new C\SignalGenerator()), + new C\Legacy\Content('block', new C\SignalGenerator()) ]; $vert = $f->vertical(...$blocks); $this->assertInstanceOf(I\Layout\Alignment\Alignment::class, $vert); @@ -51,8 +51,8 @@ public function testAlignmentEvenlyRendering(): void { $f = new C\Layout\Alignment\Factory(); $blocks = [ - new C\Legacy\Legacy('block', new C\SignalGenerator()), - new C\Legacy\Legacy('block', new C\SignalGenerator()) + new C\Legacy\Content('block', new C\SignalGenerator()), + new C\Legacy\Content('block', new C\SignalGenerator()) ]; $renderer = $this->getDefaultRenderer(); @@ -72,8 +72,8 @@ public function testAlignmentDynamicalRendering(): void { $f = new C\Layout\Alignment\Factory(); $blocks = [ - new C\Legacy\Legacy('block', new C\SignalGenerator()), - new C\Legacy\Legacy('block', new C\SignalGenerator()) + new C\Legacy\Content('block', new C\SignalGenerator()), + new C\Legacy\Content('block', new C\SignalGenerator()) ]; $renderer = $this->getDefaultRenderer(); @@ -92,8 +92,8 @@ public function testAlignmentVerticalRendering(): void { $f = new C\Layout\Alignment\Factory(); $blocks = [ - new C\Legacy\Legacy('block', new C\SignalGenerator()), - new C\Legacy\Legacy('block', new C\SignalGenerator()) + new C\Legacy\Content('block', new C\SignalGenerator()), + new C\Legacy\Content('block', new C\SignalGenerator()) ]; $renderer = $this->getDefaultRenderer(); diff --git a/components/ILIAS/UI/tests/Component/Layout/Page/StandardPageTest.php b/components/ILIAS/UI/tests/Component/Layout/Page/StandardPageTest.php index 6c0c62ea9409..abd855bb447b 100755 --- a/components/ILIAS/UI/tests/Component/Layout/Page/StandardPageTest.php +++ b/components/ILIAS/UI/tests/Component/Layout/Page/StandardPageTest.php @@ -28,7 +28,7 @@ use ILIAS\UI\Component\Image\Image; use ILIAS\UI\Component\Toast\Container; use ILIAS\UI\Implementation\Component\Layout\Page; -use ILIAS\UI\Implementation\Component\Legacy\Legacy; +use ILIAS\UI\Implementation\Component\Legacy\Content; use ILIAS\UI\Implementation\Component\SignalGenerator; use ILIAS\UI\Implementation\Component\Breadcrumbs\Breadcrumbs as Crumbs; use ILIAS\UI\Implementation\Component\Link\Standard as CrumbEntry; @@ -72,7 +72,7 @@ public function setUp(): void $this->responsive_logo->method("getCanonicalName")->willReturn("Responsive Logo Stub"); $this->overlay = $this->createMock(Container::class); $this->overlay->method("getCanonicalName")->willReturn("Overlay Stub"); - $this->contents = array(new Legacy('some content', $sig_gen)); + $this->contents = array(new Content('some content', $sig_gen)); $this->title = 'pagetitle'; $this->factory = new Page\Factory(); diff --git a/components/ILIAS/UI/tests/Component/Legacy/LegacyTest.php b/components/ILIAS/UI/tests/Component/Legacy/LegacyTest.php index 77515cc96173..3b04b421b504 100755 --- a/components/ILIAS/UI/tests/Component/Legacy/LegacyTest.php +++ b/components/ILIAS/UI/tests/Component/Legacy/LegacyTest.php @@ -32,9 +32,9 @@ class LegacyTest extends ILIAS_UI_TestBase public function getUIFactory(): NoUIFactory { return new class () extends NoUIFactory { - public function legacy(string $content): C\Legacy\Legacy + public function legacy(): C\Legacy\Factory { - return new IC\Legacy\Legacy($content, new IC\SignalGenerator()); + return new IC\Legacy\Factory(new IC\SignalGenerator()); } }; } @@ -45,15 +45,15 @@ public function testImplementsFactoryInterface(): void $this->assertInstanceOf("ILIAS\\UI\\Factory", $f); $this->assertInstanceOf( - "ILIAS\\UI\\Component\\Legacy\\Legacy", - $f->legacy("Legacy Content") + "ILIAS\\UI\\Component\\Legacy\\Content", + $f->legacy()->content("Legacy Content") ); } public function testGetContent(): void { $f = $this->getUIFactory(); - $g = $f->legacy("Legacy Content"); + $g = $f->legacy()->content("Legacy Content"); $this->assertEquals("Legacy Content", $g->getContent()); } @@ -64,7 +64,7 @@ public function testRenderContent(): void $f = $this->getUIFactory(); $r = $this->getDefaultRenderer(); - $g = $f->legacy("Legacy Content"); + $g = $f->legacy()->content("Legacy Content"); $this->assertEquals("Legacy Content", $r->render($g)); } @@ -77,14 +77,14 @@ public function testCreateWithCustomSignal(): void $f = $this->getUIFactory(); $signal_name = 'Custom Signal'; - $f->legacy('')->withCustomSignal($signal_name, ''); + $f->legacy()->content('')->withCustomSignal($signal_name, ''); } public function testGetExistingCustomSignal(): void { $f = $this->getUIFactory(); $signal_name = 'Custom Signal'; - $g = $f->legacy('')->withCustomSignal($signal_name, ''); + $g = $f->legacy()->content('')->withCustomSignal($signal_name, ''); $this->assertNotNull($g->getCustomSignal($signal_name)); } @@ -93,7 +93,7 @@ public function testGetNonExistingCustomSignal(): void { $f = $this->getUIFactory(); $signal_name = 'Custom Signal'; - $g = $f->legacy(''); + $g = $f->legacy()->content(''); $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage("Signal with name $signal_name is not registered"); @@ -106,7 +106,7 @@ public function testGetListOfSignals(): void $signal_name_1 = 'Custom Signal 1'; $signal_name_2 = 'Custom Signal 2'; - $g = $f->legacy('')->withCustomSignal($signal_name_1, '')->withCustomSignal($signal_name_2, ''); + $g = $f->legacy()->content('')->withCustomSignal($signal_name_1, '')->withCustomSignal($signal_name_2, ''); $l = $g->getAllCustomSignals(); $this->assertIsArray($l); @@ -120,7 +120,7 @@ public function testGetListWithCustomSignalsAndCode(): void $signal_name_2 = 'Custom Signal 2'; $custom_code_2 = 'custom_js2();'; - $g = $f->legacy('') + $g = $f->legacy()->content('') ->withCustomSignal($signal_name_1, $custom_code_1) ->withCustomSignal($signal_name_2, $custom_code_2); $signal_list = $g->getAllCustomSignals(); diff --git a/components/ILIAS/UI/tests/Component/MainControls/MainBarTest.php b/components/ILIAS/UI/tests/Component/MainControls/MainBarTest.php index e9211b74fe19..49d0cf14d1c1 100755 --- a/components/ILIAS/UI/tests/Component/MainControls/MainBarTest.php +++ b/components/ILIAS/UI/tests/Component/MainControls/MainBarTest.php @@ -210,10 +210,9 @@ public function mainControls(): C\MainControls\Factory $slate_factory = new I\MainControls\Slate\Factory($sig_gen, $counter_factory, $symbol_factory); return new I\MainControls\Factory($sig_gen, $slate_factory); } - public function legacy(string $content): C\Legacy\Legacy + public function legacy(): C\Legacy\Factory { - $sig_gen = new I\SignalGenerator(); - return new I\Legacy\Legacy($content, $sig_gen); + return new I\Legacy\Factory($sig_gen); } }; $factory->button_factory = $this->button_factory; @@ -234,7 +233,7 @@ public function testRendering(): void ) ); - $toolslate = $sf->legacy('Help', $icon, new I\Legacy\Legacy('Help', new I\SignalGenerator())); + $toolslate = $sf->legacy('Help', $icon, new I\Legacy\Content('Help', new I\SignalGenerator())); $mb = $this->factory->mainBar() ->withAdditionalEntry('test1', $this->getButton()) diff --git a/components/ILIAS/UI/tests/Component/Menu/Drilldown/DrilldownTest.php b/components/ILIAS/UI/tests/Component/Menu/Drilldown/DrilldownTest.php index 0710c9635046..92a85d1894cc 100755 --- a/components/ILIAS/UI/tests/Component/Menu/Drilldown/DrilldownTest.php +++ b/components/ILIAS/UI/tests/Component/Menu/Drilldown/DrilldownTest.php @@ -34,7 +34,7 @@ class DrilldownTest extends ILIAS_UI_TestBase protected C\Symbol\Glyph\Glyph $glyph; protected C\Button\Standard $button; protected C\Divider\Horizontal $divider; - protected C\Legacy\Legacy $legacy; + protected C\Legacy\Content $legacy; public function getUIFactory(): NoUIFactory { @@ -49,12 +49,9 @@ public function button(): C\Button\Factory { return new I\Button\Factory(); } - public function legacy(string $content): C\Legacy\Legacy + public function legacy(): C\Legacy\Factory { - return new I\Legacy\Legacy( - $content, - new I\SignalGenerator() - ); + return new I\Legacy\Factory(new I\SignalGenerator()); } public function symbol(): \ILIAS\UI\Component\Symbol\Factory { @@ -77,7 +74,7 @@ public function setUp(): void $this->glyph = $glyph_factory->user(''); $this->button = $button_factory->standard('', ''); $this->divider = $divider_factory->horizontal(); - $this->legacy = $this->getUIFactory()->legacy(''); + $this->legacy = $this->getUIFactory()->legacy()->content(''); } public function testConstruction(): C\Menu\Drilldown diff --git a/components/ILIAS/UI/tests/Component/Modal/ModalBase.php b/components/ILIAS/UI/tests/Component/Modal/ModalBase.php index bb3aa3853532..96f38effd2a9 100755 --- a/components/ILIAS/UI/tests/Component/Modal/ModalBase.php +++ b/components/ILIAS/UI/tests/Component/Modal/ModalBase.php @@ -40,10 +40,9 @@ public function counter(): C\Counter\Factory { return new I\Component\Counter\Factory(); } - public function legacy(string $content): C\Legacy\Legacy + public function legacy(): C\Legacy\Factory { - $f = new I\Component\Legacy\Factory(new I\Component\SignalGenerator()); - return $f->legacy($content); + return new I\Component\Legacy\Factory(new I\Component\SignalGenerator()); } }; } diff --git a/components/ILIAS/UI/tests/Component/Modal/RoundTripTest.php b/components/ILIAS/UI/tests/Component/Modal/RoundTripTest.php index 627e37d24940..60edb041074a 100755 --- a/components/ILIAS/UI/tests/Component/Modal/RoundTripTest.php +++ b/components/ILIAS/UI/tests/Component/Modal/RoundTripTest.php @@ -69,7 +69,7 @@ public function testWithActionButtons(): void public function testSimpleRendering(): void { - $roundtrip = $this->getModalFactory()->roundtrip('Title', $this->getUIFactory()->legacy('Content')) + $roundtrip = $this->getModalFactory()->roundtrip('Title', $this->getUIFactory()->legacy()->content('Content')) ->withActionButtons([ $this->getButtonFactory()->primary('Action 1', ''), $this->getButtonFactory()->standard('Action 2', ''), diff --git a/components/ILIAS/UI/tests/Component/Panel/PanelSecondaryLegacyTest.php b/components/ILIAS/UI/tests/Component/Panel/PanelSecondaryLegacyTest.php index 7c3d71ecce73..9e1be8b0e46e 100755 --- a/components/ILIAS/UI/tests/Component/Panel/PanelSecondaryLegacyTest.php +++ b/components/ILIAS/UI/tests/Component/Panel/PanelSecondaryLegacyTest.php @@ -33,15 +33,14 @@ class PanelSecondaryLegacyTest extends ILIAS_UI_TestBase public function getUIFactory(): NoUIFactory { return new class () extends NoUIFactory { - public function legacyPanel(string $title, C\Legacy\Legacy $content): I\Component\Panel\Secondary\Legacy + public function legacyPanel(string $title, C\Legacy\Content $content): I\Component\Panel\Secondary\Legacy { return new I\Component\Panel\Secondary\Legacy($title, $content); } - public function legacy(string $content): C\Legacy\Legacy + public function legacy(): C\Legacy\Factory { - $f = new I\Component\Legacy\Factory(new I\Component\SignalGenerator()); - return $f->legacy($content); + return new I\Component\Legacy\Factory(new I\Component\SignalGenerator()); } public function dropdown(): C\Dropdown\Factory @@ -79,7 +78,7 @@ protected function cleanHTML(string $html): string public function testImplementsFactoryInterface(): void { - $legacy = $this->getUIFactory()->legacy("Legacy content"); + $legacy = $this->getUIfactory()->legacy()->content("Legacy content"); $secondary_panel = $this->getUIFactory()->legacyPanel("List Title", $legacy); $this->assertInstanceOf("ILIAS\\UI\\Component\\Panel\\Secondary\\Legacy", $secondary_panel); @@ -87,7 +86,7 @@ public function testImplementsFactoryInterface(): void public function testGetTitle(): void { - $legacy = $this->getUIFactory()->legacy("Legacy content"); + $legacy = $this->getUIfactory()->legacy()->content("Legacy content"); $secondary_panel = $this->getUIFactory()->legacyPanel("Title", $legacy); $this->assertEquals("Title", $secondary_panel->getTitle()); @@ -95,7 +94,7 @@ public function testGetTitle(): void public function testGetLegacyComponent(): void { - $legacy = $this->getUIFactory()->legacy("Legacy content"); + $legacy = $this->getUIfactory()->legacy()->content("Legacy content"); $secondary_panel = $this->getUIFactory()->legacyPanel("title", $legacy); $this->assertEquals($secondary_panel->getLegacyComponent(), $legacy); @@ -103,7 +102,7 @@ public function testGetLegacyComponent(): void public function testWithActions(): void { - $legacy = $this->getUIFactory()->legacy("Legacy content"); + $legacy = $this->getUIfactory()->legacy()->content("Legacy content"); $actions = $this->getUIFactory()->dropdown()->standard(array( $this->getUIFactory()->button()->shy("ILIAS", "https://www.ilias.de"), $this->getUIFactory()->button()->shy("Github", "https://www.github.com") @@ -117,7 +116,7 @@ public function testWithActions(): void public function testWithoutViewControls(): void { - $legacy = $this->getUIFactory()->legacy("Legacy content"); + $legacy = $this->getUIfactory()->legacy()->content("Legacy content"); $secondary_panel = $this->getUIFactory()->legacyPanel("title", $legacy); $array_vc = $secondary_panel->getViewControls(); @@ -126,7 +125,7 @@ public function testWithoutViewControls(): void public function testWithSortationViewControl(): void { - $legacy = $this->getUIFactory()->legacy("Legacy content"); + $legacy = $this->getUIfactory()->legacy()->content("Legacy content"); $sort_options = array( 'internal_rating' => 'Best', 'date_desc' => 'Most Recent', @@ -144,7 +143,7 @@ public function testWithSortationViewControl(): void public function testWithPaginationViewControl(): void { - $legacy = $this->getUIFactory()->legacy("Legacy content"); + $legacy = $this->getUIfactory()->legacy()->content("Legacy content"); $pagination = $this->getUIFactory()->viewControl()->pagination() ->withTargetURL("http://ilias.de", 'page') ->withTotalEntries(98) @@ -161,7 +160,7 @@ public function testWithPaginationViewControl(): void public function testWithSectionViewControl(): void { - $legacy = $this->getUIFactory()->legacy("Legacy content"); + $legacy = $this->getUIfactory()->legacy()->content("Legacy content"); $back = $this->getUIFactory()->button()->standard("previous", "http://www.ilias.de"); $next = $this->getUIFactory()->button()->standard("next", "http://www.github.com"); $current = $this->getUIFactory()->button()->standard("current", ""); @@ -179,7 +178,7 @@ public function testWithSectionViewControl(): void public function testRenderPanelSecondaryWithActions(): void { - $legacy = $this->getUIFactory()->legacy("Legacy content"); + $legacy = $this->getUIfactory()->legacy()->content("Legacy content"); $actions = $this->getUIFactory()->dropdown()->standard(array( $this->getUIFactory()->button()->shy("ILIAS", "https://www.ilias.de"), $this->getUIFactory()->button()->shy("Github", "https://www.github.com") @@ -216,7 +215,7 @@ public function testRenderPanelSecondaryWithActions(): void public function testRenderPanelSecondaryWithSortation(): void { - $legacy = $this->getUIFactory()->legacy("Legacy content"); + $legacy = $this->getUIfactory()->legacy()->content("Legacy content"); $sort_options = array( 'a' => 'A', 'b' => 'B' @@ -256,7 +255,7 @@ public function testRenderPanelSecondaryWithSortation(): void public function testRenderPanelSecondaryWithPagination(): void { - $legacy = $this->getUIFactory()->legacy("Legacy content"); + $legacy = $this->getUIfactory()->legacy()->content("Legacy content"); $pagination = $this->getUIFactory()->viewControl()->pagination() ->withTargetURL('http://ilias.de', 'page') @@ -294,7 +293,7 @@ public function testRenderPanelSecondaryWithPagination(): void public function testRenderPanelSecondaryWithSection(): void { - $legacy = $this->getUIFactory()->legacy("Legacy content"); + $legacy = $this->getUIfactory()->legacy()->content("Legacy content"); $back = $this->getUIFactory()->button()->standard("previous", "http://www.ilias.de"); $next = $this->getUIFactory()->button()->standard("next", "http://www.github.com"); $current = $this->getUIFactory()->button()->standard("current", ""); @@ -326,7 +325,7 @@ public function testRenderPanelSecondaryWithSection(): void public function testRenderPanelSecondaryWithFooter(): void { - $legacy = $this->getUIFactory()->legacy("Legacy content"); + $legacy = $this->getUIfactory()->legacy()->content("Legacy content"); $footer_shy_button = $this->getUIFactory()->button()->shy("Action", ""); $secondary_panel = $this->getUIFactory()->legacyPanel("Title", $legacy) @@ -353,7 +352,7 @@ public function testRenderPanelSecondaryWithFooter(): void public function testRenderPanelSecondaryWithNoHeader(): void { - $legacy = $this->getUIFactory()->legacy("Legacy content"); + $legacy = $this->getUIfactory()->legacy()->content("Legacy content"); $secondary_panel = $this->getUIFactory()->legacyPanel("", $legacy); diff --git a/components/ILIAS/UI/tests/Component/Panel/PanelTest.php b/components/ILIAS/UI/tests/Component/Panel/PanelTest.php index 200491b55f8d..c7521014e727 100755 --- a/components/ILIAS/UI/tests/Component/Panel/PanelTest.php +++ b/components/ILIAS/UI/tests/Component/Panel/PanelTest.php @@ -168,7 +168,7 @@ public function testSubWithSecondaryPanel(): void $p = $fp->sub("Title", array(new ComponentDummy())); - $legacy = new I\Component\Legacy\Legacy("Legacy content", new SignalGenerator()); + $legacy = new I\Component\Legacy\Content("Legacy content", new SignalGenerator()); $secondary = new I\Component\Panel\Secondary\Legacy("Legacy panel title", $legacy); $p = $p->withFurtherInformation($secondary); @@ -295,7 +295,7 @@ public function testRenderSubWithSecondaryPanel(): void $r = $this->getDefaultRenderer(); $p = $fp->sub("Title", array()); - $legacy = new I\Component\Legacy\Legacy("Legacy content", new SignalGenerator()); + $legacy = new I\Component\Legacy\Content("Legacy content", new SignalGenerator()); $secondary = new I\Component\Panel\Secondary\Legacy("Legacy panel title", $legacy); $p = $p->withFurtherInformation($secondary); $html = $r->render($p); diff --git a/components/ILIAS/UI/tests/Component/Popover/PopoverTest.php b/components/ILIAS/UI/tests/Component/Popover/PopoverTest.php index 38eb6937d28f..8f782c4939db 100755 --- a/components/ILIAS/UI/tests/Component/Popover/PopoverTest.php +++ b/components/ILIAS/UI/tests/Component/Popover/PopoverTest.php @@ -36,10 +36,9 @@ class PopoverTest extends ILIAS_UI_TestBase public function getFactory(): NoUIFactory { return new class () extends NoUIFactory { - public function legacy(string $content): I\Component\Legacy\Legacy + public function legacy(): I\Component\Legacy\Factory { - $f = new I\Component\Legacy\Factory(new I\Component\SignalGenerator()); - return $f->legacy($content); + return new I\Component\Legacy\Factory(new I\Component\SignalGenerator()); } }; } @@ -76,7 +75,7 @@ public function testWithPosition(): void public function testRenderStandard(): void { $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator()); - $popover = $factory->standard($this->getFactory()->legacy('myContent')); + $popover = $factory->standard($this->getFactory()->legacy()->content('myContent')); $expected = $this->normalizeHTML($this->getExpectedStandardHTML('myContent')); $actual = $this->normalizeHTML($this->getDefaultRenderer()->render($popover)); $this->assertEquals($expected, $actual); @@ -91,7 +90,7 @@ public function testRenderListing(): void public function testRenderAsync(): void { $factory = new I\Component\Popover\Factory(new I\Component\SignalGenerator()); - $popover = $factory->standard($this->getFactory()->legacy('myContent'))->withAsyncContentUrl('/blub/'); + $popover = $factory->standard($this->getFactory()->legacy()->content('myContent'))->withAsyncContentUrl('/blub/'); $this->assertEquals('', $this->getDefaultRenderer()->render($popover)); } diff --git a/components/ILIAS/UIComponent/Explorer2/classes/class.ilExplorerSelectInputGUI.php b/components/ILIAS/UIComponent/Explorer2/classes/class.ilExplorerSelectInputGUI.php index c6d3ba5fad48..349ff5b7893e 100755 --- a/components/ILIAS/UIComponent/Explorer2/classes/class.ilExplorerSelectInputGUI.php +++ b/components/ILIAS/UIComponent/Explorer2/classes/class.ilExplorerSelectInputGUI.php @@ -273,7 +273,7 @@ protected function getInitializationOnLoadCode(): string $modal = $this->ui->factory()->modal()->roundtrip( 'placeholder', - $this->ui->factory()->legacy('') + $this->ui->factory()->legacy()->content('') ); $rendered_modal = str_replace( ["\r\n", "\n", "\r"], diff --git a/components/ILIAS/UICore/classes/Screen/PageContentProvider.php b/components/ILIAS/UICore/classes/Screen/PageContentProvider.php index 59108786c484..eab1365fab61 100755 --- a/components/ILIAS/UICore/classes/Screen/PageContentProvider.php +++ b/components/ILIAS/UICore/classes/Screen/PageContentProvider.php @@ -26,7 +26,7 @@ use ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider; use ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts; use ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Component\MainControls\Footer; use ILIAS\GlobalScreen\Scope\Layout\Factory\TitleModification; use ILIAS\GlobalScreen\Scope\Layout\Factory\ShortTitleModification; @@ -78,10 +78,10 @@ public function isInterestedInContexts(): ContextCollection public function getContentModification(CalledContexts $screen_context_stack): ?ContentModification { return $this->globalScreen()->layout()->factory()->content()->withModification(function ( - ?Legacy $content - ): ?Legacy { + ?Content $content + ): ?Content { $ui = $this->dic->ui(); - return $ui->factory()->legacy( + return $ui->factory()->legacy()->content( $ui->renderer()->render($content) . self::$content ); })->withLowPriority(); diff --git a/components/ILIAS/User/classes/Gallery/class.ilUsersGalleryGUI.php b/components/ILIAS/User/classes/Gallery/class.ilUsersGalleryGUI.php index 1ce762d8bb56..4e536b152c13 100755 --- a/components/ILIAS/User/classes/Gallery/class.ilUsersGalleryGUI.php +++ b/components/ILIAS/User/classes/Gallery/class.ilUsersGalleryGUI.php @@ -20,7 +20,7 @@ use ILIAS\Language\Language; use ILIAS\UI\Factory as UIFactory; -use ILIAS\UI\Component\Legacy\Legacy as LegacyComponent; +use ILIAS\UI\Component\Legacy\Content as LegacyComponent; use ILIAS\UI\Component\Card\Standard as StandardCard; use ILIAS\UI\Component\Image\Image as Image; use ILIAS\UI\Renderer; diff --git a/components/ILIAS/User/classes/Settings/class.ilUserPrivacySettingsGUI.php b/components/ILIAS/User/classes/Settings/class.ilUserPrivacySettingsGUI.php index feb5eeabd4b0..054adfc8f8f5 100755 --- a/components/ILIAS/User/classes/Settings/class.ilUserPrivacySettingsGUI.php +++ b/components/ILIAS/User/classes/Settings/class.ilUserPrivacySettingsGUI.php @@ -20,7 +20,6 @@ use ILIAS\User\Profile\ChecklistStatus; use ILIAS\User\Profile\Mode as ProfileMode; - use ILIAS\Language\Language; use ILIAS\UI\Component\Input\Field\Section; @@ -131,7 +130,7 @@ public function showPrivacySettings( $pub_profile = new ilPublicUserProfileGUI($user->getId()); if ($this->profile_mode->isEnabled()) { - $pub_profile_legacy = $this->uiFactory->legacy($pub_profile->getEmbeddable()); + $pub_profile_legacy = $this->uifactory->legacy()->content($pub_profile->getEmbeddable()); $html .= $this->uiRenderer->render($this->uiFactory->panel()->standard( $this->lng->txt('user_profile_preview'), $pub_profile_legacy diff --git a/components/ILIAS/WOPI/classes/Embed/EmbeddedApplicationPagePartProvider.php b/components/ILIAS/WOPI/classes/Embed/EmbeddedApplicationPagePartProvider.php index ff0f32dc4ef7..c80b84e7dd1a 100644 --- a/components/ILIAS/WOPI/classes/Embed/EmbeddedApplicationPagePartProvider.php +++ b/components/ILIAS/WOPI/classes/Embed/EmbeddedApplicationPagePartProvider.php @@ -23,7 +23,7 @@ use ILIAS\UI\Component\MainControls\MainBar; use ILIAS\UI\Component\MainControls\MetaBar; use ILIAS\GlobalScreen\Scope\Layout\Provider\PagePart\PagePartProvider; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Component\Breadcrumbs\Breadcrumbs; use ILIAS\UI\Component\Image\Image; use ILIAS\UI\Component\MainControls\Footer; @@ -40,7 +40,7 @@ public function __construct( ) { } - public function getContent(): ?Legacy + public function getContent(): ?Content { return $this->page_part_provider->getContent(); } diff --git a/components/ILIAS/WOPI/classes/Embed/Renderer.php b/components/ILIAS/WOPI/classes/Embed/Renderer.php index 0216a3bea2a5..e27c1283118e 100755 --- a/components/ILIAS/WOPI/classes/Embed/Renderer.php +++ b/components/ILIAS/WOPI/classes/Embed/Renderer.php @@ -42,6 +42,6 @@ public function getComponent(): \ILIAS\UI\Component\Component $tpl->setVariable('TOKEN', (string) $this->embedded_application->getToken()); $tpl->setVariable('TTL', (string) (time() + $this->embedded_application->getTTL()) * 1000); // in milliseconds - return $this->ui_factory->legacy($tpl->get()); + return $this->ui_factory->legacy()->content($tpl->get()); } } diff --git a/components/ILIAS/WebDAV/classes/mount_instructions/class.ilWebDAVMountInstructionsGUI.php b/components/ILIAS/WebDAV/classes/mount_instructions/class.ilWebDAVMountInstructionsGUI.php index 4b514a2c75dc..7d043a8637fc 100755 --- a/components/ILIAS/WebDAV/classes/mount_instructions/class.ilWebDAVMountInstructionsGUI.php +++ b/components/ILIAS/WebDAV/classes/mount_instructions/class.ilWebDAVMountInstructionsGUI.php @@ -29,7 +29,7 @@ class ilWebDAVMountInstructionsGUI { protected ilWebDAVUriBuilder $uri_builder; protected ilWebDAVBaseMountInstructions $mount_instruction; - protected ilLanguage$lang; + protected ilLanguage $lang; protected UIServices $ui; protected Services $http; @@ -54,7 +54,7 @@ public function buildGUIFromGivenMountInstructions(array $mount_instructions, bo $components = []; - $js_function_legacy = $f->legacy(''); if (count($mount_instructions) === 1) { - $content = $f->legacy("