ILIAS  release_4-4 Revision
ilMemberViewSettings Class Reference

Settings for members view More...

+ Collaboration diagram for ilMemberViewSettings:

Public Member Functions

 getContainer ()
 Returns $container. More...
 
 setContainer ($container)
 Sets $container. More...
 
 isActive ()
 Check if member view currently enabled. More...
 
 isActiveForRefId ($a_ref_id)
 Check if member view is currently enabled for given ref id. More...
 
 activate ($a_ref_id)
 Enable member view for this session and container. More...
 
 deactivate ()
 Deactivate member view. More...
 
 toggleActivation ($a_ref_id, $a_activation)
 Toggle activation status. More...
 
 isEnabled ()
 Check if members view is enabled in the administration. More...
 

Static Public Member Functions

static getInstance ()
 Get instance. More...
 

Protected Member Functions

 read ()
 Read settings. More...
 

Private Member Functions

 __construct ()
 Constructor (singleton) More...
 

Private Attributes

 $active = false
 
 $enabled = false
 
 $container = null
 
 $container_items = array()
 

Static Private Attributes

static $instance = null
 

Detailed Description

Settings for members view

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 29 of file class.ilMemberViewSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilMemberViewSettings::__construct ( )
private

Constructor (singleton)

Returns

Definition at line 42 of file class.ilMemberViewSettings.php.

References read().

43  {
44  $this->read();
45  }
+ Here is the call graph for this function:

Member Function Documentation

◆ activate()

ilMemberViewSettings::activate (   $a_ref_id)

Enable member view for this session and container.

Returns
Parameters
int$a_ref_idReference Id of course or group
Exceptions
IllegalArgumentExceptionThrown if reference id is not a course or group

Definition at line 145 of file class.ilMemberViewSettings.php.

References setContainer().

Referenced by toggleActivation().

146  {
147  $this->active = true;
148  $this->setContainer($a_ref_id);
149  }
setContainer($container)
Sets $container.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deactivate()

ilMemberViewSettings::deactivate ( )

Deactivate member view.

Returns

Definition at line 155 of file class.ilMemberViewSettings.php.

References $_SESSION.

Referenced by toggleActivation().

156  {
157  $this->active = false;
158  $this->container = null;
159  unset($_SESSION['member_view_container']);
160  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ getContainer()

ilMemberViewSettings::getContainer ( )

Returns $container.

See also
ilMemberView::$container

Definition at line 64 of file class.ilMemberViewSettings.php.

References $container.

Referenced by isActive(), isActiveForRefId(), and read().

+ Here is the caller graph for this function:

◆ getInstance()

static ilMemberViewSettings::getInstance ( )
static

◆ isActive()

ilMemberViewSettings::isActive ( )

Check if member view currently enabled.

Returns
bool

Definition at line 85 of file class.ilMemberViewSettings.php.

References $_GET, $ref_id, $target_arr, and getContainer().

86  {
87  global $tree;
88 
89  if(!$this->active)
90  {
91  // Not active
92  return false;
93  }
94 
95  $ref_id = $_GET['ref_id'] ? $_GET['ref_id'] : null;
96  if(!$ref_id)
97  {
98  $target_arr = explode('_',(string) $_GET['target']);
99  $ref_id = $target_arr[1] ? $target_arr[1] : null;
100  }
101 
102  if(!$ref_id)
103  {
104  // No ref id given => mail, search, personal desktop menu in other tab
105  return false;
106  }
107 
108  if(!in_array($ref_id,$this->container_items) and
109  $this->getContainer() != $ref_id)
110  {
111  // outside of course
112  return false;
113  }
114  return true;
115  }
getContainer()
Returns $container.
$target_arr
Definition: goto.php:86
$_GET["client_id"]
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ isActiveForRefId()

ilMemberViewSettings::isActiveForRefId (   $a_ref_id)

Check if member view is currently enabled for given ref id.

Parameters
int$a_ref_id
Returns
bool

Definition at line 122 of file class.ilMemberViewSettings.php.

References getContainer().

123  {
124  if(!$this->active || !(int)$a_ref_id)
125  {
126  // Not active
127  return false;
128  }
129 
130  if(!in_array($a_ref_id,$this->container_items) and
131  $this->getContainer() != $a_ref_id)
132  {
133  // outside of course
134  return false;
135  }
136  return true;
137  }
getContainer()
Returns $container.
+ Here is the call graph for this function:

◆ isEnabled()

ilMemberViewSettings::isEnabled ( )

Check if members view is enabled in the administration.

Returns
bool active

Definition at line 184 of file class.ilMemberViewSettings.php.

References $enabled.

185  {
186  return (bool) $this->enabled;
187  }

◆ read()

ilMemberViewSettings::read ( )
protected

Read settings.

Returns
void

Definition at line 193 of file class.ilMemberViewSettings.php.

References $_SESSION, $ilSetting, and getContainer().

Referenced by __construct().

194  {
195  global $ilSetting,$tree;
196 
197  // member view is always enabled
198  // (2013-06-18, http://www.ilias.de/docu/goto_docu_wiki_1357_Reorganising_Administration.html)
199 
200  // $this->enabled = $ilSetting->get('preview_learner');
201  $this->enabled = true;
202 
203  if(isset($_SESSION['member_view_container']))
204  {
205  $this->active = true;
206  $this->container = (int) $_SESSION['member_view_container'];
207  $this->container_items = $tree->getSubTreeIds($this->getContainer());
208  }
209  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
getContainer()
Returns $container.
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setContainer()

ilMemberViewSettings::setContainer (   $container)

Sets $container.

Parameters
object$container
See also
ilMemberView::$container

Definition at line 74 of file class.ilMemberViewSettings.php.

References $_SESSION, and $container.

Referenced by activate().

75  {
76  $this->container = $container;
77  $_SESSION['member_view_container'] = $this->container;
78  $_SESSION['il_cont_admin_panel'] = false;
79  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ toggleActivation()

ilMemberViewSettings::toggleActivation (   $a_ref_id,
  $a_activation 
)

Toggle activation status.

Returns
Parameters
int$a_ref_id
bool$a_activation

Definition at line 168 of file class.ilMemberViewSettings.php.

References activate(), and deactivate().

169  {
170  if($a_activation)
171  {
172  return $this->activate($a_ref_id);
173  }
174  else
175  {
176  return $this->deactivate($a_ref_id);
177  }
178  }
activate($a_ref_id)
Enable member view for this session and container.
deactivate()
Deactivate member view.
+ Here is the call graph for this function:

Field Documentation

◆ $active

ilMemberViewSettings::$active = false
private

Definition at line 33 of file class.ilMemberViewSettings.php.

◆ $container

ilMemberViewSettings::$container = null
private

Definition at line 35 of file class.ilMemberViewSettings.php.

Referenced by getContainer(), and setContainer().

◆ $container_items

ilMemberViewSettings::$container_items = array()
private

Definition at line 36 of file class.ilMemberViewSettings.php.

◆ $enabled

ilMemberViewSettings::$enabled = false
private

Definition at line 34 of file class.ilMemberViewSettings.php.

Referenced by isEnabled().

◆ $instance

ilMemberViewSettings::$instance = null
staticprivate

Definition at line 31 of file class.ilMemberViewSettings.php.


The documentation for this class was generated from the following file: