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) {
112 return self::$instance;
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)) {
283 $this->current_ref_id = (int) $target_arr[1];
activate(int $a_ref_id)
Enable member view for this session and container.
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
isActiveForRefId(int $a_ref_id)
Check if member view is currently enabled for given ref id.
toggleActivation(int $a_ref_id, bool $a_activation)
Toggle activation status.
static clear($a_var)
Unset a value.
isActive()
Check if member view currently enabled.
isEnabled()
Check if members view is enabled in the administration.
findEffectiveRefId()
Find effective ref_id for request.
__construct()
Constructor (singleton)
setContainer(int $container)
deactivate()
Deactivate member view.
const SESSION_MEMBER_VIEW_CONTAINER