Skip to content

Commit

Permalink
refactor dashboard modals for multi manage (#8522)
Browse files Browse the repository at this point in the history
  • Loading branch information
iszmais authored Dec 3, 2024
1 parent 8c0e784 commit bc5adc1
Show file tree
Hide file tree
Showing 10 changed files with 161 additions and 349 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
use ILIAS\UI\Component\Symbol\Icon\Standard;
use ILIAS\Services\Dashboard\Block\BlockDTO;

/**
* @ilCtrl_IsCalledBy ilDashboardLearningSequenceGUI: ilColumnGUI
* @ilCtrl_Calls ilDashboardLearningSequenceGUI: ilCommonActionDispatcherGUI
*/
class ilDashboardLearningSequenceGUI extends ilDashboardBlockGUI
{
protected function getIcon(string $title): Standard
Expand Down Expand Up @@ -111,23 +107,18 @@ public function getBlockType(): string
return 'pdlern';
}

public function confirmedRemoveObject(): void
public function confirmedRemove(array $ids): void
{
$refIds = (array) ($this->http->request()->getParsedBody()['ref_id'] ?? []);
if ($refIds === []) {
$this->ctrl->redirect($this, 'manage');
}

foreach ($refIds as $ref_id) {
if ($this->access->checkAccess('leave', '', (int) $ref_id)) {
if (ilObject::_lookupType((int) $ref_id, true) === 'lso') {
$lso = ilObjLearningSequence::getInstanceByRefId((int) $ref_id);
foreach ($ids as $ref_id) {
if ($this->access->checkAccess('leave', '', $ref_id)) {
if (ilObject::_lookupType($ref_id, true) === 'lso') {
$lso = ilObjLearningSequence::getInstanceByRefId($ref_id);
if ($lso instanceof ilObjLearningSequence) {
$lso->getLSRoles()->leave($this->user->getId());
}
}

ilForumNotification::checkForumsExistsDelete((int) $ref_id, $this->user->getId());
ilForumNotification::checkForumsExistsDelete($ref_id, $this->user->getId());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function initData(): void
) {
$properties[$this->lng->txt('prg_dash_label_valid')] = $row->getExpiryDate() ?: $row->getValidity();

if($cert_link = $this->maybeGetCertificateLink($this->user->getId(), $prg->getId(), $prg->getRefId())) {
if ($cert_link = $this->maybeGetCertificateLink($this->user->getId(), $prg->getId(), $prg->getRefId())) {
$properties[$this->lng->txt('certificate')] = $cert_link;
}
} else {
Expand Down Expand Up @@ -112,10 +112,6 @@ public function getBlockType(): string
return 'pdprg';
}

public function confirmedRemoveObject(): void
{
}

public function removeMultipleEnabled(): bool
{
return false;
Expand Down
Loading

0 comments on commit bc5adc1

Please sign in to comment.