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("
+ return $this->dic->ui()->factory()->legacy()->content("
{$content} diff --git a/components/ILIAS/Badge/GlobalScreen/BadgeMainBarProvider.php b/components/ILIAS/Badge/GlobalScreen/BadgeMainBarProvider.php index f012b46dfcb3..25f28d5b82dc 100755 --- a/components/ILIAS/Badge/GlobalScreen/BadgeMainBarProvider.php +++ b/components/ILIAS/Badge/GlobalScreen/BadgeMainBarProvider.php @@ -44,7 +44,7 @@ public function getStaticSubItems(): array ->withPosition(40) ->withParent(StandardTopItemsProvider::getInstance()->getAchievementsIdentification()) ->withSymbol($icon) - ->withNonAvailableReason($this->dic->ui()->factory()->legacy($this->dic->language()->txt('component_not_active'))) + ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content($this->dic->language()->txt('component_not_active'))) ->withAvailableCallable( function () { return ilBadgeHandler::getInstance()->isActive(); diff --git a/components/ILIAS/Badge/classes/BadgeParent.php b/components/ILIAS/Badge/classes/BadgeParent.php index ce8067ac0233..1a0677a23ca3 100755 --- a/components/ILIAS/Badge/classes/BadgeParent.php +++ b/components/ILIAS/Badge/classes/BadgeParent.php @@ -72,11 +72,11 @@ public function asComponent(ilBadge $badge): ?Component ->link() ->standard($meta_data['title'], ($this->link_to)($parent_ref_id)); } else { - $parent_link = $this->container->ui()->factory()->legacy($meta_data['title']); + $parent_link = $this->container->ui()->factory()->legacy()->content($meta_data['title']); } return $this->container->ui()->factory()->listing()->descriptive([ - $this->container->language()->txt('object') => $this->container->ui()->factory()->legacy( + $this->container->language()->txt('object') => $this->container->ui()->factory()->legacy()->content( $this->container->ui()->renderer()->render([$parent_icon, $parent_link]) ) ]); diff --git a/components/ILIAS/Badge/tests/BadgeParentTest.php b/components/ILIAS/Badge/tests/BadgeParentTest.php index 205464708964..5c30f2b2141a 100755 --- a/components/ILIAS/Badge/tests/BadgeParentTest.php +++ b/components/ILIAS/Badge/tests/BadgeParentTest.php @@ -24,7 +24,7 @@ use ILIAS\DI\Container; use ILIAS\Badge\BadgeParent; use ILIAS\UI\Component\Listing\Descriptive; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy; use ilBadge; use ILIAS\UI\Factory as UI; use ILIAS\DI\UIServices; @@ -54,7 +54,8 @@ public function testShowWithParentReadRight(): void $descriptive = $this->getMockBuilder(Descriptive::class)->getMock(); $factory = $this->getMockBuilder(UI::class)->disableOriginalConstructor()->getMock(); $language = $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock(); - $legacy = $this->getMockBuilder(Legacy::class)->disableOriginalConstructor()->getMock(); + $legacy = $this->getMockBuilder(Legacy\Content::class)->disableOriginalConstructor()->getMock(); + $legacy_factory = $this->getMockBuilder(Legacy\Factory::class)->disableOriginalConstructor()->getMock(); $link = $this->getMockBuilder(Link::class)->disableOriginalConstructor()->getMock(); $listing = $this->getMockBuilder(Listing::class)->disableOriginalConstructor()->getMock(); $renderer = $this->getMockBuilder(Renderer::class)->disableOriginalConstructor()->getMock(); @@ -71,7 +72,8 @@ public function testShowWithParentReadRight(): void $factory->method('listing')->willReturn($listing); $factory->method('link')->willReturn($link); - $factory->expects(self::once())->method('legacy')->with($rendered)->willReturn($legacy); + $legacy_factory->expects(self::once())->method('content')->with($rendered)->willReturn($legacy); + $factory->expects(self::once())->method('legacy')->willReturn($legacy_factory); $renderer->expects(self::once())->method('render')->willReturn($rendered); @@ -118,9 +120,10 @@ public function testShowWithoutParentReadRight(): void $descriptive = $this->getMockBuilder(Descriptive::class)->getMock(); $factory = $this->getMockBuilder(UI::class)->disableOriginalConstructor()->getMock(); $language = $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock(); - $legacy = $this->getMockBuilder(Legacy::class)->disableOriginalConstructor()->getMock(); + $legacy = $this->getMockBuilder(Legacy\Content::class)->disableOriginalConstructor()->getMock(); + $legacy_factory = $this->getMockBuilder(Legacy\Factory::class)->disableOriginalConstructor()->getMock(); $listing = $this->getMockBuilder(Listing::class)->disableOriginalConstructor()->getMock(); - $parent_link = $this->getMockBuilder(Legacy::class)->disableOriginalConstructor()->getMock(); + $parent_link = $this->getMockBuilder(Content::class)->disableOriginalConstructor()->getMock(); $renderer = $this->getMockBuilder(Renderer::class)->disableOriginalConstructor()->getMock(); $ui = $this->getMockBuilder(UIServices::class)->disableOriginalConstructor()->getMock(); @@ -131,12 +134,8 @@ public function testShowWithoutParentReadRight(): void ])->willReturn($descriptive); $factory->method('listing')->willReturn($listing); - $consecutive_returns = [ - 'Lorem' => $parent_link, - $rendered => $legacy - ]; - $factory->method('legacy') - ->willReturnCallback(fn($k) => $consecutive_returns[$k]); + $legacy_factory->method('content')->willReturn($legacy); + $factory->method('legacy')->willReturn($legacy_factory); $renderer->expects(self::once())->method('render')->willReturn($rendered); diff --git a/components/ILIAS/Block/classes/class.ilBlockGUI.php b/components/ILIAS/Block/classes/class.ilBlockGUI.php index f1cb5e64a517..290711238346 100755 --- a/components/ILIAS/Block/classes/class.ilBlockGUI.php +++ b/components/ILIAS/Block/classes/class.ilBlockGUI.php @@ -394,14 +394,14 @@ public function getHTML(): string case self::PRES_SEC_LEG: $panel = $this->factory->panel()->secondary()->legacy( $this->specialCharsAsEntities($this->getTitle()), - $this->factory->legacy($this->getLegacyContent()) + $this->factory->legacy()->content($this->getLegacyContent()) ); break; case self::PRES_MAIN_LEG: $panel = $this->factory->panel()->standard( $this->specialCharsAsEntities($this->getTitle()), - $this->factory->legacy($this->getLegacyContent()) + $this->factory->legacy()->content($this->getLegacyContent()) ); break; @@ -429,12 +429,12 @@ public function getHTML(): string if ($this->getPresentation() === self::PRES_SEC_LIST) { $panel = $this->factory->panel()->secondary()->legacy( $this->specialCharsAsEntities($this->getTitle()), - $this->factory->legacy($this->getNoItemFoundContent()) + $this->factory->legacy()->content($this->getNoItemFoundContent()) ); } else { $panel = $this->factory->panel()->standard( $this->specialCharsAsEntities($this->getTitle()), - $this->factory->legacy($this->getNoItemFoundContent()) + $this->factory->legacy()->content($this->getNoItemFoundContent()) ); } } diff --git a/components/ILIAS/Blog/classes/class.ilObjBlogGUI.php b/components/ILIAS/Blog/classes/class.ilObjBlogGUI.php index 54566f90cc7e..b508580c5f49 100755 --- a/components/ILIAS/Blog/classes/class.ilObjBlogGUI.php +++ b/components/ILIAS/Blog/classes/class.ilObjBlogGUI.php @@ -1787,7 +1787,7 @@ public function renderNavigation( $content = $block[1]; - $secondary_panel = $ui_factory->panel()->secondary()->legacy($title, $ui_factory->legacy($content)); + $secondary_panel = $ui_factory->panel()->secondary()->legacy($title, $ui_factory->legacy()->content($content)); if (isset($block[2]) && is_array($block[2])) { $link = $ui_factory->button()->shy($block[2][1], $block[2][0]); diff --git a/components/ILIAS/BookingManager/BookingProcess/class.ObjectSelectionListGUI.php b/components/ILIAS/BookingManager/BookingProcess/class.ObjectSelectionListGUI.php index 4e831a297e9e..d9e82f6934fb 100755 --- a/components/ILIAS/BookingManager/BookingProcess/class.ObjectSelectionListGUI.php +++ b/components/ILIAS/BookingManager/BookingProcess/class.ObjectSelectionListGUI.php @@ -1,20 +1,23 @@ ui->factory()->panel()->secondary()->legacy( $this->lng->txt("book_object_selection"), - $this->ui->factory()->legacy($tpl->get()) + $this->ui->factory()->legacy()->content($tpl->get()) ); return $this->ui->renderer()->render($p); } diff --git a/components/ILIAS/BookingManager/BookingProcess/class.SlotGUI.php b/components/ILIAS/BookingManager/BookingProcess/class.SlotGUI.php index eb45654aaa88..ba5bb4e6738c 100755 --- a/components/ILIAS/BookingManager/BookingProcess/class.SlotGUI.php +++ b/components/ILIAS/BookingManager/BookingProcess/class.SlotGUI.php @@ -1,20 +1,23 @@ ui(); $tpl = new \ilTemplate("tpl.slot.html", true, true, "components/ILIAS/BookingManager/BookingProcess"); - $modal = $ui->factory()->modal()->roundtrip("", $ui->factory()->legacy("")); + $modal = $ui->factory()->modal()->roundtrip("", $ui->factory()->legacy()->content("")); $url = $this->link . '&replaceSignal=' . $modal->getReplaceSignal()->getId(); $modal = $modal->withAsyncRenderUrl($url); $button = $ui->factory()->button()->shy($this->title, "#") diff --git a/components/ILIAS/COPage/Editor/UI/Init.php b/components/ILIAS/COPage/Editor/UI/Init.php index 8f3d2607c0f3..b5e4706291ed 100755 --- a/components/ILIAS/COPage/Editor/UI/Init.php +++ b/components/ILIAS/COPage/Editor/UI/Init.php @@ -69,7 +69,7 @@ public function initUI( $dummy->getHTML(); // ensure modal.js from ui framework is loaded $this->ui->renderer()->render( - $this->ui->factory()->modal()->roundtrip("", $this->ui->factory()->legacy("")) + $this->ui->factory()->modal()->roundtrip("", $this->ui->factory()->legacy()->content("")) ); } diff --git a/components/ILIAS/COPage/GlobalScreen/classes/class.ilCOPageEditGSToolProvider.php b/components/ILIAS/COPage/GlobalScreen/classes/class.ilCOPageEditGSToolProvider.php index b38c9113c54a..e9ebe67c87ac 100755 --- a/components/ILIAS/COPage/GlobalScreen/classes/class.ilCOPageEditGSToolProvider.php +++ b/components/ILIAS/COPage/GlobalScreen/classes/class.ilCOPageEditGSToolProvider.php @@ -49,7 +49,7 @@ public function getToolsForContextStack(CalledContexts $called_contexts): array return $this->identification_provider->contextAwareIdentifier($id); }; $l = function (string $content) { - return $this->dic->ui()->factory()->legacy($content); + return $this->dic->ui()->factory()->legacy()->content($content); }; $identification = $iff("copg_editor"); $hashed = $this->hash($identification->serialize()); diff --git a/components/ILIAS/COPage/IntLink/class.ilInternalLinkGUI.php b/components/ILIAS/COPage/IntLink/class.ilInternalLinkGUI.php index 979b5b0f169f..719238cb583d 100755 --- a/components/ILIAS/COPage/IntLink/class.ilInternalLinkGUI.php +++ b/components/ILIAS/COPage/IntLink/class.ilInternalLinkGUI.php @@ -941,7 +941,7 @@ public static function getInitHTML(string $a_url): string $mt = self::getModalTemplate(); $tpl->addOnLoadCode('il.IntLink.setModalTemplate("' . addslashes(json_encode($mt["template"])) . '");'); - $html = "
"; + $html = "
"; return $html; } @@ -953,7 +953,7 @@ public static function getModalTemplate(): array $lng = $DIC->language(); $ui = $DIC->ui(); - $modal = $ui->factory()->modal()->roundtrip($lng->txt("link_link"), $ui->factory()->legacy("
")); + $modal = $ui->factory()->modal()->roundtrip($lng->txt("link_link"), $ui->factory()->legacy()->content("
")); $modalt["show"] = $modal->getShowSignal()->getId(); $modalt["close"] = $modal->getCloseSignal()->getId(); $modalt["template"] = $ui->renderer()->renderAsync($modal); diff --git a/components/ILIAS/COPage/PC/InteractiveImage/IIMEditorInit.php b/components/ILIAS/COPage/PC/InteractiveImage/IIMEditorInit.php index 222a6fbc90da..19e586ad5fa1 100755 --- a/components/ILIAS/COPage/PC/InteractiveImage/IIMEditorInit.php +++ b/components/ILIAS/COPage/PC/InteractiveImage/IIMEditorInit.php @@ -54,7 +54,7 @@ public function initUI( $dummy->getHTML(); // ensure modal.js from ui framework is loaded $this->ui->renderer()->render( - $this->ui->factory()->modal()->roundtrip("", $this->ui->factory()->legacy("")) + $this->ui->factory()->modal()->roundtrip("", $this->ui->factory()->legacy()->content("")) ); } diff --git a/components/ILIAS/COPage/PC/InteractiveImage/InteractiveImageQueryActionHandler.php b/components/ILIAS/COPage/PC/InteractiveImage/InteractiveImageQueryActionHandler.php index e12ed1a611d9..33c07412e04c 100755 --- a/components/ILIAS/COPage/PC/InteractiveImage/InteractiveImageQueryActionHandler.php +++ b/components/ILIAS/COPage/PC/InteractiveImage/InteractiveImageQueryActionHandler.php @@ -471,7 +471,7 @@ protected function getBackgroundProperties(): string public function getModalTemplate(): array { $ui = $this->ui; - $modal = $ui->factory()->modal()->roundtrip('#title#', $ui->factory()->legacy('#content#')) + $modal = $ui->factory()->modal()->roundtrip('#title#', $ui->factory()->legacy()->content('#content#')) ->withActionButtons([ $ui->factory()->button()->standard('#button_title#', '#'), ]); diff --git a/components/ILIAS/COPage/PC/InteractiveImage/class.ilPCInteractiveImage.php b/components/ILIAS/COPage/PC/InteractiveImage/class.ilPCInteractiveImage.php index b67560e3f6f7..6373e2c389af 100755 --- a/components/ILIAS/COPage/PC/InteractiveImage/class.ilPCInteractiveImage.php +++ b/components/ILIAS/COPage/PC/InteractiveImage/class.ilPCInteractiveImage.php @@ -750,7 +750,7 @@ public function modifyPageContentPostXsl( $new_inner = $inner; } else { $pop = $this->ui->factory()->popover()->standard( - $this->ui->factory()->legacy("#####popovercontent#####") + $this->ui->factory()->legacy()->content("#####popovercontent#####") ); $signal_id = $pop->getShowSignal()->getId(); //$new_inner = $this->ui->renderer()->render($pop); diff --git a/components/ILIAS/COPage/PC/MediaObject/class.ilPCMediaObject.php b/components/ILIAS/COPage/PC/MediaObject/class.ilPCMediaObject.php index e932ac078cc8..9c97b6e4e6e5 100755 --- a/components/ILIAS/COPage/PC/MediaObject/class.ilPCMediaObject.php +++ b/components/ILIAS/COPage/PC/MediaObject/class.ilPCMediaObject.php @@ -455,7 +455,7 @@ public function modifyPageContentPostXsl( $suffix = "-" . $page->getParentType() . "-" . $page->getId(); $modal = $this->ui->factory()->modal()->roundtrip( $this->lng->txt("cont_fullscreen"), - $this->ui->factory()->legacy("") + $this->ui->factory()->legacy()->content("") ); $show_signal = $modal->getShowSignal(); diff --git a/components/ILIAS/COPage/PC/Tabs/class.ilPCTabsGUI.php b/components/ILIAS/COPage/PC/Tabs/class.ilPCTabsGUI.php index 09bf0b525d75..66e94fe2d2eb 100755 --- a/components/ILIAS/COPage/PC/Tabs/class.ilPCTabsGUI.php +++ b/components/ILIAS/COPage/PC/Tabs/class.ilPCTabsGUI.php @@ -582,7 +582,7 @@ protected function getTabPanels(): string $content = $this->getTabContent($cap["pc_id"]); $items[] = $ui->factory()->panel()->standard( $cap["caption"], - $ui->factory()->legacy($content) + $ui->factory()->legacy()->content($content) ) ->withActions($dd); $cnt++; diff --git a/components/ILIAS/COPage/classes/class.ilPageObjectGUI.php b/components/ILIAS/COPage/classes/class.ilPageObjectGUI.php index ce1b8a951861..3e332dab5247 100755 --- a/components/ILIAS/COPage/classes/class.ilPageObjectGUI.php +++ b/components/ILIAS/COPage/classes/class.ilPageObjectGUI.php @@ -2243,7 +2243,7 @@ public function insertPageToc(string $a_output): string $h["text"] = str_replace($page_toc_ph, "", $h["text"]); $listing->node( - $this->ui->factory()->legacy("" . $h["text"] . ""), + $this->ui->factory()->legacy()->content("" . $h["text"] . ""), (string) $i, (string) ($par) ); diff --git a/components/ILIAS/Calendar/classes/Provider/CalendarMainBarProvider.php b/components/ILIAS/Calendar/classes/Provider/CalendarMainBarProvider.php index 090a904fc433..a88c6c0342b9 100755 --- a/components/ILIAS/Calendar/classes/Provider/CalendarMainBarProvider.php +++ b/components/ILIAS/Calendar/classes/Provider/CalendarMainBarProvider.php @@ -1,5 +1,21 @@ withParent(StandardTopItemsProvider::getInstance()->getPersonalWorkspaceIdentification()) ->withPosition(30) ->withSymbol($icon) - ->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt('component_not_active')}")) + ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt('component_not_active')}")) ->withAvailableCallable( function () { $settings = ilCalendarSettings::_getInstance(); diff --git a/components/ILIAS/Calendar/classes/class.ilCalendarBlockGUI.php b/components/ILIAS/Calendar/classes/class.ilCalendarBlockGUI.php index 1fbe7044cd35..d7d834806713 100755 --- a/components/ILIAS/Calendar/classes/class.ilCalendarBlockGUI.php +++ b/components/ILIAS/Calendar/classes/class.ilCalendarBlockGUI.php @@ -556,7 +556,7 @@ public function getHTML(): string // workaround to include asynch code from ui only one time, see #20853 if ($this->ctrl->isAsynch()) { - $f = $this->ui->factory()->legacy(""); + $f = $this->ui->factory()->legacy()->content(""); $ret .= $this->ui->renderer()->renderAsync($f); } if (count($this->modals) > 0) { diff --git a/components/ILIAS/Calendar/classes/class.ilCalendarSubscriptionGUI.php b/components/ILIAS/Calendar/classes/class.ilCalendarSubscriptionGUI.php index 5d41d4a780da..ce80cd0a4f4d 100755 --- a/components/ILIAS/Calendar/classes/class.ilCalendarSubscriptionGUI.php +++ b/components/ILIAS/Calendar/classes/class.ilCalendarSubscriptionGUI.php @@ -1,6 +1,20 @@ ui_factory->modal()->roundtrip( $this->lng->txt('cal_calendar_subscription_modal_title'), - $this->ui_factory->legacy($tpl->get()) + $this->ui_factory->legacy()->content($tpl->get()) ); echo $this->ui_renderer->render($roundtrip); exit; diff --git a/components/ILIAS/Calendar/classes/class.ilCalendarViewGUI.php b/components/ILIAS/Calendar/classes/class.ilCalendarViewGUI.php index 123b3e3199e6..bbd2661fb49b 100755 --- a/components/ILIAS/Calendar/classes/class.ilCalendarViewGUI.php +++ b/components/ILIAS/Calendar/classes/class.ilCalendarViewGUI.php @@ -1,7 +1,5 @@ getModalTitleByPlugins($modal_title); $modal = $this->ui_factory->modal()->roundtrip( $modal_title, - $this->ui_factory->legacy($content) + $this->ui_factory->legacy()->content($content) )->withCancelButtonLabel($this->lng->txt("close")); echo $this->ui_renderer->renderAsync($modal); } diff --git a/components/ILIAS/Chatroom/classes/Provider/ChatMainBarProvider.php b/components/ILIAS/Chatroom/classes/Provider/ChatMainBarProvider.php index cac6046ae6c5..9b017cb0cf9a 100755 --- a/components/ILIAS/Chatroom/classes/Provider/ChatMainBarProvider.php +++ b/components/ILIAS/Chatroom/classes/Provider/ChatMainBarProvider.php @@ -69,7 +69,7 @@ public function getStaticSubItems(): array ->withPosition(30) ->withSymbol($icon) ->withNonAvailableReason( - $this->dic->ui()->factory()->legacy($this->dic->language()->txt('component_not_active')) + $this->dic->ui()->factory()->legacy()->content($this->dic->language()->txt('component_not_active')) ) ->withAvailableCallable( static function () use ($publicChatObjId): bool { diff --git a/components/ILIAS/Chatroom/classes/gui/class.ilChatroomViewGUI.php b/components/ILIAS/Chatroom/classes/gui/class.ilChatroomViewGUI.php index d3907649b21b..d28fe2892f9f 100755 --- a/components/ILIAS/Chatroom/classes/gui/class.ilChatroomViewGUI.php +++ b/components/ILIAS/Chatroom/classes/gui/class.ilChatroomViewGUI.php @@ -251,7 +251,7 @@ private function checkbox(Component $component): string private function legacy(string $html): Component { - return $this->uiFactory->legacy($html); + return $this->uifactory->legacy()->content($html); } /** diff --git a/components/ILIAS/CmiXapi/classes/class.ilCmiXapiStatementsTableGUI.php b/components/ILIAS/CmiXapi/classes/class.ilCmiXapiStatementsTableGUI.php index a5fbac577f5d..2a9c4df0f260 100755 --- a/components/ILIAS/CmiXapi/classes/class.ilCmiXapiStatementsTableGUI.php +++ b/components/ILIAS/CmiXapi/classes/class.ilCmiXapiStatementsTableGUI.php @@ -169,7 +169,7 @@ protected function getRawDataModal(array $data): RoundTrip return $f->modal()->roundtrip( 'Raw Statement', - $f->legacy('
' . $data['statement'] . '
') + $f->legacy()->content('
' . $data['statement'] . '
') )->withCancelButtonLabel($this->language->txt('close')); } diff --git a/components/ILIAS/Contact/classes/Provider/ContactMainBarProvider.php b/components/ILIAS/Contact/classes/Provider/ContactMainBarProvider.php index bdfefd2f5829..d82fc5bccb34 100755 --- a/components/ILIAS/Contact/classes/Provider/ContactMainBarProvider.php +++ b/components/ILIAS/Contact/classes/Provider/ContactMainBarProvider.php @@ -63,7 +63,7 @@ public function getStaticSubItems(): array ->withParent(StandardTopItemsProvider::getInstance()->getCommunicationIdentification()) ->withPosition(20) ->withSymbol($icon) - ->withNonAvailableReason($this->dic->ui()->factory()->legacy($this->dic->language()->txt('component_not_active'))) + ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content($this->dic->language()->txt('component_not_active'))) ->withAvailableCallable( static function (): bool { return ilBuddySystem::getInstance()->isEnabled(); diff --git a/components/ILIAS/Contact/classes/class.ilContactGUI.php b/components/ILIAS/Contact/classes/class.ilContactGUI.php index b00ac1a0d34c..4b07be7ae06c 100755 --- a/components/ILIAS/Contact/classes/class.ilContactGUI.php +++ b/components/ILIAS/Contact/classes/class.ilContactGUI.php @@ -372,7 +372,7 @@ protected function showContacts(): void $table = new ilBuddySystemRelationsTableGUI($this, 'showContacts'); $table->populate(); - $content[] = $this->ui_factory->legacy($table->getHTML()); + $content[] = $this->ui_factory->legacy()->content($table->getHTML()); $this->tpl->setContent($this->ui_renderer->render($content)); $this->tpl->printToStdout(); diff --git a/components/ILIAS/ContentPage/classes/class.ilContentPageKioskModeView.php b/components/ILIAS/ContentPage/classes/class.ilContentPageKioskModeView.php index d5ab6538e989..29ada3404a52 100755 --- a/components/ILIAS/ContentPage/classes/class.ilContentPageKioskModeView.php +++ b/components/ILIAS/ContentPage/classes/class.ilContentPageKioskModeView.php @@ -174,7 +174,7 @@ public function render( $this->ctrl->setParameterByClass(ilContentPagePageGUI::class, 'ref_id', $this->contentPageObject->getRefId()); - return $factory->legacy(implode('', [ + return $factory->legacy()->content(implode('', [ $this->uiRenderer->render($this->messages), $forwarder->forward($this->ctrl->getLinkTargetByClass([ ilRepositoryGUI::class, ilObjContentPageGUI::class, ilContentPagePageGUI::class diff --git a/components/ILIAS/Course/classes/class.ilTutorialSupportBlockGUI.php b/components/ILIAS/Course/classes/class.ilTutorialSupportBlockGUI.php index 88767c6fc32a..0730fb326397 100644 --- a/components/ILIAS/Course/classes/class.ilTutorialSupportBlockGUI.php +++ b/components/ILIAS/Course/classes/class.ilTutorialSupportBlockGUI.php @@ -91,7 +91,7 @@ protected function createTutorItem( ) { return $tutor_item; } - $dropdown_actions[] = $this->ui->factory()->legacy( + $dropdown_actions[] = $this->ui->factory()->legacy()->content( ilBuddySystemLinkButton::getInstanceByUserId($tutor_id)->getHTML() ); $dropdown = $this->ui->factory()->dropdown()->standard($dropdown_actions); diff --git a/components/ILIAS/Dashboard/Block/classes/class.ilMembershipBlockGUI.php b/components/ILIAS/Dashboard/Block/classes/class.ilMembershipBlockGUI.php index 02f2d017752d..76326be4f0c4 100755 --- a/components/ILIAS/Dashboard/Block/classes/class.ilMembershipBlockGUI.php +++ b/components/ILIAS/Dashboard/Block/classes/class.ilMembershipBlockGUI.php @@ -38,7 +38,7 @@ public function emptyHandling(): string return $this->renderer->render( $this->factory->panel()->standard( $this->getTitle(), - $this->factory->legacy($this->lng->txt('rep_mo_mem_dash')) + $this->factory->legacy()->content($this->lng->txt('rep_mo_mem_dash')) ) ); } diff --git a/components/ILIAS/Dashboard/Block/classes/class.ilSelectedItemsBlockGUI.php b/components/ILIAS/Dashboard/Block/classes/class.ilSelectedItemsBlockGUI.php index d247c69484c5..4253df5e8d2c 100755 --- a/components/ILIAS/Dashboard/Block/classes/class.ilSelectedItemsBlockGUI.php +++ b/components/ILIAS/Dashboard/Block/classes/class.ilSelectedItemsBlockGUI.php @@ -55,7 +55,7 @@ public function emptyHandling(): string return $this->renderer->render( $this->factory->panel()->standard( $this->getTitle(), - $this->factory->legacy($this->renderer->render($mbox)) + $this->factory->legacy()->content($this->renderer->render($mbox)) ) ); } diff --git a/components/ILIAS/EmployeeTalk/classes/Provider/MyStaffListEntryProvider.php b/components/ILIAS/EmployeeTalk/classes/Provider/MyStaffListEntryProvider.php index 5440d48ecbc8..ef74ab07594d 100755 --- a/components/ILIAS/EmployeeTalk/classes/Provider/MyStaffListEntryProvider.php +++ b/components/ILIAS/EmployeeTalk/classes/Provider/MyStaffListEntryProvider.php @@ -75,7 +75,7 @@ function () { return boolval($this->settings->get('enable_my_staff')); } ) - ->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')}")) ->withParent($this->organisationIdentifier) ->withTitle($title) ->withSymbol($icon) diff --git a/components/ILIAS/Exercise/Assignment/PanelBuilderUI.php b/components/ILIAS/Exercise/Assignment/PanelBuilderUI.php index a5455cc27a02..9feb3c59fe0a 100755 --- a/components/ILIAS/Exercise/Assignment/PanelBuilderUI.php +++ b/components/ILIAS/Exercise/Assignment/PanelBuilderUI.php @@ -64,7 +64,7 @@ public function getPanel(Assignment $ass, int $user_id): \ILIAS\UI\Component\Pan // schedule card $sections = []; foreach ($pb->getProperties($pb::SEC_SCHEDULE) as $prop) { - $sections[] = $this->ui_factory->legacy($prop["prop"] . ": " . $prop["val"]); + $sections[] = $this->ui_factory->legacy()->content($prop["prop"] . ": " . $prop["val"]); } $schedule_card = $this->ui_factory->card()->standard($this->lng->txt("exc_schedule")) ->withSections($sections); @@ -111,7 +111,7 @@ public function getPanel(Assignment $ass, int $user_id): \ILIAS\UI\Component\Pan $sub_panel = $this->ui_factory->panel()->sub( $title, - $this->ui_factory->legacy($ctpl->get()) + $this->ui_factory->legacy()->content($ctpl->get()) ); if ($sec === $pb::SEC_INSTRUCTIONS && !$pb->getInstructionsHidden()) { $sub_panel = $sub_panel->withFurtherInformation($schedule_card); diff --git a/components/ILIAS/Exercise/GlobalScreen/classes/class.ilExerciseGSToolProvider.php b/components/ILIAS/Exercise/GlobalScreen/classes/class.ilExerciseGSToolProvider.php index 9a7918596152..f0da30e4e9c3 100755 --- a/components/ILIAS/Exercise/GlobalScreen/classes/class.ilExerciseGSToolProvider.php +++ b/components/ILIAS/Exercise/GlobalScreen/classes/class.ilExerciseGSToolProvider.php @@ -55,7 +55,7 @@ public function getToolsForContextStack( return $this->identification_provider->contextAwareIdentifier($id); }; $l = function (string $content) { - return $this->dic->ui()->factory()->legacy($content); + return $this->dic->ui()->factory()->legacy()->content($content); }; $tools[] = $this->factory->tool($iff("exc_ass_info")) ->withTitle($title) diff --git a/components/ILIAS/Exercise/Submission/class.ilExSubmissionObjectGUI.php b/components/ILIAS/Exercise/Submission/class.ilExSubmissionObjectGUI.php index b2253acb0aec..255ae28c3498 100755 --- a/components/ILIAS/Exercise/Submission/class.ilExSubmissionObjectGUI.php +++ b/components/ILIAS/Exercise/Submission/class.ilExSubmissionObjectGUI.php @@ -302,7 +302,7 @@ protected function renderResourceSelection( $r = $this->gui->ui()->renderer(); $p = $f->panel()->standard( $title, - $f->legacy($html) + $f->legacy()->content($html) ); $this->tpl->setContent($r->render($p)); diff --git a/components/ILIAS/Exercise/classes/class.ilExerciseManagementGUI.php b/components/ILIAS/Exercise/classes/class.ilExerciseManagementGUI.php index 8ec81a4842ea..ba28cb13cd0b 100755 --- a/components/ILIAS/Exercise/classes/class.ilExerciseManagementGUI.php +++ b/components/ILIAS/Exercise/classes/class.ilExerciseManagementGUI.php @@ -746,8 +746,8 @@ public function getReportPanel(array $a_data): string $card_tpl->parseCurrentBlock(); } - $main_panel = $this->ui_factory->panel()->sub($a_data['uname'], $this->ui_factory->legacy($a_data['utext'])) - ->withFurtherInformation($this->ui_factory->card()->standard($this->lng->txt('text_assignment'))->withSections(array($this->ui_factory->legacy($card_tpl->get()))))->withActions($actions_dropdown); + $main_panel = $this->ui_factory->panel()->sub($a_data['uname'], $this->ui_factory->legacy()->content($a_data['utext'])) + ->withFurtherInformation($this->ui_factory->card()->standard($this->lng->txt('text_assignment'))->withSections(array($this->ui_factory->legacy()->content($card_tpl->get()))))->withActions($actions_dropdown); $feedback_tpl = new ilTemplate("tpl.exc_report_feedback.html", true, true, "components/ILIAS/Exercise"); //if no feedback filter the feedback is displayed. Can be list submissions or compare submissions. @@ -790,7 +790,7 @@ public function getReportPanel(array $a_data): string : $a_data['comment']; $feedback_tpl->setVariable("COMMENT", $this->lng->txt('exc_comment') . ":
" . $comment); - $feedback_panel = $this->ui_factory->panel()->sub("", $this->ui_factory->legacy($feedback_tpl->get())); + $feedback_panel = $this->ui_factory->panel()->sub("", $this->ui_factory->legacy()->content($feedback_tpl->get())); $report = $this->ui_factory->panel()->report("", array($main_panel, $feedback_panel)); @@ -831,7 +831,7 @@ public function getEvaluationModal( return "$('#$id').click(function() { $('#$form_id').submit(); return false; });"; }); - return $this->ui_factory->modal()->roundtrip(strtoupper($this->lng->txt("grade_evaluate")), $this->ui_factory->legacy($modal_tpl->get()))->withActionButtons([$submit_btn]); + return $this->ui_factory->modal()->roundtrip(strtoupper($this->lng->txt("grade_evaluate")), $this->ui_factory->legacy()->content($modal_tpl->get()))->withActionButtons([$submit_btn]); } public function getEvaluationModalForm( @@ -1844,7 +1844,7 @@ protected function initIndividualDeadlineModal(): string // prepare modal $modal = $this->ui_factory->modal()->roundtrip( $lng->txt("exc_individual_deadline"), - $this->ui_factory->legacy('
') + $this->ui_factory->legacy()->content('
') ); $ajax_url = $this->ctrl->getLinkTarget($this, "handleIndividualDeadlineCalls", "", true, false); diff --git a/components/ILIAS/Exercise/classes/class.ilObjExerciseGUI.php b/components/ILIAS/Exercise/classes/class.ilObjExerciseGUI.php index 9d24d582cc0a..1752ac658352 100755 --- a/components/ILIAS/Exercise/classes/class.ilObjExerciseGUI.php +++ b/components/ILIAS/Exercise/classes/class.ilObjExerciseGUI.php @@ -959,7 +959,7 @@ public function showOverviewObject(): void )->withActive($am->getListModeLabel($this->getCurrentMode())); $html = ""; - $l = $f->legacy("

