claroline/claroline/inc/lib/init.lib.php File Reference

Go to the source code of this file.

Namespaces

namespace  KERNEL

Functions

 claro_is_user_authenticated ()
 1° Is in the context
 claro_is_in_a_course ()
 claro_is_in_a_group ()
 claro_is_in_a_tool ()
 claro_get_current_user_id ()
 2° Get ID
 claro_get_current_course_id ()
 claro_get_current_group_id ()
 claro_get_current_tool_id ()
 get_current_module_label ()
 set_current_module_label ($label)
 clear_current_module_label ()
 claro_get_current_course_data ($dataName=null)
 3° Get Values/properties
 claro_get_current_group_properties_data ($dataName=null)
 claro_get_current_user_data ($dataName=null)
 claro_get_current_group_data ($dataName=null)
 claro_get_current_course_user_data ($dataName=null)
 claro_get_current_course_tool_data ($dataName=null)
 claro_get_current_course_tool_list_data ($dataName=null)
 claro_is_course_member ()
 4° Get right
 claro_is_course_tutor ()
 claro_is_platform_admin ()
 claro_is_course_admin ()
 claro_is_course_manager ()
 claro_is_course_allowed ()
 claro_is_allowed_to_create_course ()
 claro_is_group_member ()
 claro_is_group_tutor ()
 claro_is_group_allowed ()
 claro_is_tool_allowed ()
 claro_is_module_allowed ()
 get_init ($param)
 claro_get_course_user_data ($cid, $uid, $ignoreCache=false)
 6° read data in DB
 claro_get_course_user_privilege ($cid, $uid, $ignoreCache=false)
 claro_get_course_user_properties ($cid, $uid, $ignoreCache=false)
 claro_get_current_user_profile_id_in_course ($courseId=null)
 claro_called_from ()
 claro_is_course_enable ()

Function Documentation

claro_called_from (  ) 

Get the context from where the page is called e.g.: if a tool is called from another tool

Returns:
mixed tlabel or false if not called from a specific tool or whatever

Definition at line 666 of file init.lib.php.

claro_get_course_user_data ( cid,
uid,
ignoreCache = false 
)

6° read data in DB

Fetch datas of the given user in the given course

Parameters:
string $cid course id
integer $uid user id
bool $ignoreCache true to for read in database instead of cache
Returns:
array('role')
Author:
Christophe Gesché <moosh@claroline.net>

Definition at line 558 of file init.lib.php.

claro_get_course_user_privilege ( cid,
uid,
ignoreCache = false 
)

Fetch privileges of the given user in the given course

Parameters:
string $cid course id
integer $uid user id
bool $ignoreCache true to for read in database instead of cache
Returns:
array('_profileId','is_courseMember','is_courseTutor','is_courseAdmin')
Author:
Christophe Gesché <moosh@claroline.net>

Definition at line 574 of file init.lib.php.

claro_get_course_user_properties ( cid,
uid,
ignoreCache = false 
)

Fetch data and privileges of the given user in the given course

U don't have enough of this function use claro_get_course_user_data($cid,$uid,$ignoreCache=false) or claro_get_course_user_privilege($cid,$uid,$ignoreCache=false)

Parameters:
string $cid course id
integer $uid user id
bool $ignoreCache true to for read in database instead of cache
Returns:
array(data( array('role')), 'privilege'(array('_profileId','is_courseMember','is_courseTutor','is_courseAdmin')))
See also:
claro_get_course_user_data($cid,$uid,$ignoreCache=false)
claro_get_course_user_privilege($cid,$uid,$ignoreCache=false)
Author:
Christophe Gesché <moosh@claroline.net>

Definition at line 598 of file init.lib.php.

claro_get_current_course_data ( dataName = null  ) 

3° Get Values/properties

Return the value of a Claroline configuration parameter

Parameters:
string $param config parameter
mixed $default (optionnal) - set a defaut to return value if no paramater with such a name is found.
Author:
Christophe Gesché <moosh@claroline.net>
Returns:
string param value
Todo:
http://www.claroline.net/forum/viewtopic.php?t=4579

Return data of the current course

Parameters:
string or null $dataName name of field, or null to keep an array of all fields
Author:
Christophe Gesché <moosh@claroline.net>
Returns:
string or array of string

Definition at line 191 of file init.lib.php.

claro_get_current_course_id (  ) 

Return the init status

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 103 of file init.lib.php.

claro_get_current_course_tool_data ( dataName = null  ) 

Return properties for the current tool

Parameters:
string or null $dataName property name, or null to keep an array of all properties
Author:
Christophe Gesché <moosh@claroline.net>
Returns:
array of all value or value of given property name

Definition at line 297 of file init.lib.php.

claro_get_current_course_tool_list_data ( dataName = null  ) 

Return tool listbfor the current course

Parameters:
string or null $dataName property name, or null to keep an array of all properties
Author:
Christophe Gesché <moosh@claroline.net>
Returns:
array of all value or value of given property name

Definition at line 317 of file init.lib.php.

claro_get_current_course_user_data ( dataName = null  ) 

Return properties for the current user in the current course

Parameters:
string or null $dataName property name, or null to keep an array of all properties
Author:
Christophe Gesché <moosh@claroline.net>
Returns:
array of all value or value of given property name

Definition at line 273 of file init.lib.php.

claro_get_current_group_data ( dataName = null  ) 

Return properties for the current group

Parameters:
string or null $dataName property name, or null to keep an array of all properties
Author:
Christophe Gesché <moosh@claroline.net>
Returns:
array of all value or value of given property name

Definition at line 252 of file init.lib.php.

claro_get_current_group_id (  ) 

Return the init status

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 115 of file init.lib.php.

claro_get_current_group_properties_data ( dataName = null  ) 

Return group properties for the current course

Parameters:
string or null $dataName property name, or null to keep an array of all properties
Author:
Christophe Gesché <moosh@claroline.net>
Returns:
array of all value or value of given property name

Definition at line 210 of file init.lib.php.

claro_get_current_tool_id (  ) 

Return the init status

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 127 of file init.lib.php.

claro_get_current_user_data ( dataName = null  ) 

Return data of the current user

Parameters:
string or null $dataName name of field, or null to keep an array of all fields
Author:
Christophe Gesché <moosh@claroline.net>
Returns:
string or array of string

Definition at line 233 of file init.lib.php.

claro_get_current_user_id (  ) 

2° Get ID

Return the init status

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 91 of file init.lib.php.

claro_get_current_user_profile_id_in_course ( courseId = null  ) 

Get the profile id of the current user in a given course

Parameters:
string $courseId id (sysCode) of the course
Returns:
int id of the current user's profile in the course

Definition at line 650 of file init.lib.php.

claro_is_allowed_to_create_course (  ) 

Return the right of the current user

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 418 of file init.lib.php.

claro_is_course_admin (  ) 

Return the right of the current user

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 381 of file init.lib.php.

claro_is_course_allowed (  ) 

Return the right of the current user

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 406 of file init.lib.php.

claro_is_course_enable (  ) 

Return if course status is enable

Definition at line 674 of file init.lib.php.

claro_is_course_manager (  ) 

Return the right of the current user

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 394 of file init.lib.php.

claro_is_course_member (  ) 

4° Get right

Return the right of the current user

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 347 of file init.lib.php.

claro_is_course_tutor (  ) 

Return the right of the current user

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 359 of file init.lib.php.

claro_is_group_allowed (  ) 

Return the right of the current user

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 454 of file init.lib.php.

claro_is_group_member (  ) 

Return the right of the current user

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 430 of file init.lib.php.

claro_is_group_tutor (  ) 

Return the right of the current user

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 442 of file init.lib.php.

claro_is_in_a_course (  ) 

Return the init status

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 52 of file init.lib.php.

claro_is_in_a_group (  ) 

Return the init status

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 64 of file init.lib.php.

claro_is_in_a_tool (  ) 

Return the init status

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 76 of file init.lib.php.

claro_is_module_allowed (  ) 

Definition at line 471 of file init.lib.php.

claro_is_platform_admin (  ) 

Return the right of the current user

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 370 of file init.lib.php.

claro_is_tool_allowed (  ) 

Return the right of the current user

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 466 of file init.lib.php.

claro_is_user_authenticated (  ) 

1° Is in the context

GET VALUES FROM INIT 5 types of values/Function 1° Is in the context 2° Get ID 3° Get Values/properties 4° Get right 5° get_init : generic function to prepare 4st previous during developpement 6° read data in DB Return the init status

Author:
Christophe Gesché <moosh@claroline.net>
Returns:
boolean

Definition at line 40 of file init.lib.php.

clear_current_module_label (  ) 

Unset the current module label at run time (Warning : does not alter tlabelReq or _courseTool)

Parameters:
string label module label
Returns:
string old label or false if no old label defined

Definition at line 167 of file init.lib.php.

get_current_module_label (  ) 

Returns the label of the current tool module FIXME: non-course module hack FIXME: applet module hack FIXME: switch tlbelReq and _courseTool lookup ?

Returns:
string module label boolean false if no module currently in use or not in a tool module

Definition at line 140 of file init.lib.php.

get_init ( param  ) 

Return the value of a Claroline configuration parameter

Parameters:
string $param config parameter
mixed $default (optionnal) - set a defaut to return value if no paramater with such a name is found.
Author:
Christophe Gesché <moosh@claroline.net>
Returns:
string param value
Todo:
http://www.claroline.net/forum/viewtopic.php?t=4579

Definition at line 506 of file init.lib.php.

set_current_module_label ( label  ) 

Set the current module label at run time

Parameters:
string label module label
Returns:
string old label boolean false if no old label defined FIXME : use it in docks and kernel

Definition at line 152 of file init.lib.php.

Generated on Tue Jun 8 12:28:37 2010 for Claroline API by  doxygen 1.6.3