claroline/claroline/inc/lib/module/manage.lib.php File Reference

Go to the source code of this file.

Namespaces

namespace  kernel::module

Functions

 get_module_info ($moduleId)
 claro_get_module_types ()
 get_installed_module_list ($type=null)
 get_course_tool_id ($label)
 get_module_repositories ()
 check_module_repositories ()
 get_and_unzip_uploaded_package ()
 unzip_package ($packageFileName)
 generate_module_cache ()
 install_module ($modulePath, $skipCheckDir=false, $registerModuleInCourses=false)
 activate_module ($moduleId, $activateInAllCourses=false)
 activate_module_in_platform ($moduleId)
 activate_module_in_all_courses ($toolLabel)
 deactivate_module ($moduleId)
 uninstall_module ($moduleId, $deleteModuleData=true)
 register_module_in_courses ($moduleId)
 register_module_in_single_course ($tool_id, $course_code)
 unregister_module_from_courses ($moduleId)
 unregister_module_from_single_course ($tool_id, $course_code)
 set_module_visibility ($moduleId, $visibility)
 set_module_visibility_in_course ($tool_id, $courseCode, $visibility)
 register_module ($modulePath)
 register_module_core ($module_info)
 register_module_tool ($moduleId, $module_info)
 add_module_in_dock ($moduleId, $newDockName)
 remove_module_dock ($moduleId, $dockName)
 move_module_in_dock ($moduleId, $dockName, $direction)
 get_max_rank_in_dock ($dockName)
 get_module_dock_list ($moduleId)
 get_dock_list ($moduleType)
 move_module_tool ($toolId, $sense)
 get_course_tool_rank ($toolId)
 get_next_course_tool ($rank)
 get_before_course_tool ($rank)
 get_course_tool_max_rank ()
 get_course_tool_min_rank ()
 is_package_file ($packagePath)
 course_tool_already_installed ($toolId, $courseId)
 is_tool_registered_in_course ($toolId, $courseId)
 update_course_tool_activation_in_course ($toolId, $courseId, $activated)
 update_tool_installation_in_course ($toolId, $courseId)
 is_module_registered_in_course ($toolId, $courseId)
 get_not_deactivable_tool_list ()
 get_not_uninstallable_tool_list ()
 set_module_autoactivation_in_course ($moduleLabel, $autoActivation)
 allow_module_activation_by_course_manager ($moduleLabel, $courseManagerCanActivate)

Function Documentation

activate_module ( moduleId,
activateInAllCourses = false 
)

Activate a module, its effect is

  • to call the activation script of the module (if there is any)
  • to modify the information in the main DB
    Parameters:
    integer $moduleId : ID of the module that must be activated
    Returns:
    array( backlog, boolean ) backlog object boolean true if the activation process suceeded, false otherwise

Definition at line 568 of file manage.lib.php.

activate_module_in_all_courses ( toolLabel  ) 

Activate the module in all courses

Parameters:
string $moduleLabel
Returns:
array array( Backlog $backlog, boolean $success );
Todo:
remove the need of the Backlog and use Exceptions instead

Definition at line 659 of file manage.lib.php.

activate_module_in_platform ( moduleId  ) 

Activate the module for the plateforme

Parameters:
int $moduleId
Returns:
array array( Backlog $backlog, boolean $success );
Todo:
remove the need of the Backlog and use Exceptions instead

Definition at line 610 of file manage.lib.php.

add_module_in_dock ( moduleId,
newDockName 
)

Set the dock in which the module displays its content

Parameters:
integer $moduleId id of the module to rename
string $newDockName new name for the doc
Returns:
boolean

Definition at line 1360 of file manage.lib.php.

allow_module_activation_by_course_manager ( moduleLabel,
courseManagerCanActivate 
)

Allow course managers to activate the given module in their courses

Parameters:
string $moduleLabel
boolean $value

Definition at line 1971 of file manage.lib.php.

check_module_repositories (  ) 

Check the presence of unexpected module repositories or unexpected module in DB, its effect is returning a list of module not installed in DB but present on server, or module installed in DB but not present on server.

Returns:
an array two arrays : ['folder'] containing paths of the suspicious folders found that did not correspond to an installed module in DB ['DB'] containing label of modules found in DB for which no corresponding folder was found on server

Definition at line 193 of file manage.lib.php.

claro_get_module_types (  ) 

Gest the list of module type already installed

Returns:
array of string

Definition at line 81 of file manage.lib.php.

course_tool_already_installed ( toolId,
courseId 
)

Is the tool already installed in the course

Parameters:
int $toolId main tool id
string $courseId course code
Returns:
boolean

Definition at line 1782 of file manage.lib.php.

deactivate_module ( moduleId  ) 