"); + $l = $f->legacy()->content("

"); $html .= $r->render([$mode, $l, $panel]); $this->tpl->setContent( diff --git a/components/ILIAS/Export/Print/class.PrintProcessGUI.php b/components/ILIAS/Export/Print/class.PrintProcessGUI.php index 0ea74ea93dba..8ad50cc10443 100755 --- a/components/ILIAS/Export/Print/class.PrintProcessGUI.php +++ b/components/ILIAS/Export/Print/class.PrintProcessGUI.php @@ -92,7 +92,7 @@ public function getModalElements( $ui->mainTemplate()->addJavaScript("assets/js/Form.js"); $modal = $ui->factory()->modal()->roundtrip( $this->lng->txt("exp_print_pdf"), - $ui->factory()->legacy('some modal') + $ui->factory()->legacy()->content('some modal') )->withAsyncRenderUrl($selection_action); $print_button = $ui->factory()->button()->standard( $this->lng->txt("exp_print_pdf"), diff --git a/components/ILIAS/File/classes/class.ilFileKioskModeView.php b/components/ILIAS/File/classes/class.ilFileKioskModeView.php index a14c4103affc..a895cd8d1dd6 100755 --- a/components/ILIAS/File/classes/class.ilFileKioskModeView.php +++ b/components/ILIAS/File/classes/class.ilFileKioskModeView.php @@ -103,7 +103,7 @@ public function updatePost(State $state, string $command, array $post): State public function render(State $state, Factory $factory, URLBuilder $url_builder, array $post = null): Component { $file_gui = new ilObjFileGUI($this->file_obj->getRefId()); - return $factory->legacy($file_gui->buildInfoScreen(true)->getHTML()); + return $factory->legacy()->content($file_gui->buildInfoScreen(true)->getHTML()); } protected function buildLearningProgressToggleControl(ControlBuilder $builder): ControlBuilder diff --git a/components/ILIAS/File/classes/class.ilObjFileUploadDropzone.php b/components/ILIAS/File/classes/class.ilObjFileUploadDropzone.php index fc119263022b..66e047b70dd0 100755 --- a/components/ILIAS/File/classes/class.ilObjFileUploadDropzone.php +++ b/components/ILIAS/File/classes/class.ilObjFileUploadDropzone.php @@ -106,7 +106,7 @@ public function getDropzone(): FileDropzone $dropzone = $this->ui->factory()->dropzone()->file()->wrapper( $this->language->txt('upload_files'), $post_url, - $this->ui->factory()->legacy($this->content ?? ''), + $this->ui->factory()->legacy()->content($this->content ?? ''), $this->ui->factory()->input()->field()->file( $this->upload_handler, $this->language->txt('upload_files'), diff --git a/components/ILIAS/Forum/classes/Provider/ForumGlobalScreenToolsProvider.php b/components/ILIAS/Forum/classes/Provider/ForumGlobalScreenToolsProvider.php index 79f38a987795..3862ab0f67f2 100755 --- a/components/ILIAS/Forum/classes/Provider/ForumGlobalScreenToolsProvider.php +++ b/components/ILIAS/Forum/classes/Provider/ForumGlobalScreenToolsProvider.php @@ -47,7 +47,7 @@ public function getToolsForContextStack( return $this->identification_provider->contextAwareIdentifier($id); }; $l = function (string $content): Component { - return $this->dic->ui()->factory()->legacy($content); + return $this->dic->ui()->factory()->legacy()->content($content); }; $tools = []; diff --git a/components/ILIAS/Forum/classes/class.ilObjForumGUI.php b/components/ILIAS/Forum/classes/class.ilObjForumGUI.php index 9a5702adf7c3..a52139d15f45 100755 --- a/components/ILIAS/Forum/classes/class.ilObjForumGUI.php +++ b/components/ILIAS/Forum/classes/class.ilObjForumGUI.php @@ -1102,7 +1102,7 @@ private function addDraftButtonIfDraftsExists(string $cmd) $draft_modal = $this->factory->modal()->roundtrip( $this->lng->txt('drafts'), - [$this->factory->legacy($threadsTemplate->get())] + [$this->factory->legacy()->content($threadsTemplate->get())] ); $this->modal_collection[] = $draft_modal; $edit_title = $this->factory->button()->standard($this->lng->txt('drafts'), '#')->withOnClick( @@ -2302,7 +2302,7 @@ static function (string $id) use ($form_id): string { ); $modal = $this->uiFactory->modal()->roundtrip( $this->lng->txt('activate_only_current'), - [$this->uiFactory->legacy($form->getHTML()), $message] + [$this->uifactory->legacy()->content($form->getHTML()), $message] )->withActionButtons([$submitBtn]); $action_button = $this->uiFactory->button()->standard($this->lng->txt('activate_post'), '#')->withOnClick( $modal->getShowSignal() @@ -5769,7 +5769,7 @@ private function renderSplitButton( $modalTemplate->setVariable('FORM_ACTION', $url); - $content = $this->uiFactory->legacy($modalTemplate->get()); + $content = $this->uifactory->legacy()->content($modalTemplate->get()); $submitBtn = $this->uiFactory->button()->primary( $this->lng->txt('submit'), '#' diff --git a/components/ILIAS/GlobalScreen/src/Scope/Layout/Factory/ContentModification.php b/components/ILIAS/GlobalScreen/src/Scope/Layout/Factory/ContentModification.php index bf7e179ea662..71db987d308b 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/Layout/Factory/ContentModification.php +++ b/components/ILIAS/GlobalScreen/src/Scope/Layout/Factory/ContentModification.php @@ -19,7 +19,7 @@ namespace ILIAS\GlobalScreen\Scope\Layout\Factory; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; /** * Class ContentModification @@ -40,7 +40,7 @@ public function isFinal(): bool */ public function getClosureFirstArgumentType(): string { - return Legacy::class; + return Content::class; } /** @@ -48,7 +48,7 @@ public function getClosureFirstArgumentType(): string */ public function getClosureReturnType(): string { - return Legacy::class; + return Content::class; } /** diff --git a/components/ILIAS/GlobalScreen/src/Scope/Layout/ModificationHandler.php b/components/ILIAS/GlobalScreen/src/Scope/Layout/ModificationHandler.php index db999e44864b..333cd3ebd8aa 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/Layout/ModificationHandler.php +++ b/components/ILIAS/GlobalScreen/src/Scope/Layout/ModificationHandler.php @@ -29,7 +29,7 @@ use ILIAS\UI\Component\Breadcrumbs\Breadcrumbs; use ILIAS\UI\Component\Image\Image; use ILIAS\UI\Component\Layout\Page\Page; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Component\MainControls\Footer; use ILIAS\UI\Component\MainControls\MainBar; use ILIAS\UI\Component\MainControls\MetaBar; @@ -84,7 +84,7 @@ public function modifyPageWithClosure(Closure $closure_returning_page): void */ public function modifyContentWithClosure(Closure $closure_returning_content): void { - $this->replaceWithAutoWiredInstance(Legacy::class, $closure_returning_content); + $this->replaceWithAutoWiredInstance(Content::class, $closure_returning_content); } /** diff --git a/components/ILIAS/GlobalScreen/src/Scope/Layout/Provider/PagePart/DecoratedPagePartProvider.php b/components/ILIAS/GlobalScreen/src/Scope/Layout/Provider/PagePart/DecoratedPagePartProvider.php index b511d52f37e9..e62c4e7a2d67 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/Layout/Provider/PagePart/DecoratedPagePartProvider.php +++ b/components/ILIAS/GlobalScreen/src/Scope/Layout/Provider/PagePart/DecoratedPagePartProvider.php @@ -23,7 +23,7 @@ use Closure; use ILIAS\UI\Component\Breadcrumbs\Breadcrumbs; use ILIAS\UI\Component\Image\Image; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Component\MainControls\Footer; use ILIAS\UI\Component\MainControls\MainBar; use ILIAS\UI\Component\MainControls\MetaBar; @@ -53,7 +53,7 @@ public function __construct(private readonly PagePartProvider $original, private { } - private function getDecoratedOrOriginal(string $purpose, Legacy|null|MetaBar|MainBar|Breadcrumbs|Image|string|Footer|TContainer $original) + private function getDecoratedOrOriginal(string $purpose, Content|null|MetaBar|MainBar|Breadcrumbs|Image|string|Footer|TContainer $original) { if ($this->isDecorated($purpose)) { $deco = $this->deco; @@ -70,9 +70,9 @@ private function isDecorated(string $purpose): bool } - public function getContent(): ?Legacy + public function getContent(): ?Content { - return $this->getDecoratedOrOriginal(Legacy::class, $this->original->getContent()); + return $this->getDecoratedOrOriginal(Content::class, $this->original->getContent()); } diff --git a/components/ILIAS/GlobalScreen/src/Scope/Layout/Provider/PagePart/PagePartProvider.php b/components/ILIAS/GlobalScreen/src/Scope/Layout/Provider/PagePart/PagePartProvider.php index b98956f3f672..9a47152310e8 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/Layout/Provider/PagePart/PagePartProvider.php +++ b/components/ILIAS/GlobalScreen/src/Scope/Layout/Provider/PagePart/PagePartProvider.php @@ -21,7 +21,7 @@ use ILIAS\UI\Component\Breadcrumbs\Breadcrumbs; use ILIAS\UI\Component\Image\Image; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Component\MainControls\Footer; use ILIAS\UI\Component\MainControls\MainBar; use ILIAS\UI\Component\MainControls\MetaBar; @@ -35,9 +35,9 @@ interface PagePartProvider { /** - * @return Legacy|null + * @return Content|null */ - public function getContent(): ?Legacy; + public function getContent(): ?Content; /** * @return MetaBar|null diff --git a/components/ILIAS/GlobalScreen/src/Scope/Layout/Provider/PagePart/StandardPagePartProvider.php b/components/ILIAS/GlobalScreen/src/Scope/Layout/Provider/PagePart/StandardPagePartProvider.php index eb5f3e089b6c..0b8f5051f21a 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/Layout/Provider/PagePart/StandardPagePartProvider.php +++ b/components/ILIAS/GlobalScreen/src/Scope/Layout/Provider/PagePart/StandardPagePartProvider.php @@ -26,7 +26,7 @@ use ILIAS\GlobalScreen\Scope\Tool\Factory\isToolItem; use ILIAS\UI\Component\Breadcrumbs\Breadcrumbs; use ILIAS\UI\Component\Image\Image; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Component\MainControls\Footer; use ILIAS\UI\Component\MainControls\MainBar; use ILIAS\UI\Component\MainControls\MetaBar; @@ -67,9 +67,9 @@ public function __construct() } - public function getContent(): ?Legacy + public function getContent(): ?Content { - return $this->content ?? $this->ui->factory()->legacy(""); + return $this->content ?? $this->ui->factory()->legacy()->content(""); } diff --git a/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Collector/Renderer/BaseTypeRenderer.php b/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Collector/Renderer/BaseTypeRenderer.php index 3845fb1f0478..e5e43ed9521e 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Collector/Renderer/BaseTypeRenderer.php +++ b/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Collector/Renderer/BaseTypeRenderer.php @@ -82,7 +82,7 @@ public function getComponentForItem(isItem $item, bool $with_content = true): Co public function getComponentWithContent(isItem $item): Component { - return $this->ui_factory->legacy($item->getProviderIdentification()->serialize()); + return $this->ui_factory->legacy()->content($item->getProviderIdentification()->serialize()); } public function getComponentWithoutContent(isItem $item): Component @@ -91,7 +91,7 @@ public function getComponentWithoutContent(isItem $item): Component return $this->getComponentWithContent($item); } /** @var $item supportsAsynchronousLoading $content */ - $content = $this->ui_factory->legacy('...'); + $content = $this->ui_factory->legacy()->content('...'); $name = $item instanceof hasTitle ? $item->getTitle() : "-"; $slate = $this->ui_factory->mainControls()->slate()->legacy( $name, diff --git a/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Collector/Renderer/ComplexItemRenderer.php b/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Collector/Renderer/ComplexItemRenderer.php index 176a49b66062..248682d14f52 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Collector/Renderer/ComplexItemRenderer.php +++ b/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Collector/Renderer/ComplexItemRenderer.php @@ -43,7 +43,7 @@ public function getComponentWithContent(isItem $item): Component * @var $item Complex */ global $DIC; - $content = $this->ui_factory->legacy($DIC->ui()->renderer()->render($item->getContent())); + $content = $this->ui_factory->legacy()->content($DIC->ui()->renderer()->render($item->getContent())); return $this->ui_factory->mainControls()->slate()->legacy($item->getTitle(), $this->getStandardSymbol($item), $content); } diff --git a/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Factory/AbstractBaseItem.php b/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Factory/AbstractBaseItem.php index 075aa045b8da..7165136fce53 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Factory/AbstractBaseItem.php +++ b/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Factory/AbstractBaseItem.php @@ -24,7 +24,7 @@ use ILIAS\GlobalScreen\Identification\NullIdentification; use ILIAS\GlobalScreen\Scope\ComponentDecoratorTrait; use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Information\TypeInformation; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use Closure; use ILIAS\GlobalScreen\Scope\VisibilityAvailabilityTrait; use ILIAS\GlobalScreen\Scope\isDecorateable; @@ -41,7 +41,7 @@ abstract class AbstractBaseItem implements isItem, isDecorateable protected ?Closure $active_callable = null; protected bool $is_always_available = false; protected ?TypeInformation $type_information = null; - protected ?Legacy $non_available_reason = null; + protected ?Content $non_available_reason = null; /** * AbstractBaseItem constructor. @@ -59,7 +59,7 @@ public function getProviderIdentification(): IdentificationInterface return $this->provider_identification; } - public function withNonAvailableReason(Legacy $element): isItem + public function withNonAvailableReason(Content $element): isItem { $clone = clone $this; $clone->non_available_reason = $element; @@ -70,11 +70,11 @@ public function withNonAvailableReason(Legacy $element): isItem /** * @inheritDoc */ - public function getNonAvailableReason(): Legacy + public function getNonAvailableReason(): Content { global $DIC; - return $this->non_available_reason instanceof Legacy ? $this->non_available_reason : $DIC->ui()->factory()->legacy(""); + return $this->non_available_reason instanceof Legacy ? $this->non_available_reason : $DIC->ui()->factory()->legacy()->content(""); } /** diff --git a/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Factory/Item/Lost.php b/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Factory/Item/Lost.php index 4c0e951cb36d..d98d90787116 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Factory/Item/Lost.php +++ b/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Factory/Item/Lost.php @@ -104,7 +104,7 @@ public function getContent(): Component { global $DIC; - return $DIC->ui()->factory()->legacy(""); + return $DIC->ui()->factory()->legacy()->content(""); } /** diff --git a/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Factory/isItem.php b/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Factory/isItem.php index 87f8632cd0c2..4887ca05f32b 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Factory/isItem.php +++ b/components/ILIAS/GlobalScreen/src/Scope/MainMenu/Factory/isItem.php @@ -22,7 +22,7 @@ use ILIAS\GlobalScreen\isGlobalScreenItem; use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Information\TypeInformation; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; /** * Interface IFactory @@ -66,12 +66,12 @@ public function isAvailable(): bool; * this will be something like in * Services/Administration/templates/default/tpl.external_settings.html */ - public function withNonAvailableReason(Legacy $element): isItem; + public function withNonAvailableReason(Content $element): isItem; /** * @return Legacy */ - public function getNonAvailableReason(): Legacy; + public function getNonAvailableReason(): Content; /** * Return the default position for installation, this will be overridden by diff --git a/components/ILIAS/GlobalScreen/src/Scope/MetaBar/Collector/Renderer/BaseMetaBarItemRenderer.php b/components/ILIAS/GlobalScreen/src/Scope/MetaBar/Collector/Renderer/BaseMetaBarItemRenderer.php index 8b42b9dbb772..006662b4a351 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/MetaBar/Collector/Renderer/BaseMetaBarItemRenderer.php +++ b/components/ILIAS/GlobalScreen/src/Scope/MetaBar/Collector/Renderer/BaseMetaBarItemRenderer.php @@ -34,6 +34,6 @@ class BaseMetaBarItemRenderer extends AbstractMetaBarItemRenderer implements Met */ protected function getSpecificComponentForItem(isItem $item): Component { - return $this->ui->factory()->legacy("no renderer found"); + return $this->ui->factory()->legacy()->content("no renderer found"); } } diff --git a/components/ILIAS/GlobalScreen/src/Scope/MetaBar/Factory/TopLegacyItem.php b/components/ILIAS/GlobalScreen/src/Scope/MetaBar/Factory/TopLegacyItem.php index 330ad4ea3e1c..4af09626f7dd 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/MetaBar/Factory/TopLegacyItem.php +++ b/components/ILIAS/GlobalScreen/src/Scope/MetaBar/Factory/TopLegacyItem.php @@ -22,7 +22,7 @@ use ILIAS\GlobalScreen\Identification\IdentificationInterface; use ILIAS\GlobalScreen\Scope\MetaBar\Collector\Renderer\TopLegacyItemRenderer; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Component\Symbol\Symbol; /** @@ -34,7 +34,7 @@ class TopLegacyItem extends AbstractBaseItem implements isItem, hasSymbol, hasTi protected ?Symbol $symbol = null; protected string $title = ""; - protected ?Legacy $content = null; + protected ?Content $content = null; /** * @inheritDoc @@ -91,7 +91,7 @@ public function getTitle(): string return $this->title; } - public function withLegacyContent(Legacy $content): self + public function withLegacyContent(Content $content): self { $clone = clone $this; $clone->content = $content; @@ -102,7 +102,7 @@ public function withLegacyContent(Legacy $content): self /** * @return Legacy */ - public function getLegacyContent(): Legacy + public function getLegacyContent(): Content { return $this->content; } diff --git a/components/ILIAS/GlobalScreen/src/Scope/Toast/Collector/Renderer/StandardToastRenderer.php b/components/ILIAS/GlobalScreen/src/Scope/Toast/Collector/Renderer/StandardToastRenderer.php index 92bb833f1d9f..ceb4247f4d23 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/Toast/Collector/Renderer/StandardToastRenderer.php +++ b/components/ILIAS/GlobalScreen/src/Scope/Toast/Collector/Renderer/StandardToastRenderer.php @@ -46,7 +46,7 @@ public function __construct(UIServices $ui) public function getToastComponentForItem(isItem $item): Component { if (!$item instanceof isStandardItem) { - return $this->ui->factory()->legacy("Cannot render item of type " . get_class($item) . ""); + return $this->ui->factory()->legacy()->content("Cannot render item of type " . get_class($item) . ""); } // build empty UI\Toast diff --git a/components/ILIAS/GlobalScreen/src/Scope/Tool/Collector/Renderer/TreeToolItemRenderer.php b/components/ILIAS/GlobalScreen/src/Scope/Tool/Collector/Renderer/TreeToolItemRenderer.php index fa369b3f6521..b1f366008e6b 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/Tool/Collector/Renderer/TreeToolItemRenderer.php +++ b/components/ILIAS/GlobalScreen/src/Scope/Tool/Collector/Renderer/TreeToolItemRenderer.php @@ -44,6 +44,6 @@ public function getComponentForItem(isItem $item, bool $with_content = false): C $symbol = $this->getStandardSymbol($item); - return $this->ui_factory->mainControls()->slate()->legacy($item->getTitle(), $symbol, $this->ui_factory->legacy($DIC->ui()->renderer()->render([$item->getTree()]))); + return $this->ui_factory->mainControls()->slate()->legacy($item->getTitle(), $symbol, $this->ui_factory->legacy()->content($DIC->ui()->renderer()->render([$item->getTree()]))); } } diff --git a/components/ILIAS/GlobalScreen/src/Scope/Tool/README.md b/components/ILIAS/GlobalScreen/src/Scope/Tool/README.md index efd65d8c76bb..cae5b20d52ca 100755 --- a/components/ILIAS/GlobalScreen/src/Scope/Tool/README.md +++ b/components/ILIAS/GlobalScreen/src/Scope/Tool/README.md @@ -16,7 +16,7 @@ class ilMediaPoolGSToolProvider extends AbstractDynamicToolProvider { $tools = []; $iff = function ($id) { return $this->identification_provider->identifier($id); }; - $l = function (string $content) { return $this->dic->ui()->factory()->legacy($content); }; + $l = function (string $content) { return $this->dic->ui()->factory()->legacy()->content($content); }; $additional_data = $called_contexts->getLast()->getAdditionalData(); if ($additional_data->exists(self::SHOW_FOLDERS_TOOL) && $additional_data->get(self::SHOW_FOLDERS_TOOL) === true) { diff --git a/components/ILIAS/Glossary/Flashcard/class.ilGlossaryFlashcardBoxGUI.php b/components/ILIAS/Glossary/Flashcard/class.ilGlossaryFlashcardBoxGUI.php index d2bf800e357f..1c06f1a03eca 100755 --- a/components/ILIAS/Glossary/Flashcard/class.ilGlossaryFlashcardBoxGUI.php +++ b/components/ILIAS/Glossary/Flashcard/class.ilGlossaryFlashcardBoxGUI.php @@ -163,7 +163,7 @@ public function showHidden(): void if ($this->glossary->getFlashcardsMode() === "term") { $flashcard = $this->ui_fac->panel()->standard( $this->lng->txt("term") . ": " . $this->getTermText(), - $this->ui_fac->legacy("???") + $this->ui_fac->legacy()->content("???") ); } else { $flashcard = $this->ui_fac->panel()->standard( diff --git a/components/ILIAS/Glossary/Presentation/class.ilPresentationTableGUI.php b/components/ILIAS/Glossary/Presentation/class.ilPresentationTableGUI.php index d2f2d29a5fa3..6b5fced11691 100644 --- a/components/ILIAS/Glossary/Presentation/class.ilPresentationTableGUI.php +++ b/components/ILIAS/Glossary/Presentation/class.ilPresentationTableGUI.php @@ -340,7 +340,7 @@ function ($row, array $record, $ui_factory) { ->withHeadline($record["term"]) ->withImportantFields([$record["short_txt"]]) ->withContent( - $ui_factory->legacy($record["definition"]) + $ui_factory->legacy()->content($record["definition"]) ) ->withFurtherFieldsHeadline($this->lng->txt("md_advanced")) ->withFurtherFields($adv_data) diff --git a/components/ILIAS/Group/UserActions/classes/class.ilGroupAddToGroupActionGUI.php b/components/ILIAS/Group/UserActions/classes/class.ilGroupAddToGroupActionGUI.php index 898d3628e3f3..0cd230af4d4c 100755 --- a/components/ILIAS/Group/UserActions/classes/class.ilGroupAddToGroupActionGUI.php +++ b/components/ILIAS/Group/UserActions/classes/class.ilGroupAddToGroupActionGUI.php @@ -162,11 +162,11 @@ public function sendResponse(string $a_content): void ); } if ($modal_exists) { - echo $this->ui->renderer()->renderAsync($this->ui->factory()->legacy($a_content)); + echo $this->ui->renderer()->renderAsync($this->ui->factory()->legacy()->content($a_content)); } else { $mtpl = new ilTemplate("tpl.grp_add_to_grp_modal_content.html", true, true, "./components/ILIAS/Group/UserActions"); $mtpl->setVariable("CONTENT", $a_content); - $content = $this->ui->factory()->legacy($mtpl->get()); + $content = $this->ui->factory()->legacy()->content($mtpl->get()); $modal = $this->ui->factory()->modal()->roundtrip( $lng->txt("grp_add_user_to_group"), $content diff --git a/components/ILIAS/Help/GlobalScreen/classes/class.ilHelpGSToolProvider.php b/components/ILIAS/Help/GlobalScreen/classes/class.ilHelpGSToolProvider.php index bbe60b1c3340..e96c8056922e 100755 --- a/components/ILIAS/Help/GlobalScreen/classes/class.ilHelpGSToolProvider.php +++ b/components/ILIAS/Help/GlobalScreen/classes/class.ilHelpGSToolProvider.php @@ -62,7 +62,7 @@ public function getToolsForContextStack(CalledContexts $called_contexts): array return $this->identification_provider->contextAwareIdentifier($id, true); }; $l = function (string $content) { - return $this->dic->ui()->factory()->legacy($content); + return $this->dic->ui()->factory()->legacy()->content($content); }; $identification = $iff("help"); diff --git a/components/ILIAS/ILIASObject/classes/Translation/class.ilObjectTranslationGUI.php b/components/ILIAS/ILIASObject/classes/Translation/class.ilObjectTranslationGUI.php index d3ec1638f9a5..6e24ed840a23 100755 --- a/components/ILIAS/ILIASObject/classes/Translation/class.ilObjectTranslationGUI.php +++ b/components/ILIAS/ILIASObject/classes/Translation/class.ilObjectTranslationGUI.php @@ -245,7 +245,7 @@ private function getAddLanguagesModal(): Modal { return $this->ui_factory->modal()->roundtrip( $this->lng->txt('confirm'), - $this->ui_factory->legacy($this->lng->txt('obj_select_master_lang')), + $this->ui_factory->legacy()->content($this->lng->txt('obj_select_master_lang')), [ 'langs' => $this->getMultiLangFormInput(true) ], @@ -300,7 +300,7 @@ private function getActivateMultilingualityModal(): Modal { return $this->ui_factory->modal()->roundtrip( $this->lng->txt('confirm'), - $this->ui_factory->legacy($this->lng->txt('obj_select_master_lang')), + $this->ui_factory->legacy()->content($this->lng->txt('obj_select_master_lang')), [ 'lang' => $this->getMultiLangFormInput() ], diff --git a/components/ILIAS/ILIASObject/classes/class.ilObjectGUI.php b/components/ILIAS/ILIASObject/classes/class.ilObjectGUI.php index e97f9e977205..f55ffb449d60 100755 --- a/components/ILIAS/ILIASObject/classes/class.ilObjectGUI.php +++ b/components/ILIAS/ILIASObject/classes/class.ilObjectGUI.php @@ -671,7 +671,7 @@ protected function getCreationFormsHTML(StandardForm|ilPropertyFormGUI|array $fo $form->setTitle(''); $form->setTitleIcon(''); $form->setTableWidth('100%'); - $content = $this->ui_factory->legacy($form->getHTML()); + $content = $this->ui_factory->legacy()->content($form->getHTML()); } return $this->ui_renderer->render( diff --git a/components/ILIAS/ILIASObject/classes/class.ilObjectListGUI.php b/components/ILIAS/ILIASObject/classes/class.ilObjectListGUI.php index a4723e00c318..2fd824b52bf3 100755 --- a/components/ILIAS/ILIASObject/classes/class.ilObjectListGUI.php +++ b/components/ILIAS/ILIASObject/classes/class.ilObjectListGUI.php @@ -3150,7 +3150,7 @@ public function getAsCard( $sections = []; if ($description !== '') { - $sections[] = $ui->factory()->legacy('
' . $description . '
'); + $sections[] = $ui->factory()->legacy()->content('
' . $description . '
'); } $this->populateCommands(false); diff --git a/components/ILIAS/LearningModule/Editing/GlobalScreen/classes/class.ilLMEditGSToolProvider.php b/components/ILIAS/LearningModule/Editing/GlobalScreen/classes/class.ilLMEditGSToolProvider.php index ccb34e0d44f0..9518ddce6c23 100755 --- a/components/ILIAS/LearningModule/Editing/GlobalScreen/classes/class.ilLMEditGSToolProvider.php +++ b/components/ILIAS/LearningModule/Editing/GlobalScreen/classes/class.ilLMEditGSToolProvider.php @@ -40,7 +40,7 @@ public function getToolsForContextStack(CalledContexts $called_contexts): array return $this->identification_provider->contextAwareIdentifier($id); }; $l = function (string $content) { - return $this->dic->ui()->factory()->legacy($content); + return $this->dic->ui()->factory()->legacy()->content($content); }; $identification = $iff("tree"); $hashed = $this->hash($identification->serialize()); diff --git a/components/ILIAS/LearningModule/Presentation/GlobalScreen/classes/class.ilLMGSToolProvider.php b/components/ILIAS/LearningModule/Presentation/GlobalScreen/classes/class.ilLMGSToolProvider.php index dfb99daf32a9..5a8938981a68 100755 --- a/components/ILIAS/LearningModule/Presentation/GlobalScreen/classes/class.ilLMGSToolProvider.php +++ b/components/ILIAS/LearningModule/Presentation/GlobalScreen/classes/class.ilLMGSToolProvider.php @@ -55,7 +55,7 @@ public function getToolsForContextStack( return $this->identification_provider->contextAwareIdentifier($id); }; $l = function (string $content) { - return $this->dic->ui()->factory()->legacy($content); + return $this->dic->ui()->factory()->legacy()->content($content); }; if ($additional_data->is(self::SHOW_TOC_TOOL, true)) { @@ -171,7 +171,7 @@ public function getTocTool( return $this->identification_provider->contextAwareIdentifier($id); }; $l = function (string $content) { - return $this->dic->ui()->factory()->legacy($content); + return $this->dic->ui()->factory()->legacy()->content($content); }; $title = $lng->txt("cont_toc"); diff --git a/components/ILIAS/LearningModule/Presentation/class.ilLMPresentationGUI.php b/components/ILIAS/LearningModule/Presentation/class.ilLMPresentationGUI.php index e604e198d9f7..fb4f65a3b0a7 100755 --- a/components/ILIAS/LearningModule/Presentation/class.ilLMPresentationGUI.php +++ b/components/ILIAS/LearningModule/Presentation/class.ilLMPresentationGUI.php @@ -1569,7 +1569,7 @@ public function showPrintViewSelection(): void $modal = $this->ui->factory()->modal()->roundtrip( $this->lng->txt("cont_print_view"), - $this->ui->factory()->legacy($tpl->get()) + $this->ui->factory()->legacy()->content($tpl->get()) ); echo $this->ui->renderer()->render($modal); exit(); @@ -2162,7 +2162,7 @@ public function showDownloadList(): void $modal = $this->ui->factory()->modal()->roundtrip( $this->lng->txt("download"), - $this->ui->factory()->legacy($tpl->get()) + $this->ui->factory()->legacy()->content($tpl->get()) ); echo $this->ui->renderer()->render($modal); exit(); diff --git a/components/ILIAS/LearningModule/classes/class.ilLMMenuGUI.php b/components/ILIAS/LearningModule/classes/class.ilLMMenuGUI.php index 9a8c34603244..9e6a707b840c 100755 --- a/components/ILIAS/LearningModule/classes/class.ilLMMenuGUI.php +++ b/components/ILIAS/LearningModule/classes/class.ilLMMenuGUI.php @@ -67,7 +67,7 @@ public function getEntries(): array $ui->mainTemplate()->addJavaScript("assets/js/Form.js"); $modal = $ui->factory()->modal()->roundtrip( $lng->txt("cont_print_view"), - $ui->factory()->legacy('some modal') + $ui->factory()->legacy()->content('some modal') )->withAsyncRenderUrl($this->ctrl->getLinkTargetByClass("illmpresentationgui", "showPrintViewSelection")); $entries[] = [ @@ -90,7 +90,7 @@ public function getEntries(): array $access->checkAccess("read", "", $this->lm->getRefId())) { $modal = $ui->factory()->modal()->roundtrip( $lng->txt("download"), - $ui->factory()->legacy('some modal') + $ui->factory()->legacy()->content('some modal') )->withAsyncRenderUrl($this->ctrl->getLinkTargetByClass("illmpresentationgui", "showDownloadList")); $entries[] = [ "label" => $this->lng->txt("download"), diff --git a/components/ILIAS/LearningModule/classes/class.ilLearningModuleKioskModeView.php b/components/ILIAS/LearningModule/classes/class.ilLearningModuleKioskModeView.php index 61f8850a0b60..193f3bf9c9f7 100755 --- a/components/ILIAS/LearningModule/classes/class.ilLearningModuleKioskModeView.php +++ b/components/ILIAS/LearningModule/classes/class.ilLearningModuleKioskModeView.php @@ -248,6 +248,6 @@ public function render( $content = $this->uiRenderer->render($this->messages); $content .= $this->ctrl->getHTML($this->lm_pres, ["cmd" => "layout"], ["illmpresentationgui"]); $content .= $this->uiRenderer->render($additional_content); - return $factory->legacy($content); + return $factory->legacy()->content($content); } } diff --git a/components/ILIAS/LearningSequence/classes/GlobalScreen/class.ilLSViewLayoutProvider.php b/components/ILIAS/LearningSequence/classes/GlobalScreen/class.ilLSViewLayoutProvider.php index ef4cac94d1c2..c4fcfb334864 100755 --- a/components/ILIAS/LearningSequence/classes/GlobalScreen/class.ilLSViewLayoutProvider.php +++ b/components/ILIAS/LearningSequence/classes/GlobalScreen/class.ilLSViewLayoutProvider.php @@ -29,9 +29,8 @@ use ILIAS\GlobalScreen\Scope\Layout\Factory\BreadCrumbsModification; use ILIAS\UI\Component\Breadcrumbs\Breadcrumbs; use ILIAS\GlobalScreen\Scope\Layout\Factory\ContentModification; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection; - use ILIAS\GlobalScreen\Scope\Layout\Provider\PagePart\PagePartProvider; use ILIAS\GlobalScreen\Scope\Layout\Builder\StandardPageBuilder; use ILIAS\GlobalScreen\Scope\Layout\Factory\PageBuilderModification; @@ -96,7 +95,7 @@ public function getMetaBarModification(CalledContexts $screen_context_stack): ?M } return $this->globalScreen()->layout()->factory()->metabar() ->withModification( - fn (?MetaBar $metabar): ?Metabar => $metabar !== null ? $metabar->withClearedEntries() : null + fn(?MetaBar $metabar): ?Metabar => $metabar !== null ? $metabar->withClearedEntries() : null ) ->withHighPriority(); } @@ -109,7 +108,7 @@ public function getBreadCrumbsModification(CalledContexts $screen_context_stack) return $this->globalScreen()->layout()->factory()->breadcrumbs() ->withModification( - fn (?Breadcrumbs $current): ?Breadcrumbs => null + fn(?Breadcrumbs $current): ?Breadcrumbs => null ) ->withHighPriority(); } @@ -125,9 +124,9 @@ public function getContentModification(CalledContexts $screen_context_stack): ?C // away the header here. return $this->globalScreen()->layout()->factory()->content() ->withModification( - function (?Legacy $content) use ($html): ?Legacy { + function (?Content $content) use ($html): ?Content { $ui = $this->dic->ui(); - return $ui->factory()->legacy($html); + return $ui->factory()->legacy()->content($html); } ) ->withHighPriority(); diff --git a/components/ILIAS/LearningSequence/classes/Player/class.ilKioskPageRenderer.php b/components/ILIAS/LearningSequence/classes/Player/class.ilKioskPageRenderer.php index bc43a9333ae1..4ed8924a6d26 100755 --- a/components/ILIAS/LearningSequence/classes/Player/class.ilKioskPageRenderer.php +++ b/components/ILIAS/LearningSequence/classes/Player/class.ilKioskPageRenderer.php @@ -77,7 +77,7 @@ public function buildToCSlate(LSTOCBuilder $toc, Icon $icon): Slate return $this->ui_factory->maincontrols()->slate()->legacy( $this->lng->txt('lso_mainbar_button_label_toc'), $icon->withSize("small"), - $this->ui_factory->legacy($html) + $this->ui_factory->legacy()->content($html) ); } diff --git a/components/ILIAS/LearningSequence/classes/Player/class.ilObjLearningSequenceLearnerGUI.php b/components/ILIAS/LearningSequence/classes/Player/class.ilObjLearningSequenceLearnerGUI.php index bb45bc66b0af..bfa7a66aea21 100755 --- a/components/ILIAS/LearningSequence/classes/Player/class.ilObjLearningSequenceLearnerGUI.php +++ b/components/ILIAS/LearningSequence/classes/Player/class.ilObjLearningSequenceLearnerGUI.php @@ -129,9 +129,9 @@ private function getWrappedHTML(array $components): string { array_unshift( $components, - $this->ui_factory->legacy('
') + $this->ui_factory->legacy()->content('
') ); - $components[] = $this->ui_factory->legacy('
'); + $components[] = $this->ui_factory->legacy()->content('
'); return $this->renderer->render($components); } @@ -143,25 +143,25 @@ private function getMainContent(string $cmd): array if ($cmd === self::CMD_STANDARD) { if ($this->intro === '') { - $contents[] = $this->ui_factory->legacy($this->settings->getAbstract()); + $contents[] = $this->ui_factory->legacy()->content($this->settings->getAbstract()); $img = $this->settings->getAbstractImage(); if ($img) { $contents[] = $this->ui_factory->image()->responsive($img, ''); } } else { - $contents[] = $this->ui_factory->legacy($this->intro); + $contents[] = $this->ui_factory->legacy()->content($this->intro); } } if ($cmd === self::CMD_EXTRO) { if ($this->extro === '') { - $contents[] = $this->ui_factory->legacy($this->settings->getExtro()); + $contents[] = $this->ui_factory->legacy()->content($this->settings->getExtro()); $img = $this->settings->getExtroImage(); if ($img) { $contents[] = $this->ui_factory->image()->responsive($img, ''); } } else { - $contents[] = $this->ui_factory->legacy($this->extro); + $contents[] = $this->ui_factory->legacy()->content($this->extro); } } return $contents; diff --git a/components/ILIAS/LegalDocuments/classes/Condition/Role.php b/components/ILIAS/LegalDocuments/classes/Condition/Role.php index 02ae459e2651..d2444e2ca12b 100755 --- a/components/ILIAS/LegalDocuments/classes/Condition/Role.php +++ b/components/ILIAS/LegalDocuments/classes/Condition/Role.php @@ -41,7 +41,7 @@ public function __construct( public function asComponent(): Component { - return $this->create->legacy(sprintf( + return $this->create->legacy()->content(sprintf( '
%s
%s
', $this->definition->translatedType(), $this->definition->translatedRole((int) $this->criterion->arguments()['role_id']) diff --git a/components/ILIAS/LegalDocuments/classes/Condition/UserCountry.php b/components/ILIAS/LegalDocuments/classes/Condition/UserCountry.php index ecd84b8bfd11..fdf2779520f5 100755 --- a/components/ILIAS/LegalDocuments/classes/Condition/UserCountry.php +++ b/components/ILIAS/LegalDocuments/classes/Condition/UserCountry.php @@ -39,7 +39,7 @@ public function __construct( public function asComponent(): Component { - return $this->create->legacy(sprintf( + return $this->create->legacy()->content(sprintf( '
%s
%s
', $this->definition->translatedType(), $this->definition->translatedCountry($this->criterion->arguments()['country'] ?? '') diff --git a/components/ILIAS/LegalDocuments/classes/Condition/UserLanguage.php b/components/ILIAS/LegalDocuments/classes/Condition/UserLanguage.php index fcfb7cb8b380..a8bca65e87fc 100755 --- a/components/ILIAS/LegalDocuments/classes/Condition/UserLanguage.php +++ b/components/ILIAS/LegalDocuments/classes/Condition/UserLanguage.php @@ -39,7 +39,7 @@ public function __construct( public function asComponent(): Component { - return $this->create->legacy(sprintf( + return $this->create->legacy()->content(sprintf( '
%s
%s
', $this->definition->translatedType(), $this->definition->translatedLanguage($this->criterion->arguments()['lng']) diff --git a/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/Agreement.php b/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/Agreement.php index 2c830bcb8dbd..0819ca76146f 100755 --- a/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/Agreement.php +++ b/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/Agreement.php @@ -85,7 +85,7 @@ private function showDocument(): Component { return $this->user ->matchingDocument() - ->map(fn(Document $document) => $this->ui->create()->legacy($document->content()->value())) + ->map(fn(Document $document) => $this->ui->create()->legacy()->content($document->content()->value())) ->except(fn() => new Ok($this->ui->create()->legacy(sprintf( $this->ui->txt('no_agreement_description'), 'mailto:' . ilLegacyFormElementsUtil::prepareFormOutput(ilSystemSupportContacts::getMailsToAddress()) diff --git a/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/ModifyFooter.php b/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/ModifyFooter.php index 5c9953e0b22d..7199875fb941 100755 --- a/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/ModifyFooter.php +++ b/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/ModifyFooter.php @@ -64,7 +64,7 @@ public function __invoke(Closure $footer): Closure public function renderModal(DocumentContent $content): Modal { return $this->ui->create()->modal()->roundtrip($content->title(), [ - $this->ui->create()->legacy($this->ui->txt('usr_agreement_footer_intro')), + $this->ui->create()->legacy()->content($this->ui->txt('usr_agreement_footer_intro')), $this->ui->create()->divider()->horizontal(), $this->legal_documents->document()->contentAsComponent($content), $this->ui->create()->divider()->horizontal(), @@ -84,7 +84,7 @@ public function withdrawalButton(): Component ) ); - return $this->ui->create()->legacy($template->get()); + return $this->ui->create()->legacy()->content($template->get()); } /** diff --git a/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/ShowOnLoginPage.php b/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/ShowOnLoginPage.php index 367e9317a179..5b2a8fe74ade 100755 --- a/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/ShowOnLoginPage.php +++ b/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/ShowOnLoginPage.php @@ -51,6 +51,6 @@ public function __invoke(): array $template->setVariable('LABEL', htmlentities($this->ui->txt('usr_agreement'))); $template->setVariable('HREF', $this->legal_documents->publicPage()->url()); - return [$this->ui->create()->legacy($template->get())]; + return [$this->ui->create()->legacy()->content($template->get())]; } } diff --git a/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/WithdrawProcess.php b/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/WithdrawProcess.php index d78ffb6f604c..e8299d7c905f 100755 --- a/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/WithdrawProcess.php +++ b/components/ILIAS/LegalDocuments/classes/ConsumerToolbox/ConsumerSlots/WithdrawProcess.php @@ -61,7 +61,7 @@ public function showValidatePasswordMessage(): array return [ $this->ui->create()->divider()->horizontal(), - $this->ui->create()->legacy($this->ui->txt($lng)) + $this->ui->create()->legacy()->content($this->ui->txt($lng)) ]; } diff --git a/components/ILIAS/LegalDocuments/classes/DefaultMappings.php b/components/ILIAS/LegalDocuments/classes/DefaultMappings.php index 4bd370cbe776..eee3be2836f6 100755 --- a/components/ILIAS/LegalDocuments/classes/DefaultMappings.php +++ b/components/ILIAS/LegalDocuments/classes/DefaultMappings.php @@ -69,7 +69,7 @@ public function conditionDefinitions(): SelectionMap public function contentAsComponent(): array { return [ - 'html' => fn($x) => $this->container->ui()->factory()->legacy($x->value()), + 'html' => fn($x) => $this->container->ui()->factory()->legacy()->content($x->value()), ]; } } diff --git a/components/ILIAS/LegalDocuments/classes/Provide/ProvideHistory.php b/components/ILIAS/LegalDocuments/classes/Provide/ProvideHistory.php index 4c2e9be80943..1af1709cb697 100755 --- a/components/ILIAS/LegalDocuments/classes/Provide/ProvideHistory.php +++ b/components/ILIAS/LegalDocuments/classes/Provide/ProvideHistory.php @@ -71,7 +71,7 @@ public function table(object $gui, string $command, string $reset_command, strin $create )); - return $this->container->ui()->factory()->legacy($table->getHTML()); + return $this->container->ui()->factory()->legacy()->content($table->getHTML()); } public function acceptDocument(ilObjUser $user, Document $document): void diff --git a/components/ILIAS/LegalDocuments/tests/Condition/RoleTest.php b/components/ILIAS/LegalDocuments/tests/Condition/RoleTest.php index a2c95404564c..4a4fd0ed5364 100755 --- a/components/ILIAS/LegalDocuments/tests/Condition/RoleTest.php +++ b/components/ILIAS/LegalDocuments/tests/Condition/RoleTest.php @@ -21,7 +21,7 @@ namespace ILIAS\LegalDocuments\test\Condition; use ILIAS\LegalDocuments\Condition; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy; use ILIAS\LegalDocuments\test\ContainerMock; use ILIAS\UI\Factory as UIFactory; use ILIAS\LegalDocuments\Condition\Definition\RoleDefinition; @@ -49,11 +49,17 @@ public function testConstruct(): void public function testAsComponent(): void { - $legacy = $this->mock(Legacy::class); + $legacy = $this->mock(Legacy\Content::class); + $legacy_factory = $this->mock(Legacy\Factory::class); + $legacy_factory + ->expects($this->once()) + ->method('content') + ->willReturn($legacy); + $this->assertSame($legacy, (new Role( $this->mockTree(CriterionContent::class, ['arguments' => ['role_id' => 78]]), $this->mock(RoleDefinition::class), - $this->mockTree(UIFactory::class, ['legacy' => $legacy]), + $this->mockTree(UIFactory::class, ['legacy' => $legacy_factory]), $this->mock(ilRbacReview::class) ))->asComponent()); } diff --git a/components/ILIAS/LegalDocuments/tests/Condition/UserCountryTest.php b/components/ILIAS/LegalDocuments/tests/Condition/UserCountryTest.php index 6d4d963aaa07..0b6b40b6b3a0 100755 --- a/components/ILIAS/LegalDocuments/tests/Condition/UserCountryTest.php +++ b/components/ILIAS/LegalDocuments/tests/Condition/UserCountryTest.php @@ -21,7 +21,7 @@ namespace ILIAS\LegalDocuments\test\Condition; use ILIAS\LegalDocuments\Condition; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy; use ILIAS\LegalDocuments\test\ContainerMock; use ILIAS\LegalDocuments\Value\CriterionContent; use ILIAS\LegalDocuments\Condition\Definition\UserCountryDefinition; @@ -47,12 +47,17 @@ public function testConstruct(): void public function testAsComponent(): void { - $legacy = $this->mock(Legacy::class); + $legacy = $this->mock(Legacy\Content::class); + $legacy_factory = $this->mock(Legacy\Factory::class); + $legacy_factory + ->expects($this->once()) + ->method('content') + ->willReturn($legacy); $instance = new UserCountry( $this->mockTree(CriterionContent::class, ['arguments' => ['country' => 'foo']]), $this->mock(UserCountryDefinition::class), - $this->mockTree(UIFactory::class, ['legacy' => $legacy]) + $this->mockTree(UIFactory::class, ['legacy' => $legacy_factory]) ); $this->assertSame($legacy, $instance->asComponent()); diff --git a/components/ILIAS/LegalDocuments/tests/Condition/UserLanguageTest.php b/components/ILIAS/LegalDocuments/tests/Condition/UserLanguageTest.php index aedf1612de93..b1152343cde3 100755 --- a/components/ILIAS/LegalDocuments/tests/Condition/UserLanguageTest.php +++ b/components/ILIAS/LegalDocuments/tests/Condition/UserLanguageTest.php @@ -22,7 +22,7 @@ use ILIAS\LegalDocuments\Condition; use ilObjUser; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy; use ILIAS\LegalDocuments\test\ContainerMock; use ILIAS\LegalDocuments\Value\CriterionContent; use PHPUnit\Framework\TestCase; @@ -47,12 +47,17 @@ public function testConstruct(): void public function testAsComponent(): void { - $legacy = $this->mock(Legacy::class); + $legacy = $this->mock(Legacy\Content::class); + $legacy_factory = $this->mock(Legacy\Factory::class); + $legacy_factory + ->expects($this->once()) + ->method('content') + ->willReturn($legacy); $instance = new UserLanguage( $this->mockTree(CriterionContent::class, ['arguments' => ['lng' => 'foo']]), $this->mock(UserLanguageDefinition::class), - $this->mockTree(UIFactory::class, ['legacy' => $legacy]) + $this->mockTree(UIFactory::class, ['legacy' => $legacy_factory]) ); $this->assertSame($legacy, $instance->asComponent()); diff --git a/components/ILIAS/LegalDocuments/tests/ConductorTest.php b/components/ILIAS/LegalDocuments/tests/ConductorTest.php index bbc1616afa16..6f79f8ff9120 100755 --- a/components/ILIAS/LegalDocuments/tests/ConductorTest.php +++ b/components/ILIAS/LegalDocuments/tests/ConductorTest.php @@ -34,7 +34,7 @@ use ILIAS\UI\Component\MainControls\Footer; use ILIAS\UI\Renderer; use ILIAS\UI\Component\Component; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\HTTP\Wrapper\ArrayBasedRequestWrapper; use ILIAS\LegalDocuments\Provide; use ILIAS\LegalDocuments\Internal; @@ -74,7 +74,7 @@ public function testLoginPageHTML(): void $this->mock(Component::class), ]; - $space = $this->mock(Legacy::class); + $space = $this->mock(Content::class); $container = $this->mockTree(Container::class, [ 'ui' => [ diff --git a/components/ILIAS/LegalDocuments/tests/ConsumerToolbox/ConsumerSlots/ShowOnLoginPageTest.php b/components/ILIAS/LegalDocuments/tests/ConsumerToolbox/ConsumerSlots/ShowOnLoginPageTest.php index 50c36b279c7c..58d6d451c700 100755 --- a/components/ILIAS/LegalDocuments/tests/ConsumerToolbox/ConsumerSlots/ShowOnLoginPageTest.php +++ b/components/ILIAS/LegalDocuments/tests/ConsumerToolbox/ConsumerSlots/ShowOnLoginPageTest.php @@ -24,7 +24,7 @@ use ILIAS\LegalDocuments\ConsumerToolbox\UI; use ILIAS\LegalDocuments\Provide; use PHPUnit\Framework\TestCase; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy; use ILIAS\UI\Implementation\Factory as UIFactory; use ilTemplate; @@ -52,7 +52,14 @@ public function testInvoke(): void { $translated = 'Translated
'; $url = 'Dummy URL'; - $legacy = $this->mock(Legacy::class); + + $legacy = $this->mock(Legacy\Content::class); + $legacy_factory = $this->mock(Legacy\Factory::class); + $legacy_factory + ->expects($this->once()) + ->method('content') + ->willReturn($legacy); + $template = $this->mock(ilTemplate::class); $expected = [ @@ -77,7 +84,7 @@ function (string $k, string $v) use (&$expected) { 'publicPage' => ['url' => $url], ]), $this->mockTree(UI::class, [ 'txt' => $translated, - 'create' => $this->mockMethod(UIFactory::class, 'legacy', ['Rendered'], $legacy), + 'create' => $this->mockMethod(UIFactory::class, 'legacy', [], $legacy_factory), ]), fn() => $template); $array = $instance(); diff --git a/components/ILIAS/LegalDocuments/tests/DefaultMappingsTest.php b/components/ILIAS/LegalDocuments/tests/DefaultMappingsTest.php index dba1fd01dede..bc27167cd1ea 100755 --- a/components/ILIAS/LegalDocuments/tests/DefaultMappingsTest.php +++ b/components/ILIAS/LegalDocuments/tests/DefaultMappingsTest.php @@ -21,7 +21,7 @@ namespace ILIAS\LegalDocuments\test; use ILIAS\LegalDocuments\Value\DocumentContent; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy; use ILIAS\UI\Factory as UIFactory; use ILIAS\LegalDocuments\Condition\Definition\UserCountryDefinition; use ILIAS\LegalDocuments\Condition\Definition\UserLanguageDefinition; @@ -71,10 +71,15 @@ public function testConditionDefinitions(): void public function testContentAsComponent(): void { - $legacy = $this->mock(Legacy::class); + $legacy = $this->mock(Legacy\Content::class); + $legacy_factory = $this->mock(Legacy\Factory::class); + $legacy_factory + ->expects($this->once()) + ->method('content') + ->willReturn($legacy); $container = $this->mockTree(Container::class, [ - 'ui' => ['factory' => $this->mockMethod(UIFactory::class, 'legacy', ['bar'], $legacy)], + 'ui' => ['factory' => $this->mockMethod(UIFactory::class, 'legacy', [], $legacy_factory)], ]); $instance = new DefaultMappings('foo', $container); diff --git a/components/ILIAS/LegalDocuments/tests/Provide/ProvideHistoryTest.php b/components/ILIAS/LegalDocuments/tests/Provide/ProvideHistoryTest.php index 440f4f0eb15e..53abac9a7167 100755 --- a/components/ILIAS/LegalDocuments/tests/Provide/ProvideHistoryTest.php +++ b/components/ILIAS/LegalDocuments/tests/Provide/ProvideHistoryTest.php @@ -21,7 +21,7 @@ namespace ILIAS\LegalDocuments\test\Provide; use ILIAS\Data\Result; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy; use ILIAS\LegalDocuments\Legacy\Table as LegacyTable; use ILIAS\LegalDocuments\Table as TableInterface; use ILIAS\LegalDocuments\Table\HistoryTable; @@ -53,7 +53,12 @@ public function testConstruct(): void public function testTable(): void { $dummy_gui = new stdClass(); - $legacy = $this->mock(Legacy::class); + $legacy = $this->mock(Legacy\Content::class); + $legacy_factory = $this->mock(Legacy\Factory::class); + $legacy_factory + ->expects($this->once()) + ->method('content') + ->willReturn($legacy); $table = $this->mockMethod(LegacyTable::class, 'getHTML', [], 'table html'); @@ -61,7 +66,7 @@ public function testTable(): void 'ctrl' => $this->mock(ilCtrl::class), 'language' => $this->mock(ilLanguage::class), 'ui' => [ - 'factory' => $this->mockMethod(UIFactory::class, 'legacy', ['table html'], $legacy), + 'factory' => $this->mockMethod(UIFactory::class, 'legacy', [], $legacy_factory), 'mainTemplate' => $this->mock(ilGlobalTemplateInterface::class) ], ]); diff --git a/components/ILIAS/LegalDocuments/tests/Table/DocumentTableTest.php b/components/ILIAS/LegalDocuments/tests/Table/DocumentTableTest.php index 5ffa4966f483..cd4d04ab1e7c 100755 --- a/components/ILIAS/LegalDocuments/tests/Table/DocumentTableTest.php +++ b/components/ILIAS/LegalDocuments/tests/Table/DocumentTableTest.php @@ -24,7 +24,6 @@ use ILIAS\Data\Factory; use ILIAS\LegalDocuments\EditLinks; use ILIAS\UI\Component\Component; -use ILIAS\UI\Component\Legacy\Legacy; use ILIAS\UI\Factory as UIFactory; use ILIAS\LegalDocuments\Value\CriterionContent; use ILIAS\LegalDocuments\Value\Criterion; diff --git a/components/ILIAS/Like/classes/class.ilLikeGUI.php b/components/ILIAS/Like/classes/class.ilLikeGUI.php index fc0b529be5e0..e1133a1317d1 100755 --- a/components/ILIAS/Like/classes/class.ilLikeGUI.php +++ b/components/ILIAS/Like/classes/class.ilLikeGUI.php @@ -114,7 +114,7 @@ public function getHTML(): string // modal $modal_asyn_url = $ctrl->getLinkTarget($this, "renderModal", "", true, false); - $modal = $f->modal()->roundtrip('', $f->legacy("")) + $modal = $f->modal()->roundtrip('', $f->legacy()->content("")) ->withAsyncRenderUrl($modal_asyn_url); $modal_show_sig_id = $modal->getShowSignal()->getId(); diff --git a/components/ILIAS/Mail/classes/Provider/MailGlobalScreenToolProvider.php b/components/ILIAS/Mail/classes/Provider/MailGlobalScreenToolProvider.php index d05208c1391b..f30d52fc390f 100755 --- a/components/ILIAS/Mail/classes/Provider/MailGlobalScreenToolProvider.php +++ b/components/ILIAS/Mail/classes/Provider/MailGlobalScreenToolProvider.php @@ -24,7 +24,7 @@ use ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection; use ILIAS\GlobalScreen\Identification\IdentificationInterface; use ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ilMailExplorer; use ilMailGUI; @@ -60,10 +60,10 @@ public function getToolsForContextStack( ->tool($identification('mail_folders_tree')) ->withTitle($title) ->withSymbol($icon) - ->withContentWrapper(function (): Legacy { + ->withContentWrapper(function (): Content { $exp = new ilMailExplorer(new ilMailGUI(), $this->dic->user()->getId()); - return $this->dic->ui()->factory()->legacy($exp->getHTML(true)); + return $this->dic->ui()->factory()->legacy()->content($exp->getHTML(true)); }); } diff --git a/components/ILIAS/Mail/classes/Provider/MailMainBarProvider.php b/components/ILIAS/Mail/classes/Provider/MailMainBarProvider.php index 936aa1541cc3..f3575187bc5e 100755 --- a/components/ILIAS/Mail/classes/Provider/MailMainBarProvider.php +++ b/components/ILIAS/Mail/classes/Provider/MailMainBarProvider.php @@ -54,7 +54,7 @@ public function getStaticSubItems(): array ->withPosition(10) ->withSymbol($icon) ->withNonAvailableReason( - $this->dic->ui()->factory()->legacy($this->dic->language()->txt('component_not_active')) + $this->dic->ui()->factory()->legacy()->content($this->dic->language()->txt('component_not_active')) ) ->withAvailableCallable( static function () use ($dic): bool { diff --git a/components/ILIAS/MainMenu/classes/Provider/StandardTopItemsProvider.php b/components/ILIAS/MainMenu/classes/Provider/StandardTopItemsProvider.php index d9a6c4e35ec5..b703235f51f7 100755 --- a/components/ILIAS/MainMenu/classes/Provider/StandardTopItemsProvider.php +++ b/components/ILIAS/MainMenu/classes/Provider/StandardTopItemsProvider.php @@ -103,7 +103,7 @@ public function getStaticTopItems(): array ->withTitle($title) ->withAction("ilias.php?baseClass=ilDashboardGUI&cmd=jumpToMemberships") ->withPosition(10) - ->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt('component_not_active')}")) + ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt('component_not_active')}")) ->withAvailableCallable( function () { return true; diff --git a/components/ILIAS/MediaPool/GlobalScreen/classes/class.ilMediaPoolGSToolProvider.php b/components/ILIAS/MediaPool/GlobalScreen/classes/class.ilMediaPoolGSToolProvider.php index aad9374a69b7..e6ee870e6c0d 100755 --- a/components/ILIAS/MediaPool/GlobalScreen/classes/class.ilMediaPoolGSToolProvider.php +++ b/components/ILIAS/MediaPool/GlobalScreen/classes/class.ilMediaPoolGSToolProvider.php @@ -46,7 +46,7 @@ public function getToolsForContextStack(CalledContexts $called_contexts): array return $this->identification_provider->contextAwareIdentifier($id); }; $l = function (string $content) { - return $this->dic->ui()->factory()->legacy($content); + return $this->dic->ui()->factory()->legacy()->content($content); }; $ref_id = $called_contexts->current()->getReferenceId()->toInt(); diff --git a/components/ILIAS/MediaPool/classes/class.ilObjMediaPoolGUI.php b/components/ILIAS/MediaPool/classes/class.ilObjMediaPoolGUI.php index 5eb4a0cbb933..6ff9040d4ef7 100755 --- a/components/ILIAS/MediaPool/classes/class.ilObjMediaPoolGUI.php +++ b/components/ILIAS/MediaPool/classes/class.ilObjMediaPoolGUI.php @@ -1399,7 +1399,7 @@ public static function getPreviewModalHTML( $modal = $internal_gui->ui()->factory()->modal()->roundtrip( $lng->txt("preview"), - $internal_gui->ui()->factory()->legacy("") + $internal_gui->ui()->factory()->legacy()->content("") ); $html = $internal_gui->ui()->renderer()->render($modal); $html = str_replace( diff --git a/components/ILIAS/MetaData/classes/Copyright/NullRenderer.php b/components/ILIAS/MetaData/classes/Copyright/NullRenderer.php index 7521dfec7042..1993abd4a431 100644 --- a/components/ILIAS/MetaData/classes/Copyright/NullRenderer.php +++ b/components/ILIAS/MetaData/classes/Copyright/NullRenderer.php @@ -22,13 +22,13 @@ use ILIAS\UI\Component\Image\Image; use ILIAS\UI\Component\Link\Link; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; class NullRenderer implements RendererInterface { /** * Returns a string in a legacy UI component if only a string can be returned. - * @return Image[]|Link[]|Legacy[] + * @return Image[]|Link[]|Content[] */ public function toUIComponents(CopyrightDataInterface $copyright): array { diff --git a/components/ILIAS/MetaData/classes/Copyright/Renderer.php b/components/ILIAS/MetaData/classes/Copyright/Renderer.php index 98f95164d544..3db6fc2c30db 100755 --- a/components/ILIAS/MetaData/classes/Copyright/Renderer.php +++ b/components/ILIAS/MetaData/classes/Copyright/Renderer.php @@ -25,7 +25,7 @@ use ILIAS\UI\Component\Link\Link; use ILIAS\ResourceStorage\Services as IRSS; use ILIAS\UI\Component\Link\Relationship; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; class Renderer implements RendererInterface { @@ -43,7 +43,7 @@ public function __construct( } /** - * @return Icon[]|Link[]|Legacy[] + * @return Icon[]|Link[]|Content[] */ public function toUIComponents(CopyrightDataInterface $copyright): array { @@ -149,9 +149,9 @@ protected function standardLink(string $label, string $action): Link return $this->factory->link()->standard($label, $action); } - protected function textInLegacy(string $text): Legacy + protected function textInLegacy(string $text): Content { - return $this->factory->legacy($text); + return $this->factory->legacy()->content($text); } protected function getSourceFromIRSS(string $string_id): string diff --git a/components/ILIAS/MetaData/classes/Copyright/RendererInterface.php b/components/ILIAS/MetaData/classes/Copyright/RendererInterface.php index e8081139e76c..79adadd0a909 100755 --- a/components/ILIAS/MetaData/classes/Copyright/RendererInterface.php +++ b/components/ILIAS/MetaData/classes/Copyright/RendererInterface.php @@ -22,13 +22,13 @@ use ILIAS\UI\Component\Image\Image; use ILIAS\UI\Component\Link\Link; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; interface RendererInterface { /** * Returns a string in a legacy UI component if only a string can be returned. - * @return Image[]|Link[]|Legacy[] + * @return Image[]|Link[]|Content[] */ public function toUIComponents(CopyrightDataInterface $copyright): array; diff --git a/components/ILIAS/MetaData/classes/Services/CopyrightHelper/Copyright.php b/components/ILIAS/MetaData/classes/Services/CopyrightHelper/Copyright.php index c5af0f5251b0..e4a897927729 100644 --- a/components/ILIAS/MetaData/classes/Services/CopyrightHelper/Copyright.php +++ b/components/ILIAS/MetaData/classes/Services/CopyrightHelper/Copyright.php @@ -22,7 +22,7 @@ use ILIAS\UI\Component\Image\Image; use ILIAS\UI\Component\Link\Link; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\MetaData\Copyright\EntryInterface; use ILIAS\MetaData\Copyright\RendererInterface; use ILIAS\MetaData\Copyright\Identifiers\HandlerInterface as IdentifierHandler; @@ -74,7 +74,7 @@ public function description(): string * The copyright as UI Components, as it should be presented in the * UI almost everywhere. * If only a string can be returned, it is returned in a legacy UI component. - * @return Image[]|Link[]|Legacy[] + * @return Image[]|Link[]|Content[] */ public function presentAsUIComponents(): array { diff --git a/components/ILIAS/MetaData/classes/Services/CopyrightHelper/CopyrightInterface.php b/components/ILIAS/MetaData/classes/Services/CopyrightHelper/CopyrightInterface.php index e335d49d86bd..5d621c940584 100644 --- a/components/ILIAS/MetaData/classes/Services/CopyrightHelper/CopyrightInterface.php +++ b/components/ILIAS/MetaData/classes/Services/CopyrightHelper/CopyrightInterface.php @@ -22,7 +22,7 @@ use ILIAS\UI\Component\Image\Image; use ILIAS\UI\Component\Link\Link; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; interface CopyrightInterface { @@ -40,7 +40,7 @@ public function description(): string; * The copyright as UI Components, as it should be presented in the * UI almost everywhere. * If only a string can be returned, it is returned in a legacy UI component. - * @return Image[]|Link[]|Legacy[] + * @return Image[]|Link[]|Content[] */ public function presentAsUIComponents(): array; diff --git a/components/ILIAS/MetaData/classes/Services/CopyrightHelper/NullCopyright.php b/components/ILIAS/MetaData/classes/Services/CopyrightHelper/NullCopyright.php index 0f76f4b7e9ba..e710bf873277 100644 --- a/components/ILIAS/MetaData/classes/Services/CopyrightHelper/NullCopyright.php +++ b/components/ILIAS/MetaData/classes/Services/CopyrightHelper/NullCopyright.php @@ -22,7 +22,7 @@ use ILIAS\UI\Component\Image\Image; use ILIAS\UI\Component\Link\Link; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; class NullCopyright implements CopyrightInterface { @@ -55,7 +55,7 @@ public function description(): string * The copyright as UI Components, as it should be presented in the * UI almost everywhere. * If only a string can be returned, it is returned in a legacy UI component. - * @return Image[]|Link[]|Legacy[] + * @return Image[]|Link[]|Content[] */ public function presentAsUIComponents(): array { diff --git a/components/ILIAS/MetaData/tests/Copyright/RendererTest.php b/components/ILIAS/MetaData/tests/Copyright/RendererTest.php index 1cbb57df6854..b3b3273858c5 100755 --- a/components/ILIAS/MetaData/tests/Copyright/RendererTest.php +++ b/components/ILIAS/MetaData/tests/Copyright/RendererTest.php @@ -23,10 +23,10 @@ use PHPUnit\Framework\TestCase; use ILIAS\UI\Component\Symbol\Icon\Icon; use ILIAS\UI\Component\Link\Link; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Implementation\Component\Symbol\Icon\Icon as IIcon; use ILIAS\UI\Implementation\Component\Link\Link as ILink; -use ILIAS\UI\Implementation\Component\Legacy\Legacy as ILegacy; +use ILIAS\UI\Implementation\Component\Legacy\Content as ILegacy; use ILIAS\Filesystem\Filesystem as WebFiles; use ILIAS\UI\Factory; use ILIAS\ResourceStorage\Services as IRSS; @@ -39,14 +39,14 @@ class RendererTest extends TestCase protected function getMockRenderer( Icon $icon, Link $link, - Legacy $legacy, + Content $legacy, string $src_from_irss ): Renderer { return new class ($icon, $link, $legacy, $src_from_irss) extends Renderer { public function __construct( protected Icon $icon, protected Link $link, - protected Legacy $legacy, + protected Content $legacy, protected string $src_from_irss ) { } @@ -70,7 +70,7 @@ protected function standardLink(string $label, string $action): Link return $this->link; } - protected function textInLegacy(string $text): Legacy + protected function textInLegacy(string $text): Content { /** @noinspection PhpUndefinedMethodInspection */ $this->legacy->checkParams($text); @@ -101,7 +101,7 @@ protected function getMockLink(): MockObject|Link ->getMock(); } - protected function getMockLegacy(): MockObject|Legacy + protected function getMockLegacy(): MockObject|Content { return $this->getMockBuilder(ILegacy::class) ->disableOriginalConstructor() @@ -252,7 +252,7 @@ public function altText(): string $result = $renderer->toUIComponents($data); $this->assertSame(2, count($result)); $this->assertInstanceOf(Icon::class, $result[0]); - $this->assertInstanceOf(Legacy::class, $result[1]); + $this->assertInstanceOf(Content::class, $result[1]); } public function testToUIComponentsWithLinkNoImage(): void diff --git a/components/ILIAS/MetaData/tests/Services/CopyrightHelper/CopyrightTest.php b/components/ILIAS/MetaData/tests/Services/CopyrightHelper/CopyrightTest.php index 715ea835830c..656365b9cf38 100644 --- a/components/ILIAS/MetaData/tests/Services/CopyrightHelper/CopyrightTest.php +++ b/components/ILIAS/MetaData/tests/Services/CopyrightHelper/CopyrightTest.php @@ -30,14 +30,14 @@ use ILIAS\MetaData\Copyright\Identifiers\NullHandler; use ILIAS\MetaData\Copyright\NullRenderer; use PHPUnit\Framework\MockObject\MockObject; -use ILIAS\UI\Component\Legacy\Legacy; -use ILIAS\UI\Implementation\Component\Legacy\Legacy as ILegacy; +use ILIAS\UI\Component\Legacy\Content; +use ILIAS\UI\Implementation\Component\Legacy\Content as ILegacy; use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount; use ILIAS\MetaData\Copyright\CopyrightData; class CopyrightTest extends TestCase { - protected function getLegacyComponent(): MockObject|Legacy + protected function getLegacyComponent(): MockObject|Content { return $this->getMockBuilder(ILegacy::class) ->disableOriginalConstructor() @@ -50,7 +50,7 @@ protected function getRenderer(): RendererInterface $legacy_component = $this->getLegacyComponent(); return new class ($legacy_component, $this->any()) extends NullRenderer { public function __construct( - protected MockObject|Legacy $legacy, + protected MockObject|Content $legacy, protected AnyInvokedCount $any ) { } diff --git a/components/ILIAS/MyStaff/classes/Provider/StaffMainBarProvider.php b/components/ILIAS/MyStaff/classes/Provider/StaffMainBarProvider.php index f5453059c2b7..8a9ec404538c 100755 --- a/components/ILIAS/MyStaff/classes/Provider/StaffMainBarProvider.php +++ b/components/ILIAS/MyStaff/classes/Provider/StaffMainBarProvider.php @@ -89,7 +89,7 @@ function (): bool { new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance()) )->hasCurrentUserAccessToMyStaff(); } - )->withNonAvailableReason($dic->ui()->factory()->legacy("{$dic->language()->txt('component_not_active')}")); + )->withNonAvailableReason($dic->ui()->factory()->legacy()->content("{$dic->language()->txt('component_not_active')}")); $title = $this->dic->language()->txt("mm_enrolments"); $icon = $this->dic->ui()->factory()->symbol()->icon()->custom( @@ -119,7 +119,7 @@ function (): bool { new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance()) )->hasCurrentUserAccessToCourseMemberships(); } - )->withNonAvailableReason($dic->ui()->factory()->legacy("{$dic->language()->txt('component_not_active')}")); + )->withNonAvailableReason($dic->ui()->factory()->legacy()->content("{$dic->language()->txt('component_not_active')}")); // My Certificates $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::CERT, $title); @@ -144,7 +144,7 @@ function (): bool { new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance()) )->hasCurrentUserAccessToCertificates(); } - )->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt("component_not_active")}")); + )->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt("component_not_active")}")); // My Competences $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::SKMG, $title); @@ -169,7 +169,7 @@ function (): bool { new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance()) )->hasCurrentUserAccessToCompetences(); } - )->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt("component_not_active")}")); + )->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt("component_not_active")}")); return $items; } diff --git a/components/ILIAS/News/classes/Provider/NewsMainBarProvider.php b/components/ILIAS/News/classes/Provider/NewsMainBarProvider.php index f25ac9115a21..498f6d767136 100755 --- a/components/ILIAS/News/classes/Provider/NewsMainBarProvider.php +++ b/components/ILIAS/News/classes/Provider/NewsMainBarProvider.php @@ -47,7 +47,7 @@ public function getStaticSubItems(): array ->withParent(StandardTopItemsProvider::getInstance()->getCommunicationIdentification()) ->withPosition(30) ->withSymbol($icon) - ->withNonAvailableReason($this->dic->ui()->factory()->legacy($this->dic->language()->txt('component_not_active'))) + ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content($this->dic->language()->txt('component_not_active'))) ->withAvailableCallable( static function () use ($dic): bool { return !($dic->settings()->get("block_activated_news") === null); diff --git a/components/ILIAS/News/classes/class.ilNewsForContextBlockGUI.php b/components/ILIAS/News/classes/class.ilNewsForContextBlockGUI.php index 478e1a873877..f11dad55b582 100755 --- a/components/ILIAS/News/classes/class.ilNewsForContextBlockGUI.php +++ b/components/ILIAS/News/classes/class.ilNewsForContextBlockGUI.php @@ -779,7 +779,7 @@ public function showNews(): string } else { $title = $lng->txt("news_internal_news"); } - $panel = $this->ui->factory()->panel()->standard($title, $this->ui->factory()->legacy($content)); + $panel = $this->ui->factory()->panel()->standard($title, $this->ui->factory()->legacy()->content($content)); $parameter_name = 'news_page'; @@ -1190,7 +1190,7 @@ public function showFeedUrl(): string $panel = $this->ui->factory()->panel()->standard( $lng->txt("news_internal_news"), - $this->ui->factory()->legacy($tpl->get()) + $this->ui->factory()->legacy()->content($tpl->get()) ); return $this->ui->renderer()->render($panel); diff --git a/components/ILIAS/News/classes/class.ilNewsTimelineGUI.php b/components/ILIAS/News/classes/class.ilNewsTimelineGUI.php index faea1160efce..adb47e969e40 100755 --- a/components/ILIAS/News/classes/class.ilNewsTimelineGUI.php +++ b/components/ILIAS/News/classes/class.ilNewsTimelineGUI.php @@ -457,7 +457,7 @@ protected function getEditModal($form = null): \ILIAS\UI\Component\Modal\Modal $modal = $this->gui->ui()->factory()->modal()->roundtrip( $this->lng->txt("edit"), - $this->ui->factory()->legacy($form->getHTML()) + $this->ui->factory()->legacy()->content($form->getHTML()) ); return $modal; @@ -468,7 +468,7 @@ protected function renderDeleteModal(ilTemplate $tpl): void $mbox = $this->gui->ui()->factory()->messageBox()->confirmation( $this->lng->txt("news_really_delete_news") ); - $title = $this->gui->ui()->factory()->legacy("

