[ Index ]
 

Code source de Claroline 188

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/claroline/inc/lib/ -> claro_main.lib.php (sommaire)

CLAROLINE This lib contain many parts of frequently used function. This is not a thematic lib

Author: see 'credits' file
Copyright: (c) 2001-2007 Universite catholique de Louvain (UCL)
License: http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
Version: 1.8 $Revision: 1.266.2.12 $
Poids: 1566 lignes (46 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

claro_failure:: (30 méthodes):
  set_failure()
  get_last_failure()
  claro_enable_tool_view_option()
  claro_set_tool_view_mode()
  claro_disp_tool_view_option()
  claro_html_tool_view_option()
  claro_get_tool_view_mode()
  claro_is_allowed_to_edit()
  claro_is_display_mode_available()
  claro_set_display_mode_available()
  claro_date()
  claro_time()
  claro_is_javascript_enabled()
  claro_get_language_list()
  claro_get_conf_repository()
  get_conf()
  claro_die()
  http_response_splitting_workaround()
  claro_unquote_gpc()
  claro_get_current_context()
  pushClaroMessage()
  getClaroMessageList()
  claro_get_user_tool_list()
  claro_redirect()
  claro_form_relay_context()
  claro_url_relay_context()
  claro_disp_debug_banner()
  php_self()
  claro_debug_mode()
  protect_against_file_inclusion()

Définit 30 fonctions

  claro_get_course_data()
  claro_get_main_group_properties()
  claro_get_course_db_name()
  claro_get_course_db_name_glued()
  claro_get_course_path()
  claro_get_group_data()
  claro_get_course_group_path()
  claro_get_tool_name_list()
  claro_get_module_name_list()
  claro_get_main_course_tool_list()
  claro_get_course_tool_list()
  claro_get_course_external_link_list()
  claro_get_tool_name()
  claro_get_module_name()

Classe: claro_failure  - X-Ref

collects and manage failures occuring during script execution
The main purpose is allowing to manage the display messages externaly
from functions or objects. This strengthens encapsulation principle

set_failure($failureType)   X-Ref
Pile the last failure in the failure list

author: Hugues Peeters <peeters@ipm.ucl.ac.be>
param: string $failureType the type of failure
return: boolean false to stay consistent with the main script

get_last_failure()   X-Ref
get the last failure stored

author: Hugues Peeters <hugues.peeters@claroline.net>
return: string the last failure stored

claro_enable_tool_view_option()   X-Ref
Set if  the  access level switcher is aivailable

author: Hugues Peeters <peeters@ipm.ucl.ac.be>
return: true

claro_set_tool_view_mode($viewMode)   X-Ref
Set if  the  access level switcher is aivailable

author: Hugues Peeters <peeters@ipm.ucl.ac.be>
param: $viewMode 'STUDENT' or 'COURSE_ADMIN'
return: true if set succeed.

claro_disp_tool_view_option($viewModeRequested = false)   X-Ref
Display options to switch between student view and course manager view
This function is mainly used by the claro_init_banner.inc.php file
The display mode command will only be displayed if
claro_set_tool_view_mode(true) has been previously called.
This will affect the return value of claro_is_allowed_to_edit() function.
It will ten return false as the user is a simple student.

author: Roan Embrechts
author: Hugues Peeters
param: string - $viewModeRequested.
return: true;

claro_html_tool_view_option($viewModeRequested = false)   X-Ref
Pas de description

claro_get_tool_view_mode()   X-Ref
return the current mode in tool able to handle different view mode

author: Hugues Peeters <peeters@ipm.ucl.ac.be>
return: string 'COURSE_ADMIN' or 'STUDENT'

claro_is_allowed_to_edit()   X-Ref
Function that removes the need to directly use is_courseAdmin global in
tool scripts. It returns true or false depending on the user's rights in
this particular course.

author: Roan Embrechts
author: Patrick Cool
return: boolean true: the user has the rights to edit, false: he does not

claro_is_display_mode_available()   X-Ref

author: Hugues Peeters <hugues.peeters@claroline.net>
return: boolean

claro_set_display_mode_available($mode)   X-Ref

author: Hugues Peeters <hugues.peeters@claroline.net>
param: boolean $mode state to set in mode
return: boolean mode

claro_date($format, $timestamp = -1)   X-Ref
Compose currentdate with server time shift

author: Christophe Gesché <moosh@claroline.net>
param: string $format date() format
param: integer $timestamp timestamp or default  -1 for "now()"
return: date()

claro_time()   X-Ref
Compose currentdate with server time shift

author: Christophe Gesché <moosh@claroline.net>
return: timestamp shifted by mainTimeShift config value

claro_is_javascript_enabled()   X-Ref
checks if the javascript is enabled on the client browser
Actually a cookies is set on the header by a javascript code.
If this cookie isn't set, it means javascript isn't enabled.

author: Hugues Peeters <hugues.peeters@claroline.net>
return: boolean enabling state of javascript

claro_get_language_list()   X-Ref
get the list  of aivailable languages on the platform

author: Christophe Gesché <moosh@claroline.net>
return: array( langCode => langLabel) with aivailable languages

claro_get_conf_repository($context=array()   X-Ref
Return the config ropisitory for a given context

All platform config are stored in platform/conf/
But a course or a group can overide some config values

This function return the repository ignoring if it's  existing or empty

param: array $context
return: string

get_conf($param, $default = null)   X-Ref
Return the value of a Claroline configuration parameter

param: string $param config parameter
param: mixed $default (optionnal) - set a defaut to return value
return: string param value

claro_die($message)   X-Ref
Terminate the script and display message

param: string message

http_response_splitting_workaround( $str )   X-Ref
HTTP response splitting security flaw filter

author: Frederic Minne <zefredz@gmail.com>
return: string clean string to filter http_response_splitting attack

claro_unquote_gpc()   X-Ref
Strip the slashes coming from browser request

If the php.ini setting MAGIC_QUOTE_GPC is set to ON, all the variables
content comming frome the browser are automatically quoted by adding
slashes (default setting before PHP 4.3). claro_unquote_gpc() removes
these slashes. It needs to be called just once at the biginning
of the script.
author: Hugues Peeters <peeters@ipm.ucl.ac.be>
return: void

claro_get_current_context($contextKeys = null)   X-Ref

param: $contextKeys array or null

pushClaroMessage($message,$errorClass='error')   X-Ref
Developper function to push a message in stack of devs messages
in debug mod this stack is output in footer

author: Christophe Gesché <moosh@claroline.net>

getClaroMessageList($errorClass=null)   X-Ref
get stack of devel message


claro_get_user_tool_list($activeOnly=true)   X-Ref
Return the list of tools for a user

in 1.8 only  CLCAL are both  course tool and user tool.
ie : profile is'nt view as module,
and other course tool can't work outside a course for a user.

param: boolean $activeOnly default true
return: array of tools

claro_redirect($location)   X-Ref
Safe redirect
Works around IIS Bug


claro_form_relay_context($context=null)   X-Ref
Pas de description

claro_url_relay_context($prepend='',$context=null)   X-Ref
Pas de description

claro_disp_debug_banner()   X-Ref
Pas de description

php_self()   X-Ref
Pas de description

claro_debug_mode()   X-Ref

return: bool, true if the platform is in debug mode, false else

protect_against_file_inclusion( $path )   X-Ref
Protect file path against arbitrary file inclusion

param: string path, untrusted path
return: string secured path

Fonctions
Fonctions qui ne font pas partie d'une Classe:

claro_get_course_data($courseId = NULL, $force = false )   X-Ref
Get unique keys of a course.

author: Christophe Gesché <moosh@claroline.net>
param: string $course_id (optionnal)  If not set, it use the current course
return: array list of unique keys (sys, db & path) of a course

claro_get_main_group_properties($courseId)   X-Ref
This function return properties for groups in a given course context.

param: string $courseId sysCode of the course.
return: array ('registrationAllowed' ,

claro_get_course_db_name($cid=NULL)   X-Ref
Get the db name of a course.

author: Christophe Gesché <moosh@claroline.net>
param: string $course_id (optionnal)  If not set, it use the current course
return: string db_name

claro_get_course_db_name_glued($cid=NULL)   X-Ref
Get the glued db name of a course.Read to be use in claro_get_course_table_name

author: Christophe Gesché <moosh@claroline.net>
param: string $course_id (optionnal)  If not set, it use the current course
return: string db_name glued

claro_get_course_path($cid=NULL)   X-Ref
Get the path of a course.

author: Christophe Gesché <moosh@claroline.net>
param: string $course_id (optionnal)  If not set, it use the current course
return: string path

claro_get_group_data($context, $force = false )   X-Ref
Get unique keys of a course.

author: Christophe Gesché <moosh@claroline.net>
param: string $course_id (optionnal)  If not set, it use the current course
return: array list of unique keys (sys, db & path) of a course

claro_get_course_group_path($context)   X-Ref
Get the path of a group in a course.

author: Christophe Gesché <moosh@claroline.net>
param: array $context
return: string path

claro_get_tool_name_list()   X-Ref
Get names  of tools in an array where key are Claro_label

return: array list of localised name of tools

claro_get_module_name_list($active = true)   X-Ref
Get a list of tag names of some tools
This is a bad named function because they return only tool type modules

Returned tagname is the "Developpers english name" this tag would be passed to get_lang

param: boolean $active true filter to keep only tools activated in platform
return: array( `label`=>`tagname`)

claro_get_main_course_tool_list( $force = false )   X-Ref
Return the list of tool installed on the platform

param: boolean $force (optionnal) - reset the result cache, default is false
return: array the main course list array ( $tid => 'label','name','url','icon','activation' )

claro_get_course_tool_list($courseIdReq, $profileIdReq, $force = false, $active=true )   X-Ref
Return the tool list for a course according a certain access level

param: string  $courseIdReq - the requested course id
param: boolean $force (optionnal)  - reset the result cache, default is false
param: boolean $active (optionnal) - get the list of active tool only if set to true (default behaviour)
return: array   the course list

claro_get_course_external_link_list( $courseIdReq = null, $force = false )   X-Ref
Return the tool list for a course according a certain access level

param: boolean $force (optionnal) - reset the result cache, default is false
return: array the main course list array ( $id => 'name','url','icon','visibility' )

claro_get_tool_name( $identifier )   X-Ref
Get the name of a tool

param: string identifier is tool_id or tool_label
return: string tool name

claro_get_module_name( $identifier )   X-Ref
Return the name of a given module

param: mixed $identifier
return: string translated tool name;



Généré le : Thu Nov 29 14:38:42 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics