ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilContainerBlockPropertiesStorageGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
23
32{
33 protected ilCtrl $ctrl;
34 protected ilObjUser $user;
37
38 public function __construct()
39 {
41 global $DIC;
42
43 $this->ctrl = $DIC->ctrl();
44 $this->user = $DIC->user();
45
46 $this->request =
47 $DIC->container()->internal()->gui()->standardRequest();
48 $this->block_repo =
49 $DIC->container()->internal()->repo()->content()->block();
50 }
51
52 public function executeCommand(): void
53 {
54 $ilCtrl = $this->ctrl;
55
56 $cmd = $ilCtrl->getCmd();
57 if (in_array($cmd, ["store"], true)) {
58 $this->$cmd();
59 }
60 }
61
62 public function store(): void
63 {
64 $ilUser = $this->user;
65
66 switch ($this->request->getBlockAction()) {
67 case "expand":
68 $this->block_repo->setProperty(
69 $this->request->getBlockId(),
70 $ilUser->getId(),
71 "opened",
72 "1"
73 );
74 break;
75
76 case "collapse":
77 $this->block_repo->setProperty(
78 $this->request->getBlockId(),
79 $ilUser->getId(),
80 "opened",
81 "0"
82 );
83 break;
84 }
85 }
86}
Save container block property Mainly used for item group expand/collapse.
Class ilCtrl provides processing control methods.
getCmd(?string $fallback_command=null)
@inheritDoc
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26