"); + $title = $this->gui->ui()->factory()->legacy()->content("

"); $modal = $this->gui->modal($this->lng->txt("delete")) ->content([$title, $mbox]) ->button($this->lng->txt("delete"), "#", false, "il.News.remove(); return false;"); diff --git a/components/ILIAS/News/classes/class.ilPDNewsBlockGUI.php b/components/ILIAS/News/classes/class.ilPDNewsBlockGUI.php index ab343df00dbe..272bef3ecd3d 100755 --- a/components/ILIAS/News/classes/class.ilPDNewsBlockGUI.php +++ b/components/ILIAS/News/classes/class.ilPDNewsBlockGUI.php @@ -233,7 +233,7 @@ public function showFeedUrl(): string $panel = $this->ui->factory()->panel()->standard( $lng->txt("news_internal_news"), - $this->ui->factory()->legacy($tpl->get()) + $this->ui->factory()->legacy()->content($tpl->get()) ); return $this->ui->renderer()->render($panel); diff --git a/components/ILIAS/Notes/GlobalScreen/classes/NotesMainBarProvider.php b/components/ILIAS/Notes/GlobalScreen/classes/NotesMainBarProvider.php index 0901e9ee67bb..624812ba31e0 100755 --- a/components/ILIAS/Notes/GlobalScreen/classes/NotesMainBarProvider.php +++ b/components/ILIAS/Notes/GlobalScreen/classes/NotesMainBarProvider.php @@ -48,7 +48,7 @@ public function getStaticSubItems(): array ->withParent(StandardTopItemsProvider::getInstance()->getCommunicationIdentification()) ->withPosition(50) ->withSymbol($icon) - ->withNonAvailableReason($this->dic->ui()->factory()->legacy($this->dic->language()->txt('component_not_active'))) + ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content($this->dic->language()->txt('component_not_active'))) ->withAvailableCallable( static function () use ($dic): bool { return !$dic->settings()->get("disable_comments"); @@ -66,7 +66,7 @@ static function () use ($dic): bool { ->withParent(StandardTopItemsProvider::getInstance()->getPersonalWorkspaceIdentification()) ->withPosition(70) ->withSymbol($icon) - ->withNonAvailableReason($this->dic->ui()->factory()->legacy($this->dic->language()->txt('component_not_active'))) + ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content($this->dic->language()->txt('component_not_active'))) ->withAvailableCallable( static function () use ($dic): bool { return !$dic->settings()->get("disable_notes"); diff --git a/components/ILIAS/Notes/Service/class.InternalGUIService.php b/components/ILIAS/Notes/Service/class.InternalGUIService.php index c919d238e253..d10b4ce3d2af 100755 --- a/components/ILIAS/Notes/Service/class.InternalGUIService.php +++ b/components/ILIAS/Notes/Service/class.InternalGUIService.php @@ -90,7 +90,7 @@ public function initJavascript( public function getModalTemplate(): array { $ui = $this->ui(); - $modal = $ui->factory()->modal()->roundtrip('#notes_title#', $ui->factory()->legacy('')); + $modal = $ui->factory()->modal()->roundtrip('#notes_title#', $ui->factory()->legacy()->content('')); $modalt["show"] = $modal->getShowSignal()->getId(); $modalt["close"] = $modal->getCloseSignal()->getId(); $modalt["template"] = $ui->renderer()->renderAsync($modal); diff --git a/components/ILIAS/OnScreenChat/classes/Provider/OnScreenChatProvider.php b/components/ILIAS/OnScreenChat/classes/Provider/OnScreenChatProvider.php index 5519480c1e61..7f491a5a6a4e 100755 --- a/components/ILIAS/OnScreenChat/classes/Provider/OnScreenChatProvider.php +++ b/components/ILIAS/OnScreenChat/classes/Provider/OnScreenChatProvider.php @@ -126,7 +126,7 @@ static function ($id): string { ) ]; - return $this->dic->ui()->factory()->legacy($this->dic->ui()->renderer()->render($components)); + return $this->dic->ui()->factory()->legacy()->content($this->dic->ui()->renderer()->render($components)); }) ->withParent(StandardTopItemsProvider::getInstance()->getCommunicationIdentification()) ->withPosition(40) diff --git a/components/ILIAS/OnScreenChat/classes/class.ilOnScreenChatGUI.php b/components/ILIAS/OnScreenChat/classes/class.ilOnScreenChatGUI.php index 521659c3ba9e..23d2fbd4ac6e 100755 --- a/components/ILIAS/OnScreenChat/classes/class.ilOnScreenChatGUI.php +++ b/components/ILIAS/OnScreenChat/classes/class.ilOnScreenChatGUI.php @@ -98,7 +98,7 @@ public function executeCommand(): void case 'inviteModal': $this->dic->language()->loadLanguageModule('chatroom'); $txt = $this->dic->language()->txt(...); - $modal = $this->dic->ui()->factory()->modal()->roundtrip($txt('chat_osc_invite_to_conversation'), $this->dic->ui()->factory()->legacy($txt('chat_osc_search_modal_info')), [ + $modal = $this->dic->ui()->factory()->modal()->roundtrip($txt('chat_osc_invite_to_conversation'), $this->dic->ui()->factory()->legacy()->content($txt('chat_osc_search_modal_info')), [ $this->dic->ui()->factory()->input()->field()->text($txt('chat_osc_user')), ])->withSubmitLabel($txt('confirm')); $response = $this->renderAsyncModal('inviteModal', $modal); diff --git a/components/ILIAS/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthorityFormGUI.php b/components/ILIAS/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthorityFormGUI.php index ab9994d047af..075a3d6587db 100755 --- a/components/ILIAS/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthorityFormGUI.php +++ b/components/ILIAS/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthorityFormGUI.php @@ -41,7 +41,7 @@ public function initFormElements(): void $c = new ilCustomInputGUI($this->lng->txt('authorities')); $f = $this->parent_gui->dic()->ui()->factory(); $r = $this->parent_gui->dic()->ui()->renderer(); - $modal = $f->modal()->roundtrip("Modal", $f->legacy(''))->withCloseWithKeyboard(false); + $modal = $f->modal()->roundtrip("Modal", $f->legacy()->content(''))->withCloseWithKeyboard(false); $button = $f->button() ->shy($this->lng->txt("open_authorities_modal"), '#') ->withOnClick($modal->getShowSignal()); diff --git a/components/ILIAS/OrgUnit/classes/Provider/OrgUnitMainBarProvider.php b/components/ILIAS/OrgUnit/classes/Provider/OrgUnitMainBarProvider.php index f603f5a971fe..9b9a8dd0ec79 100755 --- a/components/ILIAS/OrgUnit/classes/Provider/OrgUnitMainBarProvider.php +++ b/components/ILIAS/OrgUnit/classes/Provider/OrgUnitMainBarProvider.php @@ -69,7 +69,7 @@ public function getStaticSubItems(): array $linkOrgUnit = $this->mainmenu->link($this->orgUnitIdentifier) ->withAlwaysAvailable(true) ->withAction($action) - ->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')}")) ->withParent($this->organisationIdentifier) ->withTitle($title) ->withSymbol($icon) @@ -90,7 +90,7 @@ public function getStaticSubItems(): array $linkEmployeeTalkTemplates = $this->mainmenu->link($this->employeeTalkTemplateIdentifier) ->withAlwaysAvailable(true) ->withAction($action) - ->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')}")) ->withParent($this->organisationIdentifier) ->withTitle($title) ->withSymbol($icon) @@ -109,7 +109,7 @@ public function getStaticSubItems(): array $icon = $this->dic->ui()->factory()->symbol()->icon()->standard('org', $title); $items[] = $this->mainmenu->linkList($this->organisationIdentifier) ->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')}")) ->withParent($top) ->withTitle($title) ->withSymbol($icon) diff --git a/components/ILIAS/PersonalWorkspace/GlobalScreen/classes/class.WorkspaceMainBarProvider.php b/components/ILIAS/PersonalWorkspace/GlobalScreen/classes/class.WorkspaceMainBarProvider.php index 9c2c15c25adf..94d9a2a27c30 100755 --- a/components/ILIAS/PersonalWorkspace/GlobalScreen/classes/class.WorkspaceMainBarProvider.php +++ b/components/ILIAS/PersonalWorkspace/GlobalScreen/classes/class.WorkspaceMainBarProvider.php @@ -53,7 +53,7 @@ public function getStaticSubItems(): array ->withParent(StandardTopItemsProvider::getInstance()->getPersonalWorkspaceIdentification()) ->withPosition(60) ->withSymbol($icon) - ->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt('component_not_active')}")) + ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt('component_not_active')}")) ->withAvailableCallable( function () use ($dic) { return !$dic->settings()->get("disable_personal_workspace"); diff --git a/components/ILIAS/PersonalWorkspace/GlobalScreen/classes/class.ilWorkspaceGSToolProvider.php b/components/ILIAS/PersonalWorkspace/GlobalScreen/classes/class.ilWorkspaceGSToolProvider.php index 45a0518ee91e..ec897800fc5b 100755 --- a/components/ILIAS/PersonalWorkspace/GlobalScreen/classes/class.ilWorkspaceGSToolProvider.php +++ b/components/ILIAS/PersonalWorkspace/GlobalScreen/classes/class.ilWorkspaceGSToolProvider.php @@ -32,7 +32,7 @@ public function getToolsForContextStack(CalledContexts $called_contexts): array return $this->identification_provider->contextAwareIdentifier($id); }; $l = function (string $content) { - return $this->dic->ui()->factory()->legacy($content); + return $this->dic->ui()->factory()->legacy()->content($content); }; $ref_id = $called_contexts->current()->getReferenceId()->toInt(); $tools[] = $this->factory->tool($iff("tree")) diff --git a/components/ILIAS/Portfolio/Exercise/class.ilPortfolioExerciseGUI.php b/components/ILIAS/Portfolio/Exercise/class.ilPortfolioExerciseGUI.php index 7253a3173020..4bce49daa75f 100755 --- a/components/ILIAS/Portfolio/Exercise/class.ilPortfolioExerciseGUI.php +++ b/components/ILIAS/Portfolio/Exercise/class.ilPortfolioExerciseGUI.php @@ -227,7 +227,7 @@ protected static function getExerciseInfo( } if ($tooltip) { - $modal = $ui->factory()->modal()->roundtrip($lng->txt("exc_instruction"), $ui->factory()->legacy($tooltip)) + $modal = $ui->factory()->modal()->roundtrip($lng->txt("exc_instruction"), $ui->factory()->legacy()->content($tooltip)) ->withCancelButtonLabel($lng->txt("close")); $elements[] = $modal; $buttons[] = $ui->factory()->button()->standard($lng->txt("exc_instruction"), '#') diff --git a/components/ILIAS/Portfolio/classes/Provider/PortfolioMainBarProvider.php b/components/ILIAS/Portfolio/classes/Provider/PortfolioMainBarProvider.php index ab30e461630c..8151b6f5f3e5 100755 --- a/components/ILIAS/Portfolio/classes/Provider/PortfolioMainBarProvider.php +++ b/components/ILIAS/Portfolio/classes/Provider/PortfolioMainBarProvider.php @@ -46,7 +46,7 @@ public function getStaticSubItems(): array ->withParent(StandardTopItemsProvider::getInstance()->getPersonalWorkspaceIdentification()) ->withPosition(50) ->withSymbol($icon) - ->withNonAvailableReason($this->dic->ui()->factory()->legacy(($this->dic->language()->txt('component_not_active')))) + ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content(($this->dic->language()->txt('component_not_active')))) ->withAvailableCallable( function () use ($dic) { return (bool) ($dic->settings()->get('user_portfolios')); diff --git a/components/ILIAS/Repository/GlobalScreen/classes/RepositoryMainBarProvider.php b/components/ILIAS/Repository/GlobalScreen/classes/RepositoryMainBarProvider.php index e765db5a3c9e..49a467171455 100755 --- a/components/ILIAS/Repository/GlobalScreen/classes/RepositoryMainBarProvider.php +++ b/components/ILIAS/Repository/GlobalScreen/classes/RepositoryMainBarProvider.php @@ -35,7 +35,7 @@ use ILIAS\Repository\StandardGUIRequest; use ilStr; use ilPDSelectedItemsBlockViewSettings; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ilFavouritesListGUI; /** @@ -96,8 +96,8 @@ public function getStaticSubItems(): array $entries[] = $this->mainmenu->complex($this->if->identifier('rep_tree_view')) ->withVisibilityCallable($access_helper->isRepositoryVisible()) - ->withContentWrapper(function () use ($ref_id): Legacy { - return $this->dic->ui()->factory()->legacy($this->renderRepoTree($ref_id)); + ->withContentWrapper(function () use ($ref_id): Content { + return $this->dic->ui()->factory()->legacy()->content($this->renderRepoTree($ref_id)); }) ->withSupportsAsynchronousLoading($asynch) ->withTitle($title) @@ -116,8 +116,8 @@ public function getStaticSubItems(): array ->withPosition(30) ->withSymbol($icon) ->withParent($top) - ->withContentWrapper(function () use ($p): Legacy { - return $this->dic->ui()->factory()->legacy($p->renderLastVisited()); + ->withContentWrapper(function () use ($p): Content { + return $this->dic->ui()->factory()->legacy()->content($p->renderLastVisited()); }); $title = $this->dic->language()->txt("mm_favorites"); diff --git a/components/ILIAS/Repository/Service/Modal/class.ModalAdapterGUI.php b/components/ILIAS/Repository/Service/Modal/class.ModalAdapterGUI.php index a02392a31554..c1bc1b304297 100755 --- a/components/ILIAS/Repository/Service/Modal/class.ModalAdapterGUI.php +++ b/components/ILIAS/Repository/Service/Modal/class.ModalAdapterGUI.php @@ -70,7 +70,7 @@ public function getTitle(): string public function legacy(string $content): self { - $this->ui_content = [$this->ui->factory()->legacy($content)]; + $this->ui_content = [$this->ui->factory()->legacy()->content($content)]; $this->form = null; return $this; } @@ -139,7 +139,7 @@ protected function getModalWithContent(): Modal\RoundTrip { $modal = []; if (!is_null($this->form)) { - $this->ui_content = [$this->ui->factory()->legacy($this->form->render())]; + $this->ui_content = [$this->ui->factory()->legacy()->content($this->form->render())]; } $modal = $this->ui->factory()->modal()->roundtrip($this->getTitle(), $this->ui_content); if (count($this->action_buttons) > 0) { @@ -174,7 +174,7 @@ public function renderAsyncTriggerButton(string $button_title, string $url, $shy public function getAsyncTriggerButtonComponents(string $button_title, string $url, $shy = true): array { $ui = $this->ui; - $modal = $ui->factory()->modal()->roundtrip("", $ui->factory()->legacy("")); + $modal = $ui->factory()->modal()->roundtrip("", $ui->factory()->legacy()->content("")); $url .= '&replaceSignal=' . $modal->getReplaceSignal()->getId(); $modal = $modal->withAsyncRenderUrl($url); if ($shy) { diff --git a/components/ILIAS/Search/classes/Provider/SearchMetaBarProvider.php b/components/ILIAS/Search/classes/Provider/SearchMetaBarProvider.php index af92b9f2d4f1..3a404ad15287 100755 --- a/components/ILIAS/Search/classes/Provider/SearchMetaBarProvider.php +++ b/components/ILIAS/Search/classes/Provider/SearchMetaBarProvider.php @@ -55,7 +55,7 @@ public function getMetaBarItems(): array $html = $main_search->getHTML(); } - return $this->dic->ui()->factory()->legacy($uip->getHTML($html))->withAdditionalOnLoadCode( + return $this->dic->ui()->factory()->legacy()->content($uip->getHTML($html))->withAdditionalOnLoadCode( fn($id) => 'il.SearchMainMenu.init()' ); }; diff --git a/components/ILIAS/Setup/src/Metrics/Metric.php b/components/ILIAS/Setup/src/Metrics/Metric.php index 4349bc698527..71d6d53160d4 100755 --- a/components/ILIAS/Setup/src/Metrics/Metric.php +++ b/components/ILIAS/Setup/src/Metrics/Metric.php @@ -329,7 +329,7 @@ public function extractByStability(string $stability): array public function toUIReport(Factory $f, string $name): Report { $yaml = $this->toYAML(); - $sub = $f->panel()->sub("", $f->legacy("
" . $yaml . "
")); + $sub = $f->panel()->sub("", $f->legacy()->content("
" . $yaml . "
")); return $f->panel()->report($name, [$sub]); } } diff --git a/components/ILIAS/Setup/tests/Metrics/MetricTest.php b/components/ILIAS/Setup/tests/Metrics/MetricTest.php index 75f7d5974d5a..4d8f0cb306bc 100755 --- a/components/ILIAS/Setup/tests/Metrics/MetricTest.php +++ b/components/ILIAS/Setup/tests/Metrics/MetricTest.php @@ -262,14 +262,18 @@ public function testToUIReport(): void $listing_f = new LF(); $panel_f = new PF($listing_f); $signal = new SignalGenerator(); - $legacy_f = new \ILIAS\UI\Implementation\Component\Legacy\Factory($signal); - $legacy = $legacy_f->legacy("
string
"); + $legacy_f = $this->createMock(\ILIAS\UI\Implementation\Component\Legacy\Factory::class); + $legacy = $legacy_f->content("
string
"); + + $legacy_f + ->expects($this->once()) + ->method("content") + ->willReturn($legacy); $factory ->expects($this->once()) ->method("legacy") - ->with("
" . "string" . "
") - ->willReturn($legacy) + ->willReturn($legacy_f) ; $factory diff --git a/components/ILIAS/Skill/GlobalScreen/Provider/SkillMainBarProvider.php b/components/ILIAS/Skill/GlobalScreen/Provider/SkillMainBarProvider.php index 44b5aba0af22..f95f3f9e8113 100755 --- a/components/ILIAS/Skill/GlobalScreen/Provider/SkillMainBarProvider.php +++ b/components/ILIAS/Skill/GlobalScreen/Provider/SkillMainBarProvider.php @@ -66,7 +66,7 @@ public function getStaticSubItems(): array ->withParent(StandardTopItemsProvider::getInstance()->getAchievementsIdentification()) ->withPosition(20) ->withSymbol($icon) - ->withNonAvailableReason($this->dic->ui()->factory()->legacy($this->dic->language()->txt('component_not_active'))) + ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content($this->dic->language()->txt('component_not_active'))) ->withAvailableCallable( static function (): bool { $skmg_set = new ilSetting("skmg"); diff --git a/components/ILIAS/Skill/GlobalScreen/classes/class.ilSkillGSToolProvider.php b/components/ILIAS/Skill/GlobalScreen/classes/class.ilSkillGSToolProvider.php index a1b0890bc359..120d7e562e43 100755 --- a/components/ILIAS/Skill/GlobalScreen/classes/class.ilSkillGSToolProvider.php +++ b/components/ILIAS/Skill/GlobalScreen/classes/class.ilSkillGSToolProvider.php @@ -22,7 +22,7 @@ use ILIAS\GlobalScreen\Scope\Tool\Provider\AbstractDynamicToolProvider; use ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts; use ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; /** * Workspace GS tool provider @@ -66,8 +66,8 @@ public function getToolsForContextStack(CalledContexts $called_contexts): array $tools[] = $this->factory->tool($this->identification_provider->contextAwareIdentifier("tree")) ->withTitle($title) ->withSymbol($icon) - ->withContentWrapper(function () use ($tree_id): Legacy { - return $this->dic->ui()->factory()->legacy($this->getSkillTree($tree_id)); + ->withContentWrapper(function () use ($tree_id): Content { + return $this->dic->ui()->factory()->legacy()->content($this->getSkillTree($tree_id)); }); } @@ -79,8 +79,8 @@ public function getToolsForContextStack(CalledContexts $called_contexts): array $tools[] = $this->factory->tool($this->identification_provider->contextAwareIdentifier("tree")) ->withTitle("Templates") ->withSymbol($icon) - ->withContentWrapper(function () use ($tree_id): Legacy { - return $this->dic->ui()->factory()->legacy($this->getTemplateTree($tree_id)); + ->withContentWrapper(function () use ($tree_id): Content { + return $this->dic->ui()->factory()->legacy()->content($this->getTemplateTree($tree_id)); }); } return $tools; diff --git a/components/ILIAS/Skill/Personal/class.ilPersonalSkillsGUI.php b/components/ILIAS/Skill/Personal/class.ilPersonalSkillsGUI.php index d175a1b1ec98..f3452d7ff83b 100755 --- a/components/ILIAS/Skill/Personal/class.ilPersonalSkillsGUI.php +++ b/components/ILIAS/Skill/Personal/class.ilPersonalSkillsGUI.php @@ -711,7 +711,7 @@ public function renderSkillHTML( } if (!$has_at_least_one_entry) { - $panel_comps[] = $this->ui_fac->legacy("
" . $lng->txt("skmg_no_skill_entries")); + $panel_comps[] = $this->ui_fac->legacy()->content("
" . $lng->txt("skmg_no_skill_entries")); } // suggested resources diff --git a/components/ILIAS/StudyProgramme/classes/class.ilObjStudyProgrammeAutoCategoriesGUI.php b/components/ILIAS/StudyProgramme/classes/class.ilObjStudyProgrammeAutoCategoriesGUI.php index 6c3474cd20d4..82ba2f13d7f6 100755 --- a/components/ILIAS/StudyProgramme/classes/class.ilObjStudyProgrammeAutoCategoriesGUI.php +++ b/components/ILIAS/StudyProgramme/classes/class.ilObjStudyProgrammeAutoCategoriesGUI.php @@ -145,7 +145,7 @@ protected function view(bool $profile_not_public = false): void continue; } [$title, $link] = $this->getItemPath($ref_id); - $usr = $this->getUserRepresentation($ac->getLastEditorId()) ?? $this->ui_factory->legacy('-'); + $usr = $this->getUserRepresentation($ac->getLastEditorId()) ?? $this->ui_factory->legacy()->content('-'); $modal = $this->getModal($ref_id); $collected_modals[] = $modal; $actions = $this->getItemAction( @@ -322,7 +322,7 @@ function ($id) use ($form_id) { $modal = $this->ui_factory->modal() ->roundtrip( $this->lng->txt('modal_categories_title'), - $this->ui_factory->legacy($form->getHtml()) + $this->ui_factory->legacy()->content($form->getHtml()) ) ->withActionButtons([$submit]) ->withAdditionalOnLoadCode( @@ -361,7 +361,7 @@ protected function getForm(?int $current_ref_id = null): ilPropertyFormGUI $form->addItem($cat); $hi = new ilHiddenInputGUI(self::F_CATEGORY_ORIGINAL_REF); - $hi->setValue((string)$current_ref_id ?? ""); + $hi->setValue((string) $current_ref_id ?? ""); $form->addItem($hi); return $form; @@ -403,7 +403,7 @@ protected function getItemAction( protected function getUserRepresentation(int $usr_id): ?Link { $username = ilObjUser::_lookupName($usr_id); - if(array_filter($username) === []) { + if (array_filter($username) === []) { return null; } @@ -431,7 +431,7 @@ protected function getItemPath(int $cat_ref_id): array $hops = array_map( static function (array $c): string { - return ilObject::_lookupTitle((int)$c["obj_id"]); + return ilObject::_lookupTitle((int) $c["obj_id"]); }, $this->tree->getPathFull($cat_ref_id) ); diff --git a/components/ILIAS/StudyProgramme/classes/class.ilObjStudyProgrammeAutoMembershipsGUI.php b/components/ILIAS/StudyProgramme/classes/class.ilObjStudyProgrammeAutoMembershipsGUI.php index 3df7c3a2a19e..6615fec085f6 100755 --- a/components/ILIAS/StudyProgramme/classes/class.ilObjStudyProgrammeAutoMembershipsGUI.php +++ b/components/ILIAS/StudyProgramme/classes/class.ilObjStudyProgrammeAutoMembershipsGUI.php @@ -139,7 +139,7 @@ protected function nextStep(): void $modal = $this->ui_factory->modal()->roundtrip( $this->txt('modal_member_auto_select_title'), - $this->ui_factory->legacy($form->getHtml()) + $this->ui_factory->legacy()->content($form->getHtml()) ); $submit = $this->ui_factory->button()->primary($this->txt('add'), "#")->withOnLoadCode( @@ -169,7 +169,7 @@ protected function view(bool $profile_not_public = false): void $data = []; foreach ($this->getObject()->getAutomaticMembershipSources() as $ams) { $title = $this->getTitleRepresentation($ams); - $usr = $this->getUserRepresentation($ams->getLastEditorId()) ?? $this->ui_factory->legacy('-'); + $usr = $this->getUserRepresentation($ams->getLastEditorId()) ?? $this->ui_factory->legacy()->content('-'); $modal = $this->getModal($ams->getSourceType(), $ams->getSourceId(), $ams->isSearchRecursive()); $collected_modals[] = $modal; $src_id = $ams->getSourceType() . '-' . $ams->getSourceId() . '-' . $ams->isSearchRecursive(); @@ -401,7 +401,7 @@ protected function getAsynchModalOutput(): void $modal = $this->ui_factory->modal()->roundtrip( $this->txt('modal_member_auto_select_title'), - $this->ui_factory->legacy($form->getHtml()) + $this->ui_factory->legacy()->content($form->getHtml()) ); $this->ctrl->setParameter($this, self::F_ORIGINAL_SOURCE_TYPE, $current_src_type); @@ -706,7 +706,7 @@ protected function getTitleRepresentation( case ilStudyProgrammeAutoMembershipSource::TYPE_ROLE: $title = ilObjRole::_lookupTitle($src_id) ?? "-"; - if($this->rbac_review->isGlobalRole($src_id)) { + if ($this->rbac_review->isGlobalRole($src_id)) { $parent_ref = self::ROLEFOLDER_REF_ID; $path = ['ilAdministrationGUI']; $this->ctrl->setParameterByClass('ilObjRoleGUI', 'admin_mode', 'settings'); @@ -714,7 +714,7 @@ protected function getTitleRepresentation( $parent_ref = $this->rbac_review->getObjectReferenceOfRole($src_id); $parent_type = ilObject::_lookupType($parent_ref, true); $path = ['ilRepositoryGUI','ilObjCategoryGUI']; - if($parent_type == 'orgu') { + if ($parent_type == 'orgu') { $path = ['ilAdministrationGUI','ilObjOrgUnitGUI']; } $path[] = 'ilPermissionGUI'; diff --git a/components/ILIAS/Style/System/classes/Documentation/class.ilKSDocumentationEntryGUI.php b/components/ILIAS/Style/System/classes/Documentation/class.ilKSDocumentationEntryGUI.php index 605a3a1ca441..8c2bfb4f5662 100755 --- a/components/ILIAS/Style/System/classes/Documentation/class.ilKSDocumentationEntryGUI.php +++ b/components/ILIAS/Style/System/classes/Documentation/class.ilKSDocumentationEntryGUI.php @@ -115,12 +115,12 @@ public function createUIComponentOfEntry(): Report } catch (\ILIAS\UI\NotImplementedException $e) { $example = "
This component is not yet fully implemented.
"; } - $content_part_1 = $this->f->legacy($example); + $content_part_1 = $this->f->legacy()->content($example); $code = str_replace('" . $geshi->parse_code() . '
'; - $content_part_2 = $this->f->legacy($code_html); + $content_part_2 = $this->f->legacy()->content($code_html); $content = [$content_part_1, $content_part_2]; $sub_panels[] = $this->f->panel()->sub($title, $content); } diff --git a/components/ILIAS/Style/System/classes/Provider/SystemStylesGlobalScreenToolProvider.php b/components/ILIAS/Style/System/classes/Provider/SystemStylesGlobalScreenToolProvider.php index f452565564ce..747047e58a98 100755 --- a/components/ILIAS/Style/System/classes/Provider/SystemStylesGlobalScreenToolProvider.php +++ b/components/ILIAS/Style/System/classes/Provider/SystemStylesGlobalScreenToolProvider.php @@ -19,7 +19,7 @@ declare(strict_types=1); use ILIAS\GlobalScreen\Scope\Tool\Provider\AbstractDynamicToolProvider; -use ILIAS\GlobalScreen\Scope\Tool\Factory\Tool; +use ILIAS\GlobalScreen\Scope\Tool\Factory\Tool; use ILIAS\UI\Component\Tree\Tree; use ILIAS\UI\Implementation\Crawler\Entry\ComponentEntries as Entries; use ILIAS\Data\URI; @@ -71,7 +71,7 @@ protected function buildTreeAsTool(): Tool ->tool($id_generator('system_styles_tree')) ->withTitle($title) ->withSymbol($icon) - ->withContent($this->dic->ui()->factory()->legacy($this->dic->ui()->renderer()->render($this->getUITree()))); + ->withContent($this->dic->ui()->factory()->legacy()->content($this->dic->ui()->renderer()->render($this->getUITree()))); } protected function getUITree(): Tree diff --git a/components/ILIAS/Survey/Evaluation/class.ilSurveyEvaluationGUI.php b/components/ILIAS/Survey/Evaluation/class.ilSurveyEvaluationGUI.php index bc110902d1ff..275fc2ec1ceb 100755 --- a/components/ILIAS/Survey/Evaluation/class.ilSurveyEvaluationGUI.php +++ b/components/ILIAS/Survey/Evaluation/class.ilSurveyEvaluationGUI.php @@ -863,12 +863,12 @@ public function evaluation( $qblock = ilObjSurvey::_getQuestionblock($qdata["questionblock_id"]); if ($qblock["show_blocktitle"]) { $listing->node( - $this->ui->factory()->legacy($qdata["questionblock_title"]), + $this->ui->factory()->legacy()->content($qdata["questionblock_title"]), "q" . $qdata["questionblock_id"] ); } else { $listing->node( - $this->ui->factory()->legacy(""), + $this->ui->factory()->legacy()->content(""), "q" . $qdata["questionblock_id"] ); } @@ -887,7 +887,7 @@ public function evaluation( $toc_tpl->setVariable("LIST", $listing->render()); //TABLE OF CONTENTS - $panel_toc = $ui_factory->panel()->standard("", $ui_factory->legacy($toc_tpl->get())); + $panel_toc = $ui_factory->panel()->standard("", $ui_factory->legacy()->content($toc_tpl->get())); $render_toc = $ui_renderer->render($panel_toc); $dtmpl->setVariable("PANEL_TOC", $render_toc); diff --git a/components/ILIAS/Survey/Mode/class.AbstractUIModifier.php b/components/ILIAS/Survey/Mode/class.AbstractUIModifier.php index ffc57ea5f0ea..ac129ab82ffd 100755 --- a/components/ILIAS/Survey/Mode/class.AbstractUIModifier.php +++ b/components/ILIAS/Survey/Mode/class.AbstractUIModifier.php @@ -367,7 +367,7 @@ public function getDetailPanels( // Question title anchor $anchor_id = "svyrdq" . $question->getId(); $title = "$qst_title"; - $panel_qst_card = $ui_factory->panel()->sub($title, $ui_factory->legacy($svy_text)) + $panel_qst_card = $ui_factory->panel()->sub($title, $ui_factory->legacy()->content($svy_text)) ->withFurtherInformation($this->getPanelCard($question_res)); $panels[] = $panel_qst_card; @@ -390,7 +390,7 @@ public function getDetailPanels( )); - $panels[] = $ui_factory->panel()->sub("", $ui_factory->legacy($a_tpl->get())); + $panels[] = $ui_factory->panel()->sub("", $ui_factory->legacy()->content($a_tpl->get())); return $panels; } @@ -558,7 +558,7 @@ protected function getPanelCard( return $ui_factory->card() ->standard($svy_type_title) ->withSections( - array($ui_factory->legacy($card_table_tpl->get())) + array($ui_factory->legacy()->content($card_table_tpl->get())) ); } } diff --git a/components/ILIAS/Tagging/GlobalScreen/classes/TaggingMainBarProvider.php b/components/ILIAS/Tagging/GlobalScreen/classes/TaggingMainBarProvider.php index c31e31805913..24361423b830 100755 --- a/components/ILIAS/Tagging/GlobalScreen/classes/TaggingMainBarProvider.php +++ b/components/ILIAS/Tagging/GlobalScreen/classes/TaggingMainBarProvider.php @@ -60,7 +60,7 @@ public function getStaticSubItems(): array ->withContentWrapper(function () { $tag_ui = new \ilTaggingSlateContentGUI(); - return $this->dic->ui()->factory()->legacy($tag_ui->render()); + return $this->dic->ui()->factory()->legacy()->content($tag_ui->render()); }) ->withParent(StandardTopItemsProvider::getInstance()->getPersonalWorkspaceIdentification()) ->withPosition(20), diff --git a/components/ILIAS/Tagging/classes/class.ilTaggingGUI.php b/components/ILIAS/Tagging/classes/class.ilTaggingGUI.php index 15d131f8e9bf..4670687f0d35 100755 --- a/components/ILIAS/Tagging/classes/class.ilTaggingGUI.php +++ b/components/ILIAS/Tagging/classes/class.ilTaggingGUI.php @@ -292,7 +292,7 @@ public static function getModalTemplate(): array global $DIC; $ui = $DIC->ui(); - $modal = $ui->factory()->modal()->roundtrip('#tag_title#', $ui->factory()->legacy('')); + $modal = $ui->factory()->modal()->roundtrip('#tag_title#', $ui->factory()->legacy()->content('')); $modalt["show"] = $modal->getShowSignal()->getId(); $modalt["close"] = $modal->getCloseSignal()->getId(); $modalt["template"] = $ui->renderer()->renderAsync($modal); diff --git a/components/ILIAS/Taxonomy/GlobalScreen/classes/class.ilTaxonomyGSToolProvider.php b/components/ILIAS/Taxonomy/GlobalScreen/classes/class.ilTaxonomyGSToolProvider.php index 2c5fe826b182..50ad1e4e43ea 100755 --- a/components/ILIAS/Taxonomy/GlobalScreen/classes/class.ilTaxonomyGSToolProvider.php +++ b/components/ILIAS/Taxonomy/GlobalScreen/classes/class.ilTaxonomyGSToolProvider.php @@ -45,12 +45,12 @@ public function getToolsForContextStack(CalledContexts $called_contexts): array ): \ILIAS\GlobalScreen\Identification\IdentificationInterface => $this->identification_provider->contextAwareIdentifier($id); $l = fn( string $content - ): \ILIAS\UI\Component\Legacy\Legacy => $this->dic->ui()->factory()->legacy($content); + ): \ILIAS\UI\Component\Legacy\Content => $this->dic->ui()->factory()->legacy()->content($content); $tools[] = $this->factory->tool($iff("tree")) ->withTitle($title) ->withSymbol($icon) ->withContentWrapper(fn( - ): \ILIAS\UI\Component\Legacy\Legacy => $l($this->getEditTree( + ): \ILIAS\UI\Component\Legacy\Content => $l($this->getEditTree( $additional_data->get(self::TAX_TREE_GUI_PATH), $additional_data->get(self::TAX_ID), $additional_data->get(self::TAX_TREE_CMD), diff --git a/components/ILIAS/Test/classes/class.ilObjTestGUI.php b/components/ILIAS/Test/classes/class.ilObjTestGUI.php index 20065bb93257..7b69ca1c7971 100755 --- a/components/ILIAS/Test/classes/class.ilObjTestGUI.php +++ b/components/ILIAS/Test/classes/class.ilObjTestGUI.php @@ -1370,7 +1370,7 @@ protected function importFile(string $file_to_import, string $path_to_uploaded_f $panel = $this->ui_factory->panel()->standard( $this->lng->txt('import_tst'), [ - $this->ui_factory->legacy($this->lng->txt('qpl_import_verify_found_questions')), + $this->ui_factory->legacy()->content($this->lng->txt('qpl_import_verify_found_questions')), $form ] ); diff --git a/components/ILIAS/Test/classes/class.ilTestEvaluationGUI.php b/components/ILIAS/Test/classes/class.ilTestEvaluationGUI.php index e60c5fbd4ded..b47bae7ce50b 100755 --- a/components/ILIAS/Test/classes/class.ilTestEvaluationGUI.php +++ b/components/ILIAS/Test/classes/class.ilTestEvaluationGUI.php @@ -152,7 +152,7 @@ function (string $v): SubPanel { 'ADM_CONTENT', $this->ui_renderer->render([ $results_panel, - $this->ui_factory->legacy('')->withAdditionalOnLoadCode( + $this->ui_factory->legacy()->content('')->withAdditionalOnLoadCode( fn(string $id): string => 'setTimeout(() => {window.print();}, 50)' ) ]) diff --git a/components/ILIAS/Test/classes/class.ilTestToplistGUI.php b/components/ILIAS/Test/classes/class.ilTestToplistGUI.php index 6d40fe70a8a3..43f10133a9d7 100755 --- a/components/ILIAS/Test/classes/class.ilTestToplistGUI.php +++ b/components/ILIAS/Test/classes/class.ilTestToplistGUI.php @@ -92,7 +92,7 @@ protected function buildMedianMarkPanel(): Panel return $this->ui_factory->panel()->standard( $title, - $this->ui_factory->legacy($content) + $this->ui_factory->legacy()->content($content) ); } diff --git a/components/ILIAS/Test/src/Logging/TestError.php b/components/ILIAS/Test/src/Logging/TestError.php index c36df26c99f1..a102e6b1f32a 100644 --- a/components/ILIAS/Test/src/Logging/TestError.php +++ b/components/ILIAS/Test/src/Logging/TestError.php @@ -21,9 +21,8 @@ namespace ILIAS\Test\Logging; use ILIAS\Test\Utilities\TitleColumnsBuilder; - use ILIAS\UI\Factory as UIFactory; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Component\Table\DataRowBuilder; use ILIAS\UI\Component\Table\DataRow; @@ -119,8 +118,8 @@ public function getParsedAdditionalInformation( AdditionalInformationGenerator $additional_info, UIFactory $ui_factory, array $environment - ): Legacy { - return $ui_factory->legacy($this->error_message); + ): Content { + return $ui_factory->legacy()->content($this->error_message); } public function toStorage(): array diff --git a/components/ILIAS/Test/src/Logging/TestUserInteraction.php b/components/ILIAS/Test/src/Logging/TestUserInteraction.php index cb6428e592d7..65423f81cd74 100644 --- a/components/ILIAS/Test/src/Logging/TestUserInteraction.php +++ b/components/ILIAS/Test/src/Logging/TestUserInteraction.php @@ -19,10 +19,9 @@ namespace ILIAS\Test\Logging; use ILIAS\Test\Utilities\TitleColumnsBuilder; - use ILIAS\UI\Factory as UIFactory; use ILIAS\UI\Component\Listing\Descriptive as DescriptiveListing; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Component\Table\DataRowBuilder; use ILIAS\UI\Component\Table\DataRow; @@ -48,6 +47,6 @@ public function getParsedAdditionalInformation( AdditionalInformationGenerator $additional_info, UIFactory $ui_factory, array $environment - ): DescriptiveListing|Legacy; + ): DescriptiveListing|Content; public function toStorage(): array; } diff --git a/components/ILIAS/Test/src/Presentation/class.TestScreenGUI.php b/components/ILIAS/Test/src/Presentation/class.TestScreenGUI.php index e3729c7945aa..f08b7e8703f3 100755 --- a/components/ILIAS/Test/src/Presentation/class.TestScreenGUI.php +++ b/components/ILIAS/Test/src/Presentation/class.TestScreenGUI.php @@ -188,7 +188,7 @@ private function handleRenderIntroduction(array $elements): array ) { $elements[] = $this->ui_factory->panel()->standard( $this->lng->txt('tst_introduction'), - $this->ui_factory->legacy($introduction), + $this->ui_factory->legacy()->content($introduction), ); } diff --git a/components/ILIAS/Test/src/Results/Data/Factory.php b/components/ILIAS/Test/src/Results/Data/Factory.php index 19f5eb01a5d9..506dbf17a6e5 100644 --- a/components/ILIAS/Test/src/Results/Data/Factory.php +++ b/components/ILIAS/Test/src/Results/Data/Factory.php @@ -285,8 +285,8 @@ private function buildAttemptResults( ); if ($show_question_only) { - $usr_solution = $this->ui_renderer->render($this->ui_factory->legacy('
' . $usr_solution . '
')); - $best_solution = $this->ui_renderer->render($this->ui_factory->legacy('
' . $best_solution . '
')); + $usr_solution = $this->ui_renderer->render($this->ui_factory->legacy()->content('
' . $usr_solution . '
')); + $best_solution = $this->ui_renderer->render($this->ui_factory->legacy()->content('
' . $best_solution . '
')); } $feedback = $question_gui->getGenericFeedbackOutput($active_id, $attempt_id); diff --git a/components/ILIAS/TestQuestionPool/classes/class.ilBulkEditQuestionsGUI.php b/components/ILIAS/TestQuestionPool/classes/class.ilBulkEditQuestionsGUI.php index ac1d20fce96f..4178685ae116 100644 --- a/components/ILIAS/TestQuestionPool/classes/class.ilBulkEditQuestionsGUI.php +++ b/components/ILIAS/TestQuestionPool/classes/class.ilBulkEditQuestionsGUI.php @@ -94,7 +94,7 @@ public function executeCommand(): void break; case self::CMD_EDITTAXONOMIES: - $out[] = $this->ui_factory->legacy($this->getFormTaxonomies()->getHTML()); + $out[] = $this->ui_factory->legacy()->content($this->getFormTaxonomies()->getHTML()); break; case self::CMD_SAVETAXONOMIES: case self::CMD_SAVETAXONOMIESADD: diff --git a/components/ILIAS/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php b/components/ILIAS/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php index e7d19217f01b..1fbeca97482b 100755 --- a/components/ILIAS/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php +++ b/components/ILIAS/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php @@ -1352,7 +1352,7 @@ protected function importQuestionsFile(string $path_to_uploaded_file_in_temp_dir $panel = $this->ui_factory->panel()->standard( $this->lng->txt('import_question'), [ - $this->ui_factory->legacy($this->lng->txt('qpl_import_verify_found_questions')), + $this->ui_factory->legacy()->content($this->lng->txt('qpl_import_verify_found_questions')), $form ] ); @@ -1395,7 +1395,7 @@ protected function importFile(string $file_to_import, string $path_to_uploaded_f $panel = $this->ui_factory->panel()->standard( $this->lng->txt('import_qpl'), [ - $this->ui_factory->legacy($this->lng->txt('qpl_import_verify_found_questions')), + $this->ui_factory->legacy()->content($this->lng->txt('qpl_import_verify_found_questions')), $form ] ); diff --git a/components/ILIAS/Tracking/classes/Provider/LPMainBarProvider.php b/components/ILIAS/Tracking/classes/Provider/LPMainBarProvider.php index d1fee24455d1..2377af840632 100755 --- a/components/ILIAS/Tracking/classes/Provider/LPMainBarProvider.php +++ b/components/ILIAS/Tracking/classes/Provider/LPMainBarProvider.php @@ -57,32 +57,33 @@ public function getStaticSubItems(): array return [ $this->mainmenu->link($this->if->identifier('mm_pd_lp')) - ->withTitle($title) - ->withAction( - $ctrl->getLinkTargetByClass( - [ - ilDashboardGUI::class, - ilAchievementsGUI::class, - ilLPPersonalGUI::class - ] - ) - ) - ->withParent( - StandardTopItemsProvider::getInstance()->getAchievementsIdentification() - ) - ->withPosition(30) - ->withSymbol($icon) - ->withNonAvailableReason( - $this->dic->ui()->factory()->legacy( - "{$this->dic->language()->txt('component_not_active')}" - ) - ) - ->withAvailableCallable( - function () { - return ilObjUserTracking::_enabledLearningProgress() && - ilObjUserTracking::_hasLearningProgressLearner(); - } - ), - ]; + ->withTitle($title) + ->withAction( + $ctrl->getLinkTargetByClass( + ["ilDashboardGUI", + "ilAchievementsGUI", + "ilLearningProgressGUI", + 'ilLPListOfProgressGUI' + ] + ) + ) + ->withParent( + StandardTopItemsProvider::getInstance( + )->getAchievementsIdentification() + ) + ->withPosition(30) + ->withSymbol($icon) + ->withNonAvailableReason( + $this->dic->ui()->factory()->legacy()->content( + "{$this->dic->language()->txt('component_not_active')}" + ) + ) + ->withAvailableCallable( + function () { + return ilObjUserTracking::_enabledLearningProgress() && + ilObjUserTracking::_hasLearningProgressLearner(); + } + ), + ]; } } diff --git a/components/ILIAS/Tracking/classes/class.ilLearningProgressBaseGUI.php b/components/ILIAS/Tracking/classes/class.ilLearningProgressBaseGUI.php index f2c400d03bc9..f27eaaf6f893 100755 --- a/components/ILIAS/Tracking/classes/class.ilLearningProgressBaseGUI.php +++ b/components/ILIAS/Tracking/classes/class.ilLearningProgressBaseGUI.php @@ -595,7 +595,7 @@ public function __getLegendHTML(int $variant = ilLPStatusIcons::ICON_VARIANT_LON $panel = $this->ui_factory->panel()->secondary()->legacy( '', - $this->ui_factory->legacy($tpl->get()) + $this->ui_factory->legacy()->content($tpl->get()) ); return $this->ui_renderer->render($panel); diff --git a/components/ILIAS/Tracking/classes/repository_statistics/class.ilLPListOfSettingsGUI.php b/components/ILIAS/Tracking/classes/repository_statistics/class.ilLPListOfSettingsGUI.php index 64af7349eb00..4ab3edd2e7f9 100755 --- a/components/ILIAS/Tracking/classes/repository_statistics/class.ilLPListOfSettingsGUI.php +++ b/components/ILIAS/Tracking/classes/repository_statistics/class.ilLPListOfSettingsGUI.php @@ -612,7 +612,7 @@ protected function handleLPUsageInfo(): string $panel = $this->ui_factory->panel()->secondary()->legacy( $this->lng->txt("trac_lp_settings_info_parent_container"), - $this->ui_factory->legacy($tpl->get()) + $this->ui_factory->legacy()->content($tpl->get()) ); return $this->ui_renderer->render($panel); diff --git a/components/ILIAS/UI/README.md b/components/ILIAS/UI/README.md index 0625d52f283e..63dd517b8385 100755 --- a/components/ILIAS/UI/README.md +++ b/components/ILIAS/UI/README.md @@ -545,7 +545,7 @@ This code snippet shows how to open a modal by clicking on a button: ```php global $DIC; $factory = $DIC->ui()->factory(); -$modal = $factory->modal()->roundtrip('Title', $factory->legacy('Hello World')); +$modal = $factory->modal()->roundtrip('Title', $factory->legacy()->content('Hello World')); $button = $factory->button()->standard('Open Modal', '#') ->withOnClick($modal->getShowSignal()); ``` @@ -560,7 +560,7 @@ This means that a cloned component may trigger the same signals as the original. ```php global $DIC; $factory = $DIC->ui()->factory(); -$modal = $factory->modal()->roundtrip('Title', $factory->legacy('Hello World')); +$modal = $factory->modal()->roundtrip('Title', $factory->legacy()->content('Hello World')); $button1 = $factory->button()->standard('Open Modal', '#') ->withOnClick($modal->getShowSignal()); $button2 = $button1->withLabel('Open the same Modal'); diff --git a/components/ILIAS/UI/src/Component/Entity/Entity.php b/components/ILIAS/UI/src/Component/Entity/Entity.php index 12e7a7dc58a4..1fd4b1140b26 100755 --- a/components/ILIAS/UI/src/Component/Entity/Entity.php +++ b/components/ILIAS/UI/src/Component/Entity/Entity.php @@ -26,7 +26,7 @@ use ILIAS\UI\Component\Symbol\Glyph\Glyph; use ILIAS\UI\Component\Button\Shy; use ILIAS\UI\Component\Button\Tag; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Component\Listing\Property as PropertyListing; use ILIAS\UI\Component\Link\Standard as StandardLink; @@ -42,7 +42,7 @@ interface Entity extends Component * some access restriction for the user on this object. */ public function withBlockingAvailabilityConditions( - PropertyListing | StandardLink | Legacy ...$blocking_conditions + PropertyListing | StandardLink | Content ...$blocking_conditions ): self; /** @@ -52,7 +52,7 @@ public function withBlockingAvailabilityConditions( * place. */ public function withFeaturedProperties( - PropertyListing | StandardLink | Legacy ...$featured_props + PropertyListing | StandardLink | Content ...$featured_props ): self; /** @@ -60,7 +60,7 @@ public function withFeaturedProperties( * "Description" would be one of the most prominent examples. */ public function withMainDetails( - PropertyListing | Legacy ...$main_details + PropertyListing | Content ...$main_details ): self; /** @@ -86,7 +86,7 @@ public function withReactions(Glyph | Tag ...$reactions): self; * you should place them into Blocking Availability Conditions. */ public function withAvailability( - PropertyListing | StandardLink | Legacy ...$availability + PropertyListing | StandardLink | Content ...$availability ): self; /** @@ -94,7 +94,7 @@ public function withAvailability( * but not as significantly important than Main Details or Featured Properties. */ public function withDetails( - PropertyListing | Legacy ...$details + PropertyListing | Content ...$details ): self; /** @@ -109,6 +109,6 @@ public function withActions(Shy ...$actions): self; * the learning Progress of a Course. */ public function withPersonalStatus( - PropertyListing | Legacy ...$personal_status + PropertyListing | Content ...$personal_status ): self; } diff --git a/components/ILIAS/UI/src/Component/Item/Notification.php b/components/ILIAS/UI/src/Component/Item/Notification.php index 57757ca04f60..fd99926ac161 100755 --- a/components/ILIAS/UI/src/Component/Item/Notification.php +++ b/components/ILIAS/UI/src/Component/Item/Notification.php @@ -20,7 +20,7 @@ namespace ILIAS\UI\Component\Item; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Component\Symbol\Icon\Icon; use ILIAS\UI\Component\Dropdown\Standard as DropdownStandard; @@ -36,12 +36,12 @@ interface Notification extends Item * needs to hold legacy content that currently does not have a place in the * UI components. */ - public function withAdditionalContent(Legacy $component): Notification; + public function withAdditionalContent(Content $component): Notification; /** * Get the additional content of the item or null. */ - public function getAdditionalContent(): ?Legacy; + public function getAdditionalContent(): ?Content; /** * Get an Item like this with an url to consulted async, when to close button is pressed. diff --git a/components/ILIAS/UI/src/Component/Legacy/Legacy.php b/components/ILIAS/UI/src/Component/Legacy/Content.php old mode 100755 new mode 100644 similarity index 94% rename from components/ILIAS/UI/src/Component/Legacy/Legacy.php rename to components/ILIAS/UI/src/Component/Legacy/Content.php index d063cddd7836..ed2c61c54ef5 --- a/components/ILIAS/UI/src/Component/Legacy/Legacy.php +++ b/components/ILIAS/UI/src/Component/Legacy/Content.php @@ -29,7 +29,7 @@ * Interface Legacy * @package ILIAS\UI\Component\Legacy */ -interface Legacy extends Component, JavaScriptBindable, Block +interface Content extends Component, JavaScriptBindable, Block { /** * Get content as string stored in this component. @@ -41,7 +41,7 @@ public function getContent(): string; * * @deprecated Should only be used to connect legacy components. Will be removed in the future. Use at your own risk */ - public function withCustomSignal(string $signal_name, string $js_code): Legacy; + public function withCustomSignal(string $signal_name, string $js_code): static; /** * Get signal with custom JavaScript code diff --git a/components/ILIAS/UI/src/Component/Legacy/Factory.php b/components/ILIAS/UI/src/Component/Legacy/Factory.php index 6b92a08261f5..90eef2bd16c2 100755 --- a/components/ILIAS/UI/src/Component/Legacy/Factory.php +++ b/components/ILIAS/UI/src/Component/Legacy/Factory.php @@ -24,8 +24,27 @@ interface Factory { /** + * --- + * description: + * purpose: > + * This component is used to wrap an existing ILIAS UI element into a + * UI component. + * This is useful if a container of the UI components needs to contain + * content that is not yet implement in the centralized UI components. + * composition: > + * The legacy component contains html or any other content as string. + * + * rules: + * usage: + * 1: > + * This component MUST only be used to ensure backwards compatibility + * with existing UI elements in ILIAS, + * therefore it SHOULD only contain Elements which cannot be generated + * using other UI Components. + * --- * @param string $content the content of the legacy component - * @return \ILIAS\UI\Component\Legacy\Legacy + * @return \ILIAS\UI\Component\Legacy\Content */ - public function legacy(string $content): Legacy; + public function content(string $content): Content; + } diff --git a/components/ILIAS/UI/src/Component/Listing/Property.php b/components/ILIAS/UI/src/Component/Listing/Property.php index 4b27a605f2a3..3929f6d8b89d 100755 --- a/components/ILIAS/UI/src/Component/Listing/Property.php +++ b/components/ILIAS/UI/src/Component/Listing/Property.php @@ -21,7 +21,7 @@ namespace ILIAS\UI\Component\Listing; use ILIAS\UI\Component\Symbol\Symbol; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Component\Link\Standard as StandardLink; /** @@ -32,7 +32,7 @@ interface Property extends Listing { public function withProperty( string $label, - string | Symbol | Legacy | StandardLink $value, + string | Symbol | Content | StandardLink $value, bool $show_label = true ): self; } diff --git a/components/ILIAS/UI/src/Component/MainControls/Slate/Factory.php b/components/ILIAS/UI/src/Component/MainControls/Slate/Factory.php index 5f24bfb7bbc5..3061abd6d745 100755 --- a/components/ILIAS/UI/src/Component/MainControls/Slate/Factory.php +++ b/components/ILIAS/UI/src/Component/MainControls/Slate/Factory.php @@ -47,13 +47,13 @@ interface Factory * ---- * @param string $name * @param \ILIAS\UI\Component\Symbol\Symbol $symbol - * @param \ILIAS\UI\Component\Legacy\Legacy $content + * @param \ILIAS\UI\Component\Legacy\Content $content * @return \ILIAS\UI\Component\MainControls\Slate\Legacy */ public function legacy( string $name, Symbol $symbol, - \ILIAS\UI\Component\Legacy\Legacy $content + \ILIAS\UI\Component\Legacy\Content $content ): Legacy; diff --git a/components/ILIAS/UI/src/Component/Panel/Secondary/Factory.php b/components/ILIAS/UI/src/Component/Panel/Secondary/Factory.php index 5704f9ac2fd0..2557f64c3328 100755 --- a/components/ILIAS/UI/src/Component/Panel/Secondary/Factory.php +++ b/components/ILIAS/UI/src/Component/Panel/Secondary/Factory.php @@ -61,8 +61,8 @@ public function listing(string $title, array $item_groups): Component\Panel\Seco * * --- * @param string $title - * @param \ILIAS\UI\Component\Legacy\Legacy $legacy + * @param \ILIAS\UI\Component\Legacy\Content $legacy * @return \ILIAS\UI\Component\Panel\Secondary\Legacy */ - public function legacy(string $title, Component\Legacy\Legacy $legacy): Component\Panel\Secondary\Legacy; + public function legacy(string $title, Component\Legacy\Content $legacy): Component\Panel\Secondary\Legacy; } diff --git a/components/ILIAS/UI/src/Component/Panel/Secondary/Legacy.php b/components/ILIAS/UI/src/Component/Panel/Secondary/Legacy.php index 2cdb1bd5d22c..a1c109b5a580 100755 --- a/components/ILIAS/UI/src/Component/Panel/Secondary/Legacy.php +++ b/components/ILIAS/UI/src/Component/Panel/Secondary/Legacy.php @@ -31,5 +31,5 @@ interface Legacy extends Secondary /** * Get item list */ - public function getLegacyComponent(): Component\Legacy\Legacy; + public function getLegacyComponent(): Component\Legacy\Content; } diff --git a/components/ILIAS/UI/src/Factory.php b/components/ILIAS/UI/src/Factory.php index feada505a8fd..61a6e0c657e1 100755 --- a/components/ILIAS/UI/src/Factory.php +++ b/components/ILIAS/UI/src/Factory.php @@ -25,7 +25,7 @@ use ILIAS\UI\Component\Breadcrumbs\Breadcrumbs; use ILIAS\UI\Component\Deck\Deck; use ILIAS\UI\Component\Card\Card; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy; /** * This is how the factory for UI elements looks. This should provide access @@ -727,21 +727,21 @@ public function dropzone(): C\Dropzone\Factory; * --- * description: * purpose: > - * This component is used to wrap an existing ILIAS UI element into a UI component. This is useful if a container - * of the UI components needs to contain content that is not yet implement in the centralized UI components. + * legacy components are used as provisional elements in the UI framework + * while there are no sophisticated components yet replacing them. * composition: > - * The legacy component contains html or any other content as string. + * Legacy component regularly contain rendered HTML. * * rules: * usage: - * 1: > - * This component MUST only be used to ensure backwards compatibility with existing UI elements in ILIAS, - * therefore it SHOULD only contain Elements which cannot be generated using other UI Components from the UI Service. + * 1: > + * Legacy components MUST only be used to ensure backwards compatibility + * with existing UI elements in ILIAS or to implement temporal and provisional + * dependencies. * --- - * @param string $content - * @return \ILIAS\UI\Component\Legacy\Legacy + * @return \ILIAS\UI\Component\Legacy\Factory */ - public function legacy(string $content): Legacy; + public function legacy(): Legacy\Factory; /** * --- diff --git a/components/ILIAS/UI/src/Implementation/Component/Entity/Entity.php b/components/ILIAS/UI/src/Implementation/Component/Entity/Entity.php index bdf0b93a710a..ad0020d42a9b 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Entity/Entity.php +++ b/components/ILIAS/UI/src/Implementation/Component/Entity/Entity.php @@ -21,16 +21,14 @@ namespace ILIAS\UI\Implementation\Component\Entity; use ILIAS\UI\Component\Entity as I; - use ILIAS\UI\Component\Image\Image; use ILIAS\UI\Component\Symbol\Symbol; use ILIAS\UI\Component\Symbol\Glyph\Glyph; use ILIAS\UI\Component\Button\Shy; use ILIAS\UI\Component\Button\Tag; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Component\Listing\Property as PropertyListing; use ILIAS\UI\Component\Link\Standard as StandardLink; - use ILIAS\UI\Implementation\Component\ComponentHelper; abstract class Entity implements I\Entity @@ -38,15 +36,15 @@ abstract class Entity implements I\Entity use ComponentHelper; /** - * @var array + * @var array */ protected array $blocking_conditions = []; /** - * @var array + * @var array */ protected array $featured_props = []; /** - * @var array + * @var array */ protected array $main_details = []; /** @@ -58,11 +56,11 @@ abstract class Entity implements I\Entity */ protected array $reactions = []; /** - * @var array + * @var array */ protected array $availability = []; /** - * @var array + * @var array */ protected array $details = []; /** @@ -70,7 +68,7 @@ abstract class Entity implements I\Entity */ protected array $actions = []; /** - * @var array + * @var array */ protected array $personal_status = []; @@ -106,14 +104,14 @@ public function getSecondaryIdentifier(): Symbol | Image | Shy | StandardLink | * @inheritdoc */ public function withBlockingAvailabilityConditions( - PropertyListing | StandardLink | Legacy ...$blocking_conditions + PropertyListing | StandardLink | Content ...$blocking_conditions ): self { $clone = clone $this; $clone->blocking_conditions = $blocking_conditions; return $clone; } /** - * @return array + * @return array */ public function getBlockingAvailabilityConditions(): array { @@ -124,14 +122,14 @@ public function getBlockingAvailabilityConditions(): array * @inheritdoc */ public function withFeaturedProperties( - PropertyListing | StandardLink | Legacy ...$featured_props + PropertyListing | StandardLink | Content ...$featured_props ): self { $clone = clone $this; $clone->featured_props = $featured_props; return $clone; } /** - * @return array + * @return array */ public function getFeaturedProperties(): array { @@ -142,14 +140,14 @@ public function getFeaturedProperties(): array * @inheritdoc */ public function withMainDetails( - PropertyListing | Legacy ...$main_details + PropertyListing | Content ...$main_details ): self { $clone = clone $this; $clone->main_details = $main_details; return $clone; } /** - * @return array + * @return array */ public function getMainDetails(): array { @@ -205,14 +203,14 @@ public function getReactions(): array * @inheritdoc */ public function withAvailability( - PropertyListing | StandardLink | Legacy ...$availability + PropertyListing | StandardLink | Content ...$availability ): self { $clone = clone $this; $clone->availability = $availability; return $clone; } /** - * @return array + * @return array */ public function getAvailability(): array { @@ -223,14 +221,14 @@ public function getAvailability(): array * @inheritdoc */ public function withDetails( - PropertyListing | Legacy ...$details + PropertyListing | Content ...$details ): self { $clone = clone $this; $clone->details = $details; return $clone; } /** - * @return array + * @return array */ public function getDetails(): array { @@ -258,14 +256,14 @@ public function getActions(): array * @inheritdoc */ public function withPersonalStatus( - PropertyListing | Legacy ...$personal_status + PropertyListing | Content ...$personal_status ): self { $clone = clone $this; $clone->personal_status = $personal_status; return $clone; } /** - * @return array + * @return array */ public function getPersonalStatus(): array { diff --git a/components/ILIAS/UI/src/Implementation/Component/Input/Field/FilterContextRenderer.php b/components/ILIAS/UI/src/Implementation/Component/Input/Field/FilterContextRenderer.php index f65d35f0a9a2..2716b06e1085 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Input/Field/FilterContextRenderer.php +++ b/components/ILIAS/UI/src/Implementation/Component/Input/Field/FilterContextRenderer.php @@ -108,7 +108,7 @@ protected function renderAddField(array $input_labels, RendererInterface $defaul });"); } $add_tpl->setVariable("LIST", $default_renderer->render($f->listing()->unordered($links))); - $list = $f->legacy($add_tpl->get()); + $list = $f->legacy()->content($add_tpl->get()); $popover = $f->popover()->standard($list)->withVerticalPosition(); $tpl->setVariable("POPOVER", $default_renderer->render($popover)); $add = $f->button()->bulky($f->symbol()->glyph()->add(), "", "")->withOnClick($popover->getShowSignal()); @@ -182,7 +182,7 @@ protected function renderProxyField( $f = $this->getUIFactory(); $tpl = $this->getTemplate("tpl.filter_field.html", true, true); - $popover = $f->popover()->standard($f->legacy($input_html))->withVerticalPosition(); + $popover = $f->popover()->standard($f->legacy()->content($input_html))->withVerticalPosition(); $tpl->setVariable("POPOVER", $default_renderer->render($popover)); $prox = new ProxyFilterField(); diff --git a/components/ILIAS/UI/src/Implementation/Component/Item/Notification.php b/components/ILIAS/UI/src/Implementation/Component/Item/Notification.php index 69aa643f8623..e8cad50c831d 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Item/Notification.php +++ b/components/ILIAS/UI/src/Implementation/Component/Item/Notification.php @@ -21,7 +21,7 @@ namespace ILIAS\UI\Implementation\Component\Item; use ILIAS\UI\Component\Item\Notification as INotification; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Implementation\Component\JavaScriptBindable; use ILIAS\UI\Component\JavaScriptBindable as IJavaScriptBindable; use ILIAS\UI\Component\Symbol\Icon\Icon; @@ -33,7 +33,7 @@ class Notification extends Item implements INotification, IJavaScriptBindable { use JavaScriptBindable; - protected ?Legacy $additional_content = null; + protected ?Content $additional_content = null; protected Icon $lead_icon; protected ?string $close_action = null; @@ -55,7 +55,7 @@ public function __construct($title, Icon $icon) /** * @inheritdoc */ - public function withAdditionalContent(Legacy $additional_content): INotification + public function withAdditionalContent(Content $additional_content): INotification { $clone = clone $this; $clone->additional_content = $additional_content; @@ -65,7 +65,7 @@ public function withAdditionalContent(Legacy $additional_content): INotification /** * @inheritdoc */ - public function getAdditionalContent(): ?Legacy + public function getAdditionalContent(): ?Content { return $this->additional_content; } diff --git a/components/ILIAS/UI/src/Implementation/Component/Legacy/Legacy.php b/components/ILIAS/UI/src/Implementation/Component/Legacy/Content.php old mode 100755 new mode 100644 similarity index 97% rename from components/ILIAS/UI/src/Implementation/Component/Legacy/Legacy.php rename to components/ILIAS/UI/src/Implementation/Component/Legacy/Content.php index cc3810941c90..77a1b4420579 --- a/components/ILIAS/UI/src/Implementation/Component/Legacy/Legacy.php +++ b/components/ILIAS/UI/src/Implementation/Component/Legacy/Content.php @@ -28,10 +28,10 @@ use InvalidArgumentException; /** - * Class Legacy + * Class Content * @package ILIAS\UI\Implementation\Component\Legacy */ -class Legacy implements C\Legacy\Legacy +class Content implements C\Legacy\Content { use ComponentHelper; use JavaScriptBindable; @@ -60,7 +60,7 @@ public function getContent(): string /** * @inheritdoc */ - public function withCustomSignal(string $signal_name, string $js_code): C\Legacy\Legacy + public function withCustomSignal(string $signal_name, string $js_code): static { $clone = clone $this; $clone->registerSignalAndCustomCode($signal_name, $js_code); diff --git a/components/ILIAS/UI/src/Implementation/Component/Legacy/Factory.php b/components/ILIAS/UI/src/Implementation/Component/Legacy/Factory.php index 1e070a037a34..70ba4e064a22 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Legacy/Factory.php +++ b/components/ILIAS/UI/src/Implementation/Component/Legacy/Factory.php @@ -21,6 +21,7 @@ namespace ILIAS\UI\Implementation\Component\Legacy; use ILIAS\UI\Implementation\Component\SignalGeneratorInterface; +use ILIAS\UI\Component as C; class Factory implements \ILIAS\UI\Component\Legacy\Factory { @@ -34,8 +35,8 @@ public function __construct(SignalGeneratorInterface $signal_generator) /** * @inheritdoc */ - public function legacy(string $content): \ILIAS\UI\Component\Legacy\Legacy + public function content(string $content): C\Legacy\Content { - return new Legacy($content, $this->signal_generator); + return new Content($content, $this->signal_generator); } } diff --git a/components/ILIAS/UI/src/Implementation/Component/Legacy/Renderer.php b/components/ILIAS/UI/src/Implementation/Component/Legacy/Renderer.php index 0a608c1de9da..b3ae63412ebd 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Legacy/Renderer.php +++ b/components/ILIAS/UI/src/Implementation/Component/Legacy/Renderer.php @@ -35,7 +35,7 @@ class Renderer extends AbstractComponentRenderer */ public function render(Component\Component $component, RendererInterface $default_renderer): string { - if (!$component instanceof Component\Legacy\Legacy) { + if (!$component instanceof Component\Legacy\Content) { $this->cannotHandleComponent($component); } @@ -44,7 +44,7 @@ public function render(Component\Component $component, RendererInterface $defaul return $component->getContent(); } - protected function registerSignals(Legacy $component): Component\JavaScriptBindable + protected function registerSignals(Content $component): Component\JavaScriptBindable { $custom_signals = $component->getAllCustomSignals(); diff --git a/components/ILIAS/UI/src/Implementation/Component/Listing/Property.php b/components/ILIAS/UI/src/Implementation/Component/Listing/Property.php index 310a3b743a3d..8b6333444355 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Listing/Property.php +++ b/components/ILIAS/UI/src/Implementation/Component/Listing/Property.php @@ -22,7 +22,7 @@ use ILIAS\UI\Component\Listing as IListing; use ILIAS\UI\Component\Symbol\Symbol; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Component\Link\Standard as StandardLink; use ILIAS\UI\Implementation\Component\ComponentHelper; @@ -35,7 +35,7 @@ class Property extends Listing implements IListing\Property use ComponentHelper; protected const ALLOWED_VALUE_TYPES = [ Symbol::class, - Legacy::class, + Content::class, StandardLink::class ]; @@ -59,7 +59,7 @@ public function withItems(array $items): self public function withProperty( string $label, - string | Symbol | Legacy | StandardLink $value, + string | Symbol | Content | StandardLink $value, bool $show_label = true ): self { if (is_array($value)) { diff --git a/components/ILIAS/UI/src/Implementation/Component/MainControls/Slate/Factory.php b/components/ILIAS/UI/src/Implementation/Component/MainControls/Slate/Factory.php index e9c1cb8f8add..75786e6adad1 100755 --- a/components/ILIAS/UI/src/Implementation/Component/MainControls/Slate/Factory.php +++ b/components/ILIAS/UI/src/Implementation/Component/MainControls/Slate/Factory.php @@ -21,7 +21,7 @@ namespace ILIAS\UI\Implementation\Component\MainControls\Slate; use ILIAS\UI\Component\MainControls\Slate as ISlate; -use ILIAS\UI\Component\Legacy\Legacy as ILegacy; +use ILIAS\UI\Component\Legacy\Content as ILegacy; use ILIAS\UI\Implementation\Component\SignalGeneratorInterface; use ILIAS\UI\Component\Counter\Factory as CounterFactory; use ILIAS\UI\Component\Symbol\Symbol; diff --git a/components/ILIAS/UI/src/Implementation/Component/MainControls/Slate/Legacy.php b/components/ILIAS/UI/src/Implementation/Component/MainControls/Slate/Legacy.php index 8ed0092733cc..8d14c8c2e00b 100755 --- a/components/ILIAS/UI/src/Implementation/Component/MainControls/Slate/Legacy.php +++ b/components/ILIAS/UI/src/Implementation/Component/MainControls/Slate/Legacy.php @@ -21,7 +21,7 @@ namespace ILIAS\UI\Implementation\Component\MainControls\Slate; use ILIAS\UI\Component\MainControls\Slate as ISlate; -use ILIAS\UI\Component\Legacy\Legacy as ILegacy; +use ILIAS\UI\Component\Legacy\Content as ILegacy; use ILIAS\UI\Component\Symbol\Symbol; use ILIAS\UI\Implementation\Component\SignalGeneratorInterface; use ILIAS\UI\Component\Component; diff --git a/components/ILIAS/UI/src/Implementation/Component/Modal/LightboxTextPage.php b/components/ILIAS/UI/src/Implementation/Component/Modal/LightboxTextPage.php index 93e2fe4548e6..dd1c14df409e 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Modal/LightboxTextPage.php +++ b/components/ILIAS/UI/src/Implementation/Component/Modal/LightboxTextPage.php @@ -23,7 +23,7 @@ use ILIAS\UI\Component as C; use ILIAS\UI\Component\Modal\LightboxPage; use ILIAS\UI\Implementation\Component\ComponentHelper; -use ILIAS\UI\Implementation\Component\Legacy\Legacy; +use ILIAS\UI\Implementation\Component\Legacy\Content; use ILIAS\UI\Implementation\Component\SignalGenerator; use ILIAS\UI\Component\Modal\LightboxTextPage as ILightboxTextPage; @@ -56,8 +56,8 @@ public function getTitle(): string /** * @inheritdoc */ - public function getComponent(): C\Legacy\Legacy + public function getComponent(): C\Legacy\Content { - return new Legacy($this->text, new SignalGenerator()); + return new Content($this->text, new SignalGenerator()); } } diff --git a/components/ILIAS/UI/src/Implementation/Component/Panel/Secondary/Factory.php b/components/ILIAS/UI/src/Implementation/Component/Panel/Secondary/Factory.php index 59bc5302f967..dbf2ac6753f0 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Panel/Secondary/Factory.php +++ b/components/ILIAS/UI/src/Implementation/Component/Panel/Secondary/Factory.php @@ -39,7 +39,7 @@ public function listing(string $title, array $item_groups): C\Panel\Secondary\Li /** * @inheritdoc */ - public function legacy(string $title, C\Legacy\Legacy $legacy): C\Panel\Secondary\Legacy + public function legacy(string $title, C\Legacy\Content $legacy): C\Panel\Secondary\Legacy { return new Legacy($title, $legacy); } diff --git a/components/ILIAS/UI/src/Implementation/Component/Panel/Secondary/Legacy.php b/components/ILIAS/UI/src/Implementation/Component/Panel/Secondary/Legacy.php index 25effd5b9039..9bfcba2abff8 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Panel/Secondary/Legacy.php +++ b/components/ILIAS/UI/src/Implementation/Component/Panel/Secondary/Legacy.php @@ -27,9 +27,9 @@ */ class Legacy extends Secondary implements C\Panel\Secondary\Legacy { - protected C\Legacy\Legacy $legacy; + protected C\Legacy\Content $legacy; - public function __construct(string $title, C\Legacy\Legacy $legacy) + public function __construct(string $title, C\Legacy\Content $legacy) { $this->title = $title; $this->legacy = $legacy; @@ -38,7 +38,7 @@ public function __construct(string $title, C\Legacy\Legacy $legacy) /** * @inheritdoc */ - public function getLegacyComponent(): C\Legacy\Legacy + public function getLegacyComponent(): C\Legacy\Content { return $this->legacy; } diff --git a/components/ILIAS/UI/src/Implementation/Factory.php b/components/ILIAS/UI/src/Implementation/Factory.php index 5f7ee79ea596..c2d51ad5ad37 100755 --- a/components/ILIAS/UI/src/Implementation/Factory.php +++ b/components/ILIAS/UI/src/Implementation/Factory.php @@ -116,9 +116,9 @@ public function player(): C\Player\Factory /** * @inheritdoc */ - public function legacy(string $content): C\Legacy\Legacy + public function legacy(): C\Legacy\Factory { - return $this->legacy_factory->legacy($content); + return $this->legacy_factory; } /** diff --git a/components/ILIAS/UI/src/examples/Button/Close/modal.php b/components/ILIAS/UI/src/examples/Button/Close/modal.php index 452442a83829..ba1cb2b1f425 100755 --- a/components/ILIAS/UI/src/examples/Button/Close/modal.php +++ b/components/ILIAS/UI/src/examples/Button/Close/modal.php @@ -24,7 +24,7 @@ function modal() $modal = $factory->modal()->roundtrip( 'Close Button Demo', - $factory->legacy('See the Close Button in the top right corner.') + $factory->legacy()->content('See the Close Button in the top right corner.') ); $button1 = $factory->button()->standard('Show Close Button Demo', '#') ->withOnClick($modal->getShowSignal()); diff --git a/components/ILIAS/UI/src/examples/Divider/Vertical/base.php b/components/ILIAS/UI/src/examples/Divider/Vertical/base.php index c2fe4c889c79..3397b260714e 100755 --- a/components/ILIAS/UI/src/examples/Divider/Vertical/base.php +++ b/components/ILIAS/UI/src/examples/Divider/Vertical/base.php @@ -19,7 +19,7 @@ function base() $f = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); - return $renderer->render(array($f->legacy("Some content"), + return $renderer->render(array($f->legacy()->content("Some content"), $f->divider()->vertical(), - $f->legacy("More content"))); + $f->legacy()->content("More content"))); } diff --git a/components/ILIAS/UI/src/examples/Entity/Standard/base.php b/components/ILIAS/UI/src/examples/Entity/Standard/base.php index 7f40491806a7..8edf9f1cec4e 100755 --- a/components/ILIAS/UI/src/examples/Entity/Standard/base.php +++ b/components/ILIAS/UI/src/examples/Entity/Standard/base.php @@ -80,7 +80,7 @@ function base() ->withProperty('Recording', 'recording available', false) ; - $status = $f->legacy( + $status = $f->legacy()->content( $renderer->render($f->symbol()->icon()->custom('./assets/images/learning_progress/in_progress.svg', 'incomplete')) . ' in progress' ); diff --git a/components/ILIAS/UI/src/examples/Entity/Standard/semantic_groups.php b/components/ILIAS/UI/src/examples/Entity/Standard/semantic_groups.php index 1a818f8a52d8..446d679789c3 100755 --- a/components/ILIAS/UI/src/examples/Entity/Standard/semantic_groups.php +++ b/components/ILIAS/UI/src/examples/Entity/Standard/semantic_groups.php @@ -17,12 +17,12 @@ function semantic_groups() $renderer = $DIC->ui()->renderer(); $entity = $f->entity()->standard('Primary Identifier', 'Secondary Identifier') - ->withBlockingAvailabilityConditions($f->legacy('Blocking Conditions')) - ->withFeaturedProperties($f->legacy('Featured_properties')) - ->withPersonalStatus($f->legacy('Personal Status')) - ->withMainDetails($f->legacy('Main Details')) - ->withAvailability($f->legacy('Availability')) - ->withDetails($f->legacy('Details')) + ->withBlockingAvailabilityConditions($f->legacy()->content('Blocking Conditions')) + ->withFeaturedProperties($f->legacy()->content('Featured_properties')) + ->withPersonalStatus($f->legacy()->content('Personal Status')) + ->withMainDetails($f->legacy()->content('Main Details')) + ->withAvailability($f->legacy()->content('Availability')) + ->withDetails($f->legacy()->content('Details')) ->withReactions($f->button()->tag('reaction', '#')) ->withPrioritizedReactions($f->symbol()->glyph()->like()) ->withActions($f->button()->shy('action', '#')) diff --git a/components/ILIAS/UI/src/examples/Input/Container/ViewControl/Standard/base.php b/components/ILIAS/UI/src/examples/Input/Container/ViewControl/Standard/base.php index 759717d8bbff..459c0637a23e 100755 --- a/components/ILIAS/UI/src/examples/Input/Container/ViewControl/Standard/base.php +++ b/components/ILIAS/UI/src/examples/Input/Container/ViewControl/Standard/base.php @@ -64,7 +64,7 @@ function base() ->withRequest($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/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('
Example Block
'), - $ui_factory->legacy('
Another Example Block
'), - $ui_factory->legacy('
And a third block is also part of this group
') + $ui_factory->legacy()->content('
Example Block
'), + $ui_factory->legacy()->content('
Another Example Block
'), + $ui_factory->legacy()->content('
And a third block is also part of this group
') ]; return $renderer->render( diff --git a/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/DynamicallyDistributed/nested.php b/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/DynamicallyDistributed/nested.php index fd91b8a154df..a80cf263e930 100755 --- a/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/DynamicallyDistributed/nested.php +++ b/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/DynamicallyDistributed/nested.php @@ -20,15 +20,15 @@ function nested() $blocks = [ - $ui_factory->legacy('
D
'), - $ui_factory->legacy('
E
'), - $ui_factory->legacy('
F
') + $ui_factory->legacy()->content('
D
'), + $ui_factory->legacy()->content('
E
'), + $ui_factory->legacy()->content('
F
') ]; $aligned = $ui_factory->layout()->alignment()->horizontal()->dynamicallyDistributed( - $ui_factory->legacy('
A
'), - $ui_factory->legacy('
B
'), - $ui_factory->legacy('
C
') + $ui_factory->legacy()->content('
A
'), + $ui_factory->legacy()->content('
B
'), + $ui_factory->legacy()->content('
C
') ); return $renderer->render( diff --git a/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/EvenlyDistributed/base.php b/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/EvenlyDistributed/base.php index fd0868551c82..cbcde2ae1388 100755 --- a/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/EvenlyDistributed/base.php +++ b/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/EvenlyDistributed/base.php @@ -19,9 +19,9 @@ function base() $tpl->addCss('assets/ui-examples/css/alignment_examples.css'); $edl = $ui_factory->layout()->alignment()->horizontal()->evenlyDistributed( - $ui_factory->legacy('
Example Block
'), - $ui_factory->legacy('
Another Example Block
'), - $ui_factory->legacy('
And a third block is also part of this group
') + $ui_factory->legacy()->content('
Example Block
'), + $ui_factory->legacy()->content('
Another Example Block
'), + $ui_factory->legacy()->content('
And a third block is also part of this group
') ); return $renderer->render($edl); diff --git a/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/EvenlyDistributed/nested.php b/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/EvenlyDistributed/nested.php index b81ee346d87b..736f064fa020 100755 --- a/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/EvenlyDistributed/nested.php +++ b/components/ILIAS/UI/src/examples/Layout/Alignment/Horizontal/EvenlyDistributed/nested.php @@ -19,15 +19,15 @@ function nested() $tpl->addCss('assets/ui-examples/css/alignment_examples.css'); $blocks = [ - $ui_factory->legacy('
D
'), - $ui_factory->legacy('
E
'), - $ui_factory->legacy('
F
') + $ui_factory->legacy()->content('
D
'), + $ui_factory->legacy()->content('
E
'), + $ui_factory->legacy()->content('
F
') ]; $aligned = $ui_factory->layout()->alignment()->horizontal()->evenlyDistributed( - $ui_factory->legacy('
A
'), - $ui_factory->legacy('
B
'), - $ui_factory->legacy('
C
') + $ui_factory->legacy()->content('
A
'), + $ui_factory->legacy()->content('
B
'), + $ui_factory->legacy()->content('
C
') ); return $renderer->render( diff --git a/components/ILIAS/UI/src/examples/Layout/Alignment/Vertical/base.php b/components/ILIAS/UI/src/examples/Layout/Alignment/Vertical/base.php index b12b91f80653..637d8af0bdb2 100755 --- a/components/ILIAS/UI/src/examples/Layout/Alignment/Vertical/base.php +++ b/components/ILIAS/UI/src/examples/Layout/Alignment/Vertical/base.php @@ -19,9 +19,9 @@ function base() $tpl->addCss('assets/ui-examples/css/alignment_examples.css'); $blocks = [ - $ui_factory->legacy('
Example Block
'), - $ui_factory->legacy('
Another Example Block
'), - $ui_factory->legacy('
And a third block is also part of this group
') + $ui_factory->legacy()->content('
Example Block
'), + $ui_factory->legacy()->content('
Another Example Block
'), + $ui_factory->legacy()->content('
And a third block is also part of this group
') ]; $vertical = $ui_factory->layout()->alignment()->vertical(...$blocks); diff --git a/components/ILIAS/UI/src/examples/Layout/Alignment/Vertical/nested.php b/components/ILIAS/UI/src/examples/Layout/Alignment/Vertical/nested.php index 8797a4c62078..8beb4d4cca90 100755 --- a/components/ILIAS/UI/src/examples/Layout/Alignment/Vertical/nested.php +++ b/components/ILIAS/UI/src/examples/Layout/Alignment/Vertical/nested.php @@ -20,11 +20,11 @@ function nested() $icon = $ui_factory->image()->standard("assets/images/logo/HeaderIconResponsive.svg", "ilias"); $blocks = [ - $ui_factory->legacy('
Example Block
'), + $ui_factory->legacy()->content('
Example Block
'), $icon, - $ui_factory->legacy('
Another Example Block
'), + $ui_factory->legacy()->content('
Another Example Block
'), $icon, - $ui_factory->legacy('
And a third block is also part of this group
') + $ui_factory->legacy()->content('
And a third block is also part of this group
') ]; $dynamic = $ui_factory->layout()->alignment()->horizontal()->dynamicallyDistributed(...$blocks); @@ -36,9 +36,9 @@ function nested() $vertical = $ui_factory->layout()->alignment()->vertical( - $ui_factory->legacy('
The block above.
'), + $ui_factory->legacy()->content('
The block above.
'), $evenly, - $ui_factory->legacy('
The block below.
') + $ui_factory->legacy()->content('
The block below.
') ); diff --git a/components/ILIAS/UI/src/examples/Layout/Page/Standard/ui.php b/components/ILIAS/UI/src/examples/Layout/Page/Standard/ui.php index 9946d1e2f556..5aa1687d4cd2 100755 --- a/components/ILIAS/UI/src/examples/Layout/Page/Standard/ui.php +++ b/components/ILIAS/UI/src/examples/Layout/Page/Standard/ui.php @@ -209,7 +209,7 @@ function pagedemoContent(\ILIAS\UI\Factory $f, Renderer $r, MainBar $mainbar): a $f->panel()->standard( 'Demo Content 2', - $f->legacy("some content
some content
some content
x.") + $f->legacy()->content("some content
some content
some content
x.") ), $f->panel()->standard( 'Demo Content 3', @@ -217,7 +217,7 @@ function pagedemoContent(\ILIAS\UI\Factory $f, Renderer $r, MainBar $mainbar): a ), $f->panel()->standard( 'Demo Content 4', - $f->legacy("some content
some content
some content
x.") + $f->legacy()->content("some content
some content
some content
x.") ) ]; } @@ -256,7 +256,7 @@ function pagedemoMetabar(\ILIAS\UI\Factory $f): \ILIAS\UI\Component\MainControls $notes = $f->maincontrols()->slate()->legacy( 'Notification', $f->symbol()->glyph()->notification()->withCounter($f->counter()->novelty(3)), - $f->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('

