ILIAS  release_8 Revision v8.24
class.ilContainerBlockPropertiesStorageGUI.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
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 {
65
66 switch ($this->request->getBlockAction()) {
67
68 case "expand":
69 $this->block_repo->setProperty(
70 $this->request->getBlockId(),
71 $ilUser->getId(),
72 "opened",
73 "1"
74 );
75 break;
76
77 case "collapse":
78 $this->block_repo->setProperty(
79 $this->request->getBlockId(),
80 $ilUser->getId(),
81 "opened",
82 "0"
83 );
84 break;
85 }
86 }
87}
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.
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
Interface ilCtrlBaseClassInterface describes ilCtrl base classes.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc