Skip to content

Commit

Permalink
Merge branch 'ILIAS-eLearning:release_8' into _8/soap/fixplugins
Browse files Browse the repository at this point in the history
  • Loading branch information
jeph864 authored Nov 24, 2023
2 parents ae4c78e + 4ee10f1 commit 5689c26
Show file tree
Hide file tree
Showing 1,293 changed files with 45,934 additions and 84,053 deletions.
5 changes: 2 additions & 3 deletions Modules/Blog/Posting/class.ilBlogPostingGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ilBlogPostingGUI extends ilPageObjectGUI
protected bool $enable_public_notes = false;
protected bool $may_contribute = false;
protected bool $fetchall = false;
protected bool $blpg = false;
protected int $blpg = 0;
protected string $term = "";
public bool $add_date = false;

Expand Down Expand Up @@ -212,7 +212,6 @@ public function preview(
$callback
));
}

// permanent link
if ($a_mode !== "embedded") {
$append = ($this->blpg > 0)
Expand Down Expand Up @@ -255,6 +254,7 @@ public function showPage(
): string {
$this->setTemplateOutput(false);

$this->setPresentationTitle("");
if (!$this->getAbstractOnly() && !$this->showPageHeading()) {
if ($a_title !== "") {
$this->setPresentationTitle($a_title);
Expand All @@ -263,7 +263,6 @@ public function showPage(
}
}
$this->getBlogPosting()->increaseViewCnt();

return parent::showPage();
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/Blog/classes/class.ilObjBlog.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ public static function deliverRSS(string $a_wsp_id): void

$feed = new ilFeedWriter();

$url = ilLink::_getStaticLink($a_wsp_id, "blog", true, $is_wsp);
$url = ilLink::_getStaticLink($a_wsp_id, "blog", true, (string) $is_wsp);
$url = str_replace("&", "&", $url);

// #11870
Expand Down
38 changes: 32 additions & 6 deletions Modules/Blog/classes/class.ilObjBlogGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/
class ilObjBlogGUI extends ilObject2GUI implements ilDesktopItemHandling
{
protected string $rendered_content = "";
protected \ILIAS\Notes\Service $notes;
protected \ILIAS\Blog\ReadingTime\BlogSettingsGUI $reading_time_gui;
protected \ILIAS\Blog\ReadingTime\ReadingTimeManager $reading_time_manager;
Expand Down Expand Up @@ -489,6 +490,7 @@ protected function setTabs(): void
$ilHelp->setScreenIdComponent("blog");

if ($this->checkPermissionBool("read")) {
$this->ctrl->setParameterByClass(self::class, "bmn", null);
$this->tabs_gui->addTab(
"content",
$lng->txt("content"),
Expand Down Expand Up @@ -586,6 +588,7 @@ public function executeCommand(): void

switch ($next_class) {
case 'ilblogpostinggui':
$this->ctrl->saveParameter($this, "user_page");
if (!$this->prtf_embed) {
$tpl->loadStandardTemplate();
}
Expand Down Expand Up @@ -691,7 +694,8 @@ public function executeCommand(): void
$this->addHeaderActionForCommand($cmd);
$this->filterInactivePostings();
$nav = $this->renderNavigation("gethtml", $cmd);
$this->buildEmbedded($ret, $nav);
// this is important for embedded blog pages!
$this->rendered_content = $this->buildEmbedded($ret, $nav);
return;

// ilias/editor
Expand All @@ -718,7 +722,9 @@ public function executeCommand(): void
if ($public_action) {
$this->tpl->setOnScreenMessage('success', implode("<br />", $info));
} else {
$this->tpl->setOnScreenMessage('info', implode("<br />", $info));
if (count($info) > 0) {
$this->tpl->setOnScreenMessage('info', implode("<br />", $info));
}
}

// revert to edit cmd to avoid confusion
Expand Down Expand Up @@ -851,10 +857,15 @@ public function executeCommand(): void
if (!$cmd) {
$cmd = "render";
}
$this->$cmd();
$this->rendered_content = (string) $this->$cmd();
}
}

public function getRenderedContent(): string
{
return $this->rendered_content;
}

protected function triggerAssignmentTool(): void
{
$be = new ilBlogExercise($this->node_id);
Expand Down Expand Up @@ -1024,7 +1035,7 @@ public function render(): void
$list = $nav = "";
if ($list_items) {
$list = $this->renderList($list_items, "preview", "", $is_owner);
$nav = $this->renderNavigation("render", "preview", "", $is_owner);
$nav = $this->renderNavigation("render", "edit", "", $is_owner);
}

$this->setContentStyleSheet();
Expand Down Expand Up @@ -1793,6 +1804,16 @@ protected function renderNavigationByDate(
}
$wtpl->parseCurrentBlock();
}
$this->ctrl->setParameterByClass(self::class, "bmn", null);
$wtpl->setVariable(
"STARTING_PAGE",
$this->ui->renderer()->render(
$this->ui->factory()->link()->standard(
$this->lng->txt("blog_starting_page"),
$this->ctrl->getLinkTargetByClass(self::class, $a_list_cmd)
)
)
);
}
// single month
else {
Expand Down Expand Up @@ -2057,9 +2078,9 @@ public function renderToolbarNavigation(


$ctrl->setParameterByClass("ilblogpostinggui", "blpg", $this->blpg);
if ($this->prtf_embed) {
/*if ($this->prtf_embed) {
$this->ctrl->setParameterByClass("ilobjportfoliogui", "ppage", $this->user_page);
}
}*/
$link = $ctrl->getLinkTargetByClass("ilblogpostinggui", "edit");
$toolbar->addComponent($f->button()->standard($lng->txt("blog_edit_posting"), $link));
}
Expand Down Expand Up @@ -2986,4 +3007,9 @@ public function printPostings(): void
$print_view = $this->getPrintView();
$print_view->sendPrintView();
}

protected function forwardExport() : void
{
$this->ctrl->redirectByClass(ilExportGUI::class);
}
}
7 changes: 7 additions & 0 deletions Modules/Blog/classes/class.ilObjBlogListGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ public function insertCommand(
): void {
$ctrl = $this->ctrl;

if ($cmd === "export"
&& ilObjBlogAccess::isCommentsExportPossible($this->obj_id)
&& (bool) $this->settings->get('item_cmd_asynch')) {
$href = $this->getCommandLink("forwardExport");
$cmd = "forwardExport";
$onclick = "";
}
if ($cmd !== "export" || !ilObjBlogAccess::isCommentsExportPossible($this->obj_id)) {
parent::insertCommand($href, $text, $frame, $img, $cmd, $onclick);
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<p>{STARTING_PAGE}</p>
<!-- BEGIN navigation_month_details -->
<div>
<!-- BEGIN navigation_year_details -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function getTo(): int
public function setStatus(?int $a_status): void
{
if ($a_status === null) {
$this->status = null;
$this->status = 0;
}
if (self::isValidStatus((int) $a_status)) {
$this->status = (int) $a_status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ public function rsvConfirmCancel(): void
if (count($ids) === 0) {
$this->back();
}

$max = array();
foreach ($ids as $idx => $id) {
if (!is_numeric($id)) {
Expand All @@ -322,8 +321,7 @@ public function rsvConfirmCancel(): void
foreach (ilBookingObject::getList($this->pool->getId()) as $item) {
$valid_ids[$item["booking_object_id"]] = $item["title"];
}

if (array_key_exists($obj_id, $valid_ids) && $from > time() && ($this->checkPermissionBool("write") || $user_id === $ilUser->getId())) {
if (array_key_exists($obj_id, $valid_ids) && $from > time() && ($this->checkPermissionBool("write") || (int) $user_id === $ilUser->getId())) {
$rsv_ids = ilBookingReservation::getCancelDetails($obj_id, $user_id, $from, $to);
if (!count($rsv_ids)) {
unset($ids[$idx]);
Expand Down Expand Up @@ -634,7 +632,7 @@ public function rsvDelete(): void
$this->ctrl->redirect($this, 'log');
}

protected function showRerunPreferenceAssignment() : void
protected function showRerunPreferenceAssignment(): void
{
if (!$this->checkPermissionBool('write')) {
return;
Expand Down Expand Up @@ -689,5 +687,4 @@ protected function resetRun()
}
$this->ctrl->redirect($this, "log");
}

}
4 changes: 2 additions & 2 deletions Modules/Category/classes/class.ilObjCategoryGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public function executeCommand(): void
case "ilobjectcontentstylesettingsgui":
$this->checkPermission("write");
$this->setTitleAndDescription();
//$this->showContainerPageTabs();
$this->showContainerPageTabs();
$settings_gui = $this->content_style_gui
->objectSettingsGUIForRefId(
null,
Expand Down Expand Up @@ -1064,7 +1064,7 @@ public function assignRolesObject(): void
$f_result[$counter]['checkbox'] = ilLegacyFormElementsUtil::formCheckbox(
in_array((int) $role['obj_id'], $ass_roles, true),
'role_ids[]',
$role['obj_id'],
(string) $role['obj_id'],
$disabled
);
$f_result[$counter]['title'] = $role_obj->getTitle() ?: "";
Expand Down
20 changes: 19 additions & 1 deletion Modules/Chatroom/classes/class.ilChatroomTabGUIFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class ilChatroomTabGUIFactory
private ilRbacSystem $rbacSystem;
private GlobalHttpState $http;
private Refinery $refinery;
private ?string $activated_tab = null;
private ?string $activated_sub_tab = null;

public function __construct(ilObjectGUI $gui)
{
Expand Down Expand Up @@ -132,7 +134,10 @@ public function getAdminTabsForCommand(string $command): void
];
$DIC->ctrl()->clearParametersByClass(ilPermissionGUI::class);

$is_in_permission_gui = strtolower($DIC->ctrl()->getCmdClass()) === strtolower(ilPermissionGUI::class);
$is_in_permission_gui = (
strtolower($DIC->ctrl()->getCmdClass()) === strtolower(ilPermissionGUI::class) ||
strtolower($DIC->ctrl()->getCmdClass()) === strtolower(ilObjectPermissionStatusGUI::class)
);

$commandParts = explode('_', $command, 2);
if ($command === 'ban_show') {
Expand Down Expand Up @@ -264,16 +269,29 @@ private function activateTab(array $commandParts, array $config): void
if (count($commandParts) > 1) {
if (isset($config[$commandParts[0]])) {
$DIC->tabs()->activateTab($commandParts[0]);
$this->activated_tab = $commandParts[0];

if (isset($config[$commandParts[0]]['subtabs'][$commandParts[1]])) {
$DIC->tabs()->activateSubTab($commandParts[1]);
$this->activated_sub_tab = $commandParts[1];
}
}
} elseif (count($commandParts) === 1) {
$DIC->tabs()->activateTab($commandParts[0]);
$this->activated_tab = $commandParts[0];
}
}

public function getActivatedTab(): ?string
{
return $this->activated_tab;
}

public function getActivatedSubTab(): ?string
{
return $this->activated_sub_tab;
}

/**
* Builds $config and $commandparts arrays to assign them as parameters
* when calling $this->buildTabs and $this->activateTab.
Expand Down
6 changes: 0 additions & 6 deletions Modules/Chatroom/classes/class.ilObjChatroom.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ public function update(): bool
$activation->setTimingStart($this->getAccessBegin());
$activation->setTimingEnd($this->getAccessEnd());
$activation->toggleVisible((bool) $this->getAccessVisibility());
$activation->setSuggestionStart(0);
$activation->setSuggestionStartRelative(0);
$activation->setSuggestionEnd(0);
$activation->setSuggestionEndRelative(0);
$activation->setEarliestStart(0);
$activation->setEarliestStartRelative(0);
$activation->toggleChangeable(true);
$activation->update($this->ref_id);
}
Expand Down
5 changes: 5 additions & 0 deletions Modules/Chatroom/classes/class.ilObjChatroomAdminGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ public function executeCommand(): void

$this->dispatchCall($res[0], $res[1]);
}

if ($tabFactory->getActivatedTab() !== null &&
$this->tabs_gui->getActiveTab() !== $tabFactory->getActivatedTab()) {
$this->tabs_gui->activateTab($tabFactory->getActivatedTab());
}
}

public function getConnector(): ilChatroomServerConnector
Expand Down
7 changes: 7 additions & 0 deletions Modules/Chatroom/classes/class.ilObjChatroomGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ public function executeCommand(): void

$next_class = $this->ctrl->getNextClass();

$tabFactory = null;
if (!$this->getCreationMode()) {
$tabFactory = new ilChatroomTabGUIFactory($this);

Expand Down Expand Up @@ -255,6 +256,12 @@ public function executeCommand(): void
}
break;
}

if ($tabFactory !== null &&
$tabFactory->getActivatedTab() !== null &&
$this->tabs_gui->getActiveTab() !== $tabFactory->getActivatedTab()) {
$this->tabs_gui->activateTab($tabFactory->getActivatedTab());
}
}

public function getConnector(): ilChatroomServerConnector
Expand Down
Loading

0 comments on commit 5689c26

Please sign in to comment.