Help

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('

Editor

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('

tool 1

Some Text for Tool 1 entry

')); + $slate = $f->mainControls()->slate()->legacy('Help', $symbol, $f->legacy()->content('

tool 1

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('

Fischotter

Der Fischotter (Lutra lutra) ist ein an das Wasserleben angepasster Marder, der zu den besten Schwimmern unter den Landraubtieren zählt.

') + $f->legacy()->content('

Fischotter

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('

Maulwurf

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('

Maulwurf

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('

Reh

Das Reh springt hoch,
das Reh springt weit.
Warum auch nicht?
Es hat ja Zeit.

') + $f->legacy()->content('

Reh

Das Reh springt hoch,
das Reh springt weit.
Warum auch nicht?
Es hat ja Zeit.

') ]; break; case 4: $t = 'Tier des Jahres: Bachflohkrebs'; $c = [ - $f->legacy('

Bachflohkrebs

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.

') + $f->legacy()->content('

Bachflohkrebs

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.

') ,$f->link()->standard("Quelle: Wikipedia", "https://de.wikipedia.org/wiki/Tier_des_Jahres") ]; break; case 5: $t = 'Tier des Jahres: Wildkatze'; $c = [ - $f->legacy('

Wildkatze

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('

Wildkatze

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('

Glühwürmchen

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('

Glühwürmchen

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('

Frühbarock

etwa 1600 bis 1650
unter italienischer Dominanz, mit etwa Monteverdi, Gabrieli.

') + $f->legacy()->content('

Frühbarock

etwa 1600 bis 1650
unter italienischer Dominanz, mit etwa Monteverdi, Gabrieli.

') ,$f->link()->standard("Quelle: Wikipedia", "https://de.wikipedia.org/wiki/Tier_des_Jahres") ]; break; case 8: $t = 'Hochbarock'; - $c = [$f->legacy('

Hochbarock

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.

')]; + $c = [$f->legacy()->content('

Hochbarock

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.

')]; break; case 9: $t = 'Spätbarock'; - $c = [$f->legacy('

Spätbarock

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.

')]; + $c = [$f->legacy()->content('

Spätbarock

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.

')]; break; default: $t = 'Mainbar-Demo'; - $c = [$f->legacy('Dies ist ein reduziertes Beispiel für die Mainbar des UI-Frameworks.')]; + $c = [$f->legacy()->content('Dies ist ein reduziertes Beispiel für die Mainbar des UI-Frameworks.')]; } return[$t, $c]; diff --git a/components/ILIAS/UI/src/examples/Legacy/base.php b/components/ILIAS/UI/src/examples/Legacy/Content/base.php old mode 100755 new mode 100644 similarity index 84% rename from components/ILIAS/UI/src/examples/Legacy/base.php rename to components/ILIAS/UI/src/examples/Legacy/Content/base.php index f0d8495795e9..60ef88d02d5b --- a/components/ILIAS/UI/src/examples/Legacy/base.php +++ b/components/ILIAS/UI/src/examples/Legacy/Content/base.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ILIAS\UI\examples\Legacy; +namespace ILIAS\UI\examples\Legacy\Content; /** * --- @@ -22,7 +22,7 @@ function base() $renderer = $DIC->ui()->renderer(); //Init Component - $legacy = $f->legacy("Legacy Content"); + $legacy = $f->legacy()->content("Legacy\Content"); //Render return $renderer->render($legacy); diff --git a/components/ILIAS/UI/src/examples/Legacy/inside_panel.php b/components/ILIAS/UI/src/examples/Legacy/Content/inside_panel.php old mode 100755 new mode 100644 similarity index 82% rename from components/ILIAS/UI/src/examples/Legacy/inside_panel.php rename to components/ILIAS/UI/src/examples/Legacy/Content/inside_panel.php index 563addfae180..48404571d2ad --- a/components/ILIAS/UI/src/examples/Legacy/inside_panel.php +++ b/components/ILIAS/UI/src/examples/Legacy/Content/inside_panel.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ILIAS\UI\examples\Legacy; +namespace ILIAS\UI\examples\Legacy\Content; /** * --- @@ -21,7 +21,7 @@ function inside_panel() $renderer = $DIC->ui()->renderer(); //Init Component - $legacy = $f->legacy("Legacy Content"); + $legacy = $f->legacy()->content("Legacy Content"); $panel = $f->panel()->standard("Panel Title", $legacy); //Render diff --git a/components/ILIAS/UI/src/examples/MainControls/MainBar/mainbar.php b/components/ILIAS/UI/src/examples/MainControls/MainBar/mainbar.php index 592c03b7e17a..77f964d621af 100755 --- a/components/ILIAS/UI/src/examples/MainControls/MainBar/mainbar.php +++ b/components/ILIAS/UI/src/examples/MainControls/MainBar/mainbar.php @@ -22,7 +22,7 @@ function mainbar(): string $ctrl->setParameterByClass('ilsystemstyledocumentationgui', 'new_ui', '1'); $url = $ctrl->getLinkTargetByClass('ilsystemstyledocumentationgui', 'entries'); $to_page = $f->link()->standard('Full Screen Page Layout', $url); - $txt = $f->legacy('

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


'), + $f->legacy()->content('

press the link above to init a page with Mode Info


'), $f->divider()->horizontal() ]); } @@ -52,11 +52,11 @@ function renderModeInfoFullscreenMode(\ILIAS\DI\Container $dic) $data_factory = new \ILIAS\Data\Factory(); $renderer = $dic->ui()->renderer(); - $panel_content = $f->legacy("Mode Info is Active"); + $panel_content = $f->legacy()->content("Mode Info is Active"); $slate = $f->mainControls()->slate()->legacy( "Mode Info Active", $f->symbol()->glyph()->notification(), - $f->legacy("Things todo when special Mode is active") + $f->legacy()->content("Things todo when special Mode is active") ); $page = $f->layout()->page()->standard( diff --git a/components/ILIAS/UI/src/examples/MainControls/Slate/Combined/combined.php b/components/ILIAS/UI/src/examples/MainControls/Slate/Combined/combined.php index 42ea763e1f27..e6add7fc653e 100755 --- a/components/ILIAS/UI/src/examples/MainControls/Slate/Combined/combined.php +++ b/components/ILIAS/UI/src/examples/MainControls/Slate/Combined/combined.php @@ -17,7 +17,7 @@ function combined() $renderer = $DIC->ui()->renderer(); $icon = $f->symbol()->glyph()->comment(); - $contents = $f->legacy("some contents."); + $contents = $f->legacy()->content("some contents."); $slate1 = $f->maincontrols()->slate()->legacy('legacy1', $icon, $contents); $slate2 = $f->maincontrols()->slate()->legacy('legacy2', $icon, $contents); $divider = $f->divider()->horizontal()->withLabel('Horizontal Divider with Text'); diff --git a/components/ILIAS/UI/src/examples/MainControls/Slate/Legacy/legacy.php b/components/ILIAS/UI/src/examples/MainControls/Slate/Legacy/legacy.php index 96f99555888e..f6b644c29b6f 100755 --- a/components/ILIAS/UI/src/examples/MainControls/Slate/Legacy/legacy.php +++ b/components/ILIAS/UI/src/examples/MainControls/Slate/Legacy/legacy.php @@ -17,7 +17,7 @@ function legacy() $renderer = $DIC->ui()->renderer(); $icon = $f->symbol()->glyph()->comment(); - $contents = $f->legacy("some html."); + $contents = $f->legacy()->content("some html."); $slate = $f->maincontrols()->slate()->legacy('legacy_example', $icon, $contents); diff --git a/components/ILIAS/UI/src/examples/MainControls/Slate/Notification/standard.php b/components/ILIAS/UI/src/examples/MainControls/Slate/Notification/standard.php index 0ab164c6ef85..b4a30930457b 100755 --- a/components/ILIAS/UI/src/examples/MainControls/Slate/Notification/standard.php +++ b/components/ILIAS/UI/src/examples/MainControls/Slate/Notification/standard.php @@ -34,7 +34,7 @@ function standard() $mail_notification_item = $f->item()->notification($mail_title, $mail_icon) ->withDescription("You have 23 unread mails in your inbox") ->withProperties(["Time" => "3 days ago"]) - ->withAdditionalContent($f->legacy("Additional Content")); + ->withAdditionalContent($f->legacy()->content("Additional Content")); //Creating a badge Notification Item with a specific close action here. $close_url = $_SERVER['REQUEST_URI'] . '&badge_closed=true'; diff --git a/components/ILIAS/UI/src/examples/Modal/Interruptive/show_modal_on_button_click_async_rendered.php b/components/ILIAS/UI/src/examples/Modal/Interruptive/show_modal_on_button_click_async_rendered.php index e3e4fee0b258..9c4617c7f3c6 100755 --- a/components/ILIAS/UI/src/examples/Modal/Interruptive/show_modal_on_button_click_async_rendered.php +++ b/components/ILIAS/UI/src/examples/Modal/Interruptive/show_modal_on_button_click_async_rendered.php @@ -64,7 +64,7 @@ function show_modal_on_button_click_async_rendered() ) { $out[] = $post_wrapper->retrieve('interruptive_items', $refinery->custom()->transformation( function ($v) use ($factory, $post_wrapper, $items) { - return $factory->panel()->standard('Affected Item', $factory->legacy($items[$v[0]])); + return $factory->panel()->standard('Affected Item', $factory->legacy()->content($items[$v[0]])); } )); } diff --git a/components/ILIAS/UI/src/examples/Modal/RoundTrip/show_multi_step_modal.php b/components/ILIAS/UI/src/examples/Modal/RoundTrip/show_multi_step_modal.php index d42c667c7e88..1b3af45ab06f 100755 --- a/components/ILIAS/UI/src/examples/Modal/RoundTrip/show_multi_step_modal.php +++ b/components/ILIAS/UI/src/examples/Modal/RoundTrip/show_multi_step_modal.php @@ -32,7 +32,7 @@ function show_multi_step_modal() $page = $request_wrapper->retrieve('page', $refinery->kindlyTo()->string()); } if ($page == "") { - $modal = $f->modal()->roundtrip("Modal Title", $f->legacy("b")); + $modal = $f->modal()->roundtrip("Modal Title", $f->legacy()->content("b")); $asyncUrl = $url . '&page=login&replaceSignal=' . $modal->getReplaceSignal()->getId(); $modal = $modal->withAsyncRenderUrl($asyncUrl); $button = $f->button()->standard("Sign In", '#') @@ -51,11 +51,11 @@ function show_multi_step_modal() $modal = null; if ($page == "login") { - $legacy = $f->legacy("

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 = "
{$list}
"; - $popover = $factory->popover()->standard($factory->legacy($content))->withTitle('Series'); + $popover = $factory->popover()->standard($factory->legacy()->content($content))->withTitle('Series'); $button = $factory->button()->standard('Show me some Series', '#') ->withOnClick($popover->getShowSignal()); diff --git a/components/ILIAS/UI/src/examples/Prompt/State/Show/base.php b/components/ILIAS/UI/src/examples/Prompt/State/Show/base.php index 01c3880142b6..f5585299f709 100644 --- a/components/ILIAS/UI/src/examples/Prompt/State/Show/base.php +++ b/components/ILIAS/UI/src/examples/Prompt/State/Show/base.php @@ -51,7 +51,7 @@ function base() //show the response contents: - $txt_response = $factory->legacy( + $txt_response = $factory->legacy()->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("
" . array_shift($mount_instructions) . "
"); + $content = $f->legacy()->content("
" . array_shift($mount_instructions) . "
"); return $render_async ? $r->renderAsync($content) : $r->render($content); } @@ -89,7 +89,7 @@ public function buildGUIFromGivenMountInstructions(array $mount_instructions, bo $hidden = 'style="display: none;"'; } - $legacy = $f->legacy("
$text
") + $legacy = $f->legacy()->content("
$text
") ->withCustomSignal($title, "il.UI.showMountInstructions(event, '$title');"); $view_control_actions[$title] = $legacy->getCustomSignal($title); @@ -101,9 +101,9 @@ public function buildGUIFromGivenMountInstructions(array $mount_instructions, bo // Add view control and legacy add the beginning of the array (so they will be rendered first) $header_components = [ - $f->legacy("
"), + $f->legacy()->content("
"), $view_control, - $f->legacy("
"), + $f->legacy()->content("
"), $js_function_legacy]; $components = array_merge($header_components, $components); diff --git a/components/ILIAS/WebServices/ECS/test/ilECSUserTest.php b/components/ILIAS/WebServices/ECS/test/ilECSUserTest.php index 37dc985ac3ea..79eba4253a5c 100755 --- a/components/ILIAS/WebServices/ECS/test/ilECSUserTest.php +++ b/components/ILIAS/WebServices/ECS/test/ilECSUserTest.php @@ -18,7 +18,7 @@ declare(strict_types=1); use ILIAS\DI\Container; -use ILIAS\UI\Component\Legacy\Legacy; +use ILIAS\UI\Component\Legacy\Content; use ILIAS\UI\Factory; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; diff --git a/components/ILIAS/WorkspaceFolder/classes/class.ilWorkspaceContentGUI.php b/components/ILIAS/WorkspaceFolder/classes/class.ilWorkspaceContentGUI.php index e958f35fa30f..4fd8125e63e6 100755 --- a/components/ILIAS/WorkspaceFolder/classes/class.ilWorkspaceContentGUI.php +++ b/components/ILIAS/WorkspaceFolder/classes/class.ilWorkspaceContentGUI.php @@ -100,7 +100,7 @@ public function render(): string return ""; } - $leg = $this->ui->factory()->legacy($html); + $leg = $this->ui->factory()->legacy()->content($html); $panel = $this->ui->factory()->panel()->standard($this->lng->txt("content"), [$leg]);