Skip to content

Commit

Permalink
Forum: Fix language for CoPage
Browse files Browse the repository at this point in the history
See: https://mantis.ilias.de/view.php?id=38448
(cherry picked from commit a7dddaf)
  • Loading branch information
mjansenDatabay committed Nov 14, 2023
1 parent 115264b commit 3cdf73b
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ilForumPageCommandForwarder implements ilForumObjectConstants
* presentation mode for embedded presentation, e.g. in a kiosk mode
*/
public const PRESENTATION_MODE_EMBEDDED_PRESENTATION = 'PRESENTATION_MODE_EMBEDDED_PRESENTATION';
public const DEFAULT_LANGUAGE = '-';

protected string $presentationMode = self::PRESENTATION_MODE_EDITING;
protected ilCtrlInterface $ctrl;
Expand Down Expand Up @@ -195,14 +196,11 @@ public function forward(string $ctrlLink = ''): string
switch ($this->presentationMode) {
case self::PRESENTATION_MODE_EDITING:

$pageObjectGui = $this->buildEditingPageObjectGUI('');
$pageObjectGui = $this->buildEditingPageObjectGUI(self::DEFAULT_LANGUAGE);
return (string) $this->ctrl->forwardCommand($pageObjectGui);

case self::PRESENTATION_MODE_PRESENTATION:
$ot = ilObjectTranslation::getInstance($this->parentObject->getId());
$language = $ot->getEffectiveContentLang($this->actor->getCurrentLanguage(), $this->parentObject->getType());

$pageObjectGUI = $this->buildPresentationPageObjectGUI($language);
$pageObjectGUI = $this->buildPresentationPageObjectGUI(self::DEFAULT_LANGUAGE);

if (is_string($ctrlLink) && $ctrlLink !== '') {
$pageObjectGUI->setFileDownloadLink($ctrlLink . '&cmd=' . self::UI_CMD_COPAGE_DOWNLOAD_FILE);
Expand All @@ -213,10 +211,7 @@ public function forward(string $ctrlLink = ''): string
return $this->ctrl->getHTML($pageObjectGUI);

case self::PRESENTATION_MODE_EMBEDDED_PRESENTATION:
$ot = ilObjectTranslation::getInstance($this->parentObject->getId());
$language = $ot->getEffectiveContentLang($this->actor->getCurrentLanguage(), $this->parentObject->getType());

$pageObjectGUI = $this->buildEmbeddedPresentationPageObjectGUI($language);
$pageObjectGUI = $this->buildEmbeddedPresentationPageObjectGUI(self::DEFAULT_LANGUAGE);

if (is_string($ctrlLink) && $ctrlLink !== '') {
$pageObjectGUI->setFileDownloadLink($ctrlLink . '&cmd=' . self::UI_CMD_COPAGE_DOWNLOAD_FILE);
Expand Down

0 comments on commit 3cdf73b

Please sign in to comment.