ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMemberViewSettings Class Reference

Settings for members view More...

+ Collaboration diagram for ilMemberViewSettings:

Public Member Functions

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

Static Public Member Functions

static getInstance ()
 Get instance.

Protected Member Functions

 read ()
 Read settings.
 findEffectiveRefId ()
 Find effective ref_id for request.

Private Member Functions

 __construct ()
 Constructor (singleton)

Private Attributes

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

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

ilMemberViewSettings::__construct ( )
private

Constructor (singleton)

Returns

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

References read().

{
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

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 150 of file class.ilMemberViewSettings.php.

References setContainer().

Referenced by toggleActivation().

{
$this->active = true;
$this->setContainer($a_ref_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMemberViewSettings::deactivate ( )

Deactivate member view.

Returns

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

References $_SESSION.

Referenced by toggleActivation().

{
$this->active = false;
$this->container = null;
unset($_SESSION['member_view_container']);
}

+ Here is the caller graph for this function:

ilMemberViewSettings::findEffectiveRefId ( )
protected

Find effective ref_id for request.

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

References $_GET, and $target_arr.

Referenced by read().

{
if((int) $_GET['ref_id'])
{
return $this->current_ref_id = (int) $_GET['ref_id'];
}
$target_arr = explode('_',(string) $_GET['target']);
if(isset($target_arr[1]) and (int) $target_arr[1])
{
$this->current_ref_id = (int) $target_arr[1];
}
}

+ Here is the caller graph for this function:

ilMemberViewSettings::getContainer ( )

Returns $container.

See Also
ilMemberView::$container

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

References $container.

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

{
}

+ Here is the caller graph for this function:

ilMemberViewSettings::getCurrentRefId ( )

Get current ref_id of request.

Returns
type

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

References $current_ref_id.

Referenced by isActive().

{
}

+ Here is the caller graph for this function:

ilMemberViewSettings::isActive ( )

Check if member view currently enabled.

Returns
bool

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

References getContainer(), and getCurrentRefId().

{
global $tree;
if(!$this->active)
{
// Not active
return false;
}
if(!$this->getCurrentRefId())
{
// No ref id given => mail, search, personal desktop menu in other tab
return false;
}
if(!in_array($this->getCurrentRefId(),$this->container_items) and
$this->getContainer() != $this->getCurrentRefId())
{
// outside of course
return false;
}
return true;
}

+ Here is the call graph for this function:

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 127 of file class.ilMemberViewSettings.php.

References getContainer().

{
if(!$this->active || !(int)$a_ref_id)
{
// Not active
return false;
}
if(!in_array($a_ref_id,$this->container_items) and
$this->getContainer() != $a_ref_id)
{
// outside of course
return false;
}
return true;
}

+ Here is the call graph for this function:

ilMemberViewSettings::isEnabled ( )

Check if members view is enabled in the administration.

Returns
bool active

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

References $enabled.

{
return (bool) $this->enabled;
}
ilMemberViewSettings::read ( )
protected

Read settings.

Returns
void

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

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

Referenced by __construct().

{
global $ilSetting,$tree;
// member view is always enabled
// (2013-06-18, http://www.ilias.de/docu/goto_docu_wiki_1357_Reorganising_Administration.html)
// $this->enabled = $ilSetting->get('preview_learner');
$this->enabled = true;
if(isset($_SESSION['member_view_container']))
{
$this->active = true;
$this->container = (int) $_SESSION['member_view_container'];
$this->container_items = $tree->getSubTreeIds($this->getContainer());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMemberViewSettings::setContainer (   $container)

Sets $container.

Parameters
object$container
See Also
ilMemberView::$container

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

References $_SESSION, and $container.

Referenced by activate().

{
$this->container = $container;
$_SESSION['member_view_container'] = $this->container;
$_SESSION['il_cont_admin_panel'] = false;
}

+ Here is the caller graph for this function:

ilMemberViewSettings::toggleActivation (   $a_ref_id,
  $a_activation 
)

Toggle activation status.

Returns
Parameters
int$a_ref_id
bool$a_activation

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

References activate(), and deactivate().

{
if($a_activation)
{
return $this->activate($a_ref_id);
}
else
{
return $this->deactivate($a_ref_id);
}
}

+ Here is the call graph for this function:

Field Documentation

ilMemberViewSettings::$active = false
private

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

ilMemberViewSettings::$container = null
private

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

Referenced by getContainer(), and setContainer().

ilMemberViewSettings::$container_items = array()
private

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

ilMemberViewSettings::$current_ref_id = 0
private

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

Referenced by getCurrentRefId().

ilMemberViewSettings::$enabled = false
private

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

Referenced by isEnabled().

ilMemberViewSettings::$instance = null
staticprivate

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

Referenced by getInstance().


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