24use Psr\Http\Message\RequestInterface;
97 $this->tree =
$DIC->repositoryTree();
99 $this->request =
$DIC->http()->request();
100 $this->ctrl =
$DIC->ctrl();
101 $this->logger =
$DIC->logger()->cont();
111 if (self::$instance !=
null) {
139 ilSession::set(self::SESSION_MEMBER_VIEW_CONTAINER, $this->container);
150 if (!isset($mv_status)) {
151 if (!$this->active) {
153 return $mv_status =
false;
158 return $mv_status =
false;
165 return $mv_status =
false;
167 return $mv_status =
true;
180 if (!$this->active || !(
int) $a_ref_id) {
185 !in_array($a_ref_id, $this->container_items) &&
198 $this->active =
true;
208 $this->active =
false;
209 $this->container =
null;
239 protected function read() : void
247 $this->enabled =
true;
250 $this->active =
true;
251 $this->container = (int)
ilSession::get(self::SESSION_MEMBER_VIEW_CONTAINER);
252 $this->container_items = $this->tree->getSubTreeIds($this->
getContainer());
270 if ($this->ctrl->isAsynch()) {
275 $ref_id = (int) $this->request->getQueryParams()[
'ref_id'] ?? 0;
277 return $this->current_ref_id = $ref_id;
279 $target_str = (string) $this->request->getQueryParams()[
'target'] ??
'';
280 if (strlen($target_str)) {
An exception for terminatinating execution or to throw for unit testing.
@classDescription Settings for members view
isActive()
Check if member view currently enabled.
findEffectiveRefId()
Find effective ref_id for request.
const SESSION_MEMBER_VIEW_CONTAINER
isEnabled()
Check if members view is enabled in the administration.
isActiveForRefId(int $a_ref_id)
Check if member view is currently enabled for given ref id.
__construct()
Constructor (singleton)
activate(int $a_ref_id)
Enable member view for this session and container.
setContainer(int $container)
toggleActivation(int $a_ref_id, bool $a_activation)
Toggle activation status.
deactivate()
Deactivate member view.
static set($a_var, $a_val)
Set a value.
static clear($a_var)
Unset a value.
static get($a_var)
Get a value.