Desactivate a module, its effect is

  • to call the desactivation script of the module (if there is any)
  • to modify the information in the main DB
    Parameters:
    integer $moduleId : ID of the module that must be desactivated
    Returns:
    array( backlog, boolean ) backlog object boolean true if the deactivation process suceeded, false otherwise
    Todo:
    remove the need of the Backlog and use Exceptions instead

Definition at line 691 of file manage.lib.php.

generate_module_cache (  ) 

Generate the cache php file with the needed include of activated module of the platform.

Returns:
boolean true if succeed, false on failure

Definition at line 338 of file manage.lib.php.

get_and_unzip_uploaded_package (  ) 

Unzip a module package archive and get the path of the unzipped files

Todo:

split this function and use unzip_package()

remove the need of the Backlog and use Exceptions instead

Returns:
string

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

get_before_course_tool ( rank  ) 
Returns:
integer the value of the rank of the course_tool just before the course toolof rank $rank in the list

Definition at line 1725 of file manage.lib.php.

get_course_tool_id ( label  ) 

Get the tool id in a course (not the main tool id!) from the module label

Parameters:
the label of a course tool
Returns:
the id in the course tool tabel false if tool not found

Definition at line 128 of file manage.lib.php.

get_course_tool_max_rank (  ) 

get maximum position already used in the course_tool of the def_rank value

Returns:
: the maximum value

Definition at line 1741 of file manage.lib.php.

get_course_tool_min_rank (  ) 

get minimum position already used in the course_tool of the def_rank value

Returns:
: the minimum value

Definition at line 1753 of file manage.lib.php.

get_course_tool_rank ( toolId  ) 

Get the rank of the tool in the course tool list

Parameters:
int $toolId id of the course_tool module to get rank
Returns:
the value of the rank (def_rank table)

Definition at line 1690 of file manage.lib.php.

get_dock_list ( moduleType  ) 

Return list of dock aivailable for a given type

Parameters:
string $moduleType
string $context
Returns:
array

Definition at line 1586 of file manage.lib.php.

get_installed_module_list ( type = null  ) 

Get installed module list, its effect is to return an array containing the installed module's labels

Parameters:
string $type : type of the module that must be returned, if null, then all the modules are returned
Returns:
array containing the labels of the modules installed on the platform false if query failed

Definition at line 99 of file manage.lib.php.

get_max_rank_in_dock ( dockName  ) 

Function used by the SAX xml parser when the parser meets a opening tag

Parameters:
tring $dockName the dock from which we want this info
Returns:
int the max rank used for this dock

Definition at line 1546 of file manage.lib.php.

get_module_dock_list ( moduleId  ) 

Return list of dock where a module is docked

Parameters:
integer $moduleId
Returns:
array of array ( id, name)

Definition at line 1563 of file manage.lib.php.

get_module_info ( moduleId  ) 

Return info of a module, including extra info and specific info for tool if case

Parameters:
integer $moduleId
Returns:
array (label, id, module_name,activation, type, script_url, icon, version, author, author_email, website, description, license)

Definition at line 39 of file manage.lib.php.

get_module_repositories (  ) 

Get the list of the repositories found in the module repository where all modules are installed, its effect is returning the expected list

Returns:
an array with all the repositories found in the module repository where all modules are installed

Definition at line 148 of file manage.lib.php.

get_next_course_tool ( rank  ) 
Returns:
int the rank of the course_tool just after the course tool of rank $rank in the list

Definition at line 1706 of file manage.lib.php.

get_not_deactivable_tool_list (  ) 

Get the list of modules that cannot be deactivated

Returns:
array

Definition at line 1909 of file manage.lib.php.

get_not_uninstallable_tool_list (  ) 

Get the list of modules that cannot be uninstalled

Returns:
array

Definition at line 1924 of file manage.lib.php.

install_module ( modulePath,
skipCheckDir = false,
registerModuleInCourses = false 
)

Install a specific module to the platform

Parameters:
string $modulePath path to the module
bool $skipCheckDir skip checking if module directory already exists (default false)
Returns:
array( backlog, int ) backlog object containing the messages int moduleId if the install process suceeded, false otherwise
Todo:
remove the need of the Backlog and use Exceptions instead

Definition at line 417 of file manage.lib.php.

is_module_registered_in_course ( toolId,
courseId 
)

Is the module registered in the given course ?

Parameters:
int $toolId main tool id
string $courseId course code
Returns:
boolean

Definition at line 1892 of file manage.lib.php.

is_package_file ( packagePath  ) 

Check if the given file path point on a claroline package file

Parameters:
string $packagePath
Returns:
boolean

Definition at line 1766 of file manage.lib.php.

is_tool_registered_in_course ( toolId,
courseId 
)

Is the tool already registered in the course

Parameters:
int $toolId main tool id
string $courseId course code
Returns:
boolean

Definition at line 1801 of file manage.lib.php.

move_module_in_dock ( moduleId,
dockName,
direction 
)

Move a module inside its dock (change its position in the display

Parameters:
integer $moduleId
string $dockName
string $direction 'up' or 'down'

Definition at line 1465 of file manage.lib.php.

move_module_tool ( toolId,
sense 
)

Move the place of the module in the module list (it changes the value of def_rank in the course_tool table)

Parameters:
$moduleId id of the module tool to move
$sense should either 'up' or 'down' to know in which direction the module has to move in the list

Definition at line 1624 of file manage.lib.php.

register_module ( modulePath  ) 

Add module in claroline, giving its path

Parameters:
string $modulePath
Returns:
int module id or false
Todo:
remove the need of the Backlog and use Exceptions instead

Definition at line 1141 of file manage.lib.php.

register_module_core ( module_info  ) 

Add common info about a module in main module registry. In Claroline this info is split in two type of info into two tables : * module for really use info, * module_info for descriptive info

Parameters:
array $module_info.
Returns:
int moduleId in the registry.

Definition at line 1213 of file manage.lib.php.

register_module_in_courses ( moduleId  ) 

Register module in all courses

Parameters:
int $moduleId
Returns:
array( backlog, boolean ) backlog object boolean true if suceeded, false otherwise
Todo:
remove the need of the Backlog and use Exceptions instead

Definition at line 918 of file manage.lib.php.

register_module_in_single_course ( tool_id,
course_code 
)

Register module in a course

Parameters:
int $tool_id
string $course_id
Returns:
boolean true if suceeded, false otherwise

Definition at line 961 of file manage.lib.php.

register_module_tool ( moduleId,
module_info 
)

Store all unique info about a tool during install

Parameters:
integer $moduleId
array $moduleToolData, data from manifest
Returns:
int tool id or false

Definition at line 1274 of file manage.lib.php.

remove_module_dock ( moduleId,
dockName 
)

Remove a module from a dock in which the module displays

Parameters:
integer $moduleId
string $dockName

Definition at line 1406 of file manage.lib.php.

set_module_autoactivation_in_course ( moduleLabel,
autoActivation 
)

Set the autoactivation the given module in courses

Parameters:
string $moduleLabel
boolean $value

Definition at line 1948 of file manage.lib.php.

set_module_visibility ( moduleId,
visibility 
)

Set module visibility in all courses

Parameters:
int $moduleId id of the module
bool $visibility true for visible, false for invisible
Returns:
array( backlog, boolean ) backlog object boolean true if suceeded, false otherwise
Todo:
remove the need of the Backlog and use Exceptions instead

Definition at line 1071 of file manage.lib.php.

set_module_visibility_in_course ( tool_id,
courseCode,
visibility 
)

Set module tool visibility in one course

Parameters:
int $tool_id id of the module tool
string $courseCode
bool $visibility true for visible, false for invisible
Returns:
array( backlog, boolean ) backlog object boolean true if suceeded, false otherwise
Todo:
remove the need of the Backlog and use Exceptions instead

Definition at line 1112 of file manage.lib.php.

uninstall_module ( moduleId,
deleteModuleData = true 
)

Uninstall a specific module to the platform

Parameters:
integer $moduleId the id of the module to uninstall
Returns:
array( backlog, boolean ) backlog object boolean true if the uninstall process suceeded, false otherwise
Todo:
remove the need of the Backlog and use Exceptions instead

Definition at line 746 of file manage.lib.php.

unregister_module_from_courses ( moduleId  ) 

Unregister module in all courses

Parameters:
int $moduleId
Returns:
array( backlog, boolean ) backlog object boolean true if suceeded, false otherwise
Todo:
remove the need of the Backlog and use Exceptions instead

Definition at line 1001 of file manage.lib.php.

unregister_module_from_single_course ( tool_id,
course_code 
)

Unregister module in a course

Parameters:
int $tool_id
string $course_code
Returns:
boolean true if suceeded, false otherwise

Definition at line 1044 of file manage.lib.php.

unzip_package ( packageFileName  ) 

Unzip the module package

Parameters:
string $packageFileName
Returns:
string module path
Todo:

use this function in get_and_unzip_uploaded_package()

remove the need of the Backlog and use Exceptions instead

Definition at line 299 of file manage.lib.php.

update_course_tool_activation_in_course ( toolId,
courseId,
activated 
)

Change the activation status for the given tool in the given course

Parameters:
int $toolId main tool id
string $courseId
boolean $activated
Returns:
boolean

Definition at line 1822 of file manage.lib.php.

update_tool_installation_in_course ( toolId,
courseId 
)

Change the tool installation status in the course

Parameters:
int $toolId main tool id
string $courseId
Returns:
boolean

Definition at line 1866 of file manage.lib.php.

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