Skip to content

Commit

Permalink
UI/Legacy: rename LegacyContent to Content
Browse files Browse the repository at this point in the history
  • Loading branch information
nhaagen committed Nov 20, 2024
1 parent b067e6c commit 055f611
Show file tree
Hide file tree
Showing 250 changed files with 522 additions and 522 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function getValuePresentation(
ilAccessibilityCriterionConfig $config,
Factory $uiFactory
): Component {
return $uifactory->legacy()->legacyContent('-');
return $uifactory->legacy()->content('-');
}

public function getSelection(ilAccessibilityCriterionConfig $config): ilSelectInputGUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public function getValuePresentation(ilAccessibilityCriterionConfig $config, Fac
$lng = $config['lng'] ?? '';

if (!is_string($lng) || 2 !== strlen($lng)) {
return $uifactory->legacy()->legacyContent('');
return $uifactory->legacy()->content('');
}

return $uifactory->legacy()->legacyContent($this->lng->txt('meta_l_' . $lng));
return $uifactory->legacy()->content($this->lng->txt('meta_l_' . $lng));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ protected function formatCriterionAssignments(string $column, array $row): strin
$typeGui->getIdentPresentation(),
($this->isEditable ? $this->uiRenderer->render($dropDown) : '')
])] =
$this->uiFactory->legacy()->legacyContent(
$this->uiFactory->legacy()->content(
$this->uiRenderer->render(
$typeGui->getValuePresentation(
$criterion->getCriterionValue(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function getStaticSubItems(): array
->withParent($top)
->withPosition($position * 10)
->withAlwaysAvailable(true)
->withNonAvailableReason($this->dic->ui()->factory()->legacy()->legacyContent("{$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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,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()->legacyContent($content);
return $this->dic->ui()->factory()->legacy()->content($content);
};
$tools[] = $this->factory->tool($iff("tree"))
->withTitle("Tree")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ public function testSoapAuthConnectionObject(): void
$test_form = $test_form->withRequest($this->request);
$result = $test_form->getData();
if (!is_null($result)) {
$panel_content[] = $this->ui->legacy()->legacyContent(
$panel_content[] = $this->ui->legacy()->content(
ilSOAPAuth::testConnection($result["ext_uid"], $result["soap_pw"], $result["new_user"])
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()->legacyContent($result["html"]);
$content = $this->dic->ui()->factory()->legacy()->content($result["html"]);
if ($online === 0) {
$is_widget_visible = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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\LegacyContent;
use ILIAS\UI\Component\Legacy\Content;

/**
* Class ilBTPopOverGUI
Expand Down Expand Up @@ -140,14 +140,14 @@ public function getItemForObserver(Bucket $observer): ILIAS\UI\Component\Item\No
}


private function getDefaultCardContent(Bucket $observer): LegacyContent
private function getDefaultCardContent(Bucket $observer): Content
{
return $this->getProgressbar($observer);
}


/**
* @return \ILIAS\UI\Component\Legacy\LegacyContent[]|\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
{
Expand All @@ -157,7 +157,7 @@ public function getUserInteractionContent(Bucket $observer, string $redirect_uri
$ctrl = $this->dic->ctrl();

if (!$observer->getCurrentTask() instanceof UserInteraction) {
return [$factory->legacy()->legacyContent('')];
return [$factory->legacy()->content('')];
}
/** @var UserInteraction $userInteraction */
$userInteraction = $observer->getCurrentTask();
Expand Down Expand Up @@ -193,7 +193,7 @@ function (UserInteraction\Option $option) use ($ctrl, $factory, $observer, $pers
}


private function getProgressbar(Bucket $observer): LegacyContent
private function getProgressbar(Bucket $observer): Content
{
$percentage = $observer->getOverallPercentage();

Expand All @@ -212,7 +212,7 @@ private function getProgressbar(Bucket $observer): LegacyContent
break;
}

return $this->dic->ui()->factory()->legacy()->legacyContent(" <div class='progress'>
return $this->dic->ui()->factory()->legacy()->content(" <div class='progress'>
<div class='progress-bar progress-bar-striped {$running}' role='progressbar' aria-valuenow='{$percentage}'
aria-valuemin='0' aria-valuemax='100' style='width:{$percentage}%'>
{$content}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getStaticSubItems(): array
->withPosition(40)
->withParent(StandardTopItemsProvider::getInstance()->getAchievementsIdentification())
->withSymbol($icon)
->withNonAvailableReason($this->dic->ui()->factory()->legacy()->legacyContent($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();
Expand Down
4 changes: 2 additions & 2 deletions components/ILIAS/Badge/classes/BadgeParent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()->legacyContent($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()->legacyContent(
$this->container->language()->txt('object') => $this->container->ui()->factory()->legacy()->content(
$this->container->ui()->renderer()->render([$parent_icon, $parent_link])
)
]);
Expand Down
10 changes: 5 additions & 5 deletions components/ILIAS/Badge/tests/BadgeParentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ 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\LegacyContent::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();
Expand All @@ -72,7 +72,7 @@ public function testShowWithParentReadRight(): void

$factory->method('listing')->willReturn($listing);
$factory->method('link')->willReturn($link);
$legacy_factory->expects(self::once())->method('legacyContent')->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);
Expand Down Expand Up @@ -120,10 +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\LegacyContent::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(LegacyContent::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();

Expand All @@ -134,7 +134,7 @@ public function testShowWithoutParentReadRight(): void
])->willReturn($descriptive);

$factory->method('listing')->willReturn($listing);
$legacy_factory->method('legacyContent')->willReturn($legacy);
$legacy_factory->method('content')->willReturn($legacy);
$factory->method('legacy')->willReturn($legacy_factory);

$renderer->expects(self::once())->method('render')->willReturn($rendered);
Expand Down
8 changes: 4 additions & 4 deletions components/ILIAS/Block/classes/class.ilBlockGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()->legacyContent($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()->legacyContent($this->getLegacyContent())
$this->factory->legacy()->content($this->getLegacyContent())
);
break;

Expand Down Expand Up @@ -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()->legacyContent($this->getNoItemFoundContent())
$this->factory->legacy()->content($this->getNoItemFoundContent())
);
} else {
$panel = $this->factory->panel()->standard(
$this->specialCharsAsEntities($this->getTitle()),
$this->factory->legacy()->legacyContent($this->getNoItemFoundContent())
$this->factory->legacy()->content($this->getNoItemFoundContent())
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/ILIAS/Blog/classes/class.ilObjBlogGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,7 @@ public function renderNavigation(

$content = $block[1];

$secondary_panel = $ui_factory->panel()->secondary()->legacy($title, $ui_factory->legacy()->legacyContent($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]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function render(): string

$p = $this->ui->factory()->panel()->secondary()->legacy(
$this->lng->txt("book_object_selection"),
$this->ui->factory()->legacy()->legacyContent($tpl->get())
$this->ui->factory()->legacy()->content($tpl->get())
);
return $this->ui->renderer()->render($p);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function render(): string
$ui = $DIC->ui();
$tpl = new \ilTemplate("tpl.slot.html", true, true, "components/ILIAS/BookingManager/BookingProcess");

$modal = $ui->factory()->modal()->roundtrip("", $ui->factory()->legacy()->legacyContent(""));
$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, "#")
Expand Down
2 changes: 1 addition & 1 deletion components/ILIAS/COPage/Editor/UI/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()->legacyContent(""))
$this->ui->factory()->modal()->roundtrip("", $this->ui->factory()->legacy()->content(""))
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()->legacyContent($content);
return $this->dic->ui()->factory()->legacy()->content($content);
};
$identification = $iff("copg_editor");
$hashed = $this->hash($identification->serialize());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ public static function getModalTemplate(): array
$lng = $DIC->language();

$ui = $DIC->ui();
$modal = $ui->factory()->modal()->roundtrip($lng->txt("link_link"), $ui->factory()->legacy()->legacyContent("<div id='ilIntLinkModalContent'></div>"));
$modal = $ui->factory()->modal()->roundtrip($lng->txt("link_link"), $ui->factory()->legacy()->content("<div id='ilIntLinkModalContent'></div>"));
$modalt["show"] = $modal->getShowSignal()->getId();
$modalt["close"] = $modal->getCloseSignal()->getId();
$modalt["template"] = $ui->renderer()->renderAsync($modal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()->legacyContent(""))
$this->ui->factory()->modal()->roundtrip("", $this->ui->factory()->legacy()->content(""))
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ protected function getBackgroundProperties(): string
public function getModalTemplate(): array
{
$ui = $this->ui;
$modal = $ui->factory()->modal()->roundtrip('#title#', $ui->factory()->legacy()->legacyContent('#content#'))
$modal = $ui->factory()->modal()->roundtrip('#title#', $ui->factory()->legacy()->content('#content#'))
->withActionButtons([
$ui->factory()->button()->standard('#button_title#', '#'),
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ public function modifyPageContentPostXsl(
$new_inner = $inner;
} else {
$pop = $this->ui->factory()->popover()->standard(
$this->ui->factory()->legacy()->legacyContent("#####popovercontent#####")
$this->ui->factory()->legacy()->content("#####popovercontent#####")
);
$signal_id = $pop->getShowSignal()->getId();
//$new_inner = $this->ui->renderer()->render($pop);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()->legacyContent("<iframe class='il-copg-mob-fullscreen' id='il-copg-mob-fullscreen" . $suffix . "'></iframe>")
$this->ui->factory()->legacy()->content("<iframe class='il-copg-mob-fullscreen' id='il-copg-mob-fullscreen" . $suffix . "'></iframe>")
);
$show_signal = $modal->getShowSignal();

Expand Down
2 changes: 1 addition & 1 deletion components/ILIAS/COPage/PC/Tabs/class.ilPCTabsGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ protected function getTabPanels(): string
$content = $this->getTabContent($cap["pc_id"]);
$items[] = $ui->factory()->panel()->standard(
$cap["caption"],
$ui->factory()->legacy()->legacyContent($content)
$ui->factory()->legacy()->content($content)
)
->withActions($dd);
$cnt++;
Expand Down
2 changes: 1 addition & 1 deletion components/ILIAS/COPage/classes/class.ilPageObjectGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -2241,7 +2241,7 @@ public function insertPageToc(string $a_output): string
$h["text"] = str_replace($page_toc_ph, "", $h["text"]);

$listing->node(
$this->ui->factory()->legacy()->legacyContent("<a href='#" . $h["anchor"] . "' class='ilc_page_toc_PageTOCLink'>" . $h["text"] . "</a>"),
$this->ui->factory()->legacy()->content("<a href='#" . $h["anchor"] . "' class='ilc_page_toc_PageTOCLink'>" . $h["text"] . "</a>"),
(string) $i,
(string) ($par)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function getStaticSubItems(): array
->withParent(StandardTopItemsProvider::getInstance()->getPersonalWorkspaceIdentification())
->withPosition(30)
->withSymbol($icon)
->withNonAvailableReason($this->dic->ui()->factory()->legacy()->legacyContent("{$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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()->legacyContent("");
$f = $this->ui->factory()->legacy()->content("");
$ret .= $this->ui->renderer()->renderAsync($f);
}
if (count($this->modals) > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected function getModalForSubscription(): void

$roundtrip = $this->ui_factory->modal()->roundtrip(
$this->lng->txt('cal_calendar_subscription_modal_title'),
$this->ui_factory->legacy()->legacyContent($tpl->get())
$this->ui_factory->legacy()->content($tpl->get())
);
echo $this->ui_renderer->render($roundtrip);
exit;
Expand Down
Loading

0 comments on commit 055f611

Please sign in to comment.