ILIAS  eassessment Revision 61809
 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.
 setContainer ($container)
 Sets $container.
 isActive ()
 Check if member view currently enabled.
 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.

Private Member Functions

 __construct ()
 Constructor (singleton)

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

ilMemberViewSettings::__construct ( )
private

Constructor (singleton)

Returns

Definition at line 42 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 123 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 133 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::getContainer ( )

Returns $container.

See Also
ilMemberView::$container

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

References $container.

Referenced by isActive(), and read().

{
}

+ Here is the caller graph for this function:

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().

{
global $tree;
if(!$this->active)
{
// Not active
return false;
}
$ref_id = $_GET['ref_id'] ? $_GET['ref_id'] : null;
if(!$ref_id)
{
$target_arr = explode('_',(string) $_GET['target']);
$ref_id = $target_arr[1] ? $target_arr[1] : null;
}
if(!$ref_id)
{
// No ref id given => mail, search, personal desktop menu in other tab
return false;
}
if(!in_array($ref_id,$this->container_items) and
$this->getContainer() != $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 162 of file class.ilMemberViewSettings.php.

References $enabled.

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

Read settings.

Returns
void

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

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

Referenced by __construct().

{
global $ilSetting,$tree;
$this->enabled = $ilSetting->get('preview_learner');
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 74 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 146 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::$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: