dokeos-library
[ class tree: dokeos-library ] [ index: dokeos-library ] [ all elements ]

Procedural File: add_course.lib.inc.php

Source Location: /main/inc/lib/add_course.lib.inc.php



Page Details:

This is the course creation library for Dokeos.

It contains functions to create a course. Include/require it in your code to use its functionality.




Tags:

todo:  clean up horrible structure, script is unwieldy, for example easier way to deal with different tool visibility settings: ALL_TOOLS_INVISIBLE, ALL_TOOLS_VISIBLE, CORE_TOOLS_VISIBLE...
filesource:  Source Code for this file


Includes:

include_once(api_get_path(LIBRARY_PATH).'database.lib.php') [line 35]
This is the course creation library for Dokeos.

It contains functions to create a course. Include/require it in your code to use its functionality.




Tags:

todo:  clean up horrible structure, script is unwieldy, for example easier way to deal with different tool visibility settings: ALL_TOOLS_INVISIBLE, ALL_TOOLS_VISIBLE, CORE_TOOLS_VISIBLE...
filesource:  Source Code for this file






browse_folders [line 1461]

void browse_folders( $path, $files, $media)



Parameters

   $path  
   $files  
   $media  
[ Top ]



checkArchive [line 2176]

void checkArchive( $pathToArchive)

WARNING: this function always returns true.



Parameters

   $pathToArchive  
[ Top ]



create_course [line 58]

true create_course( string $wanted_code, string $title, string $tutor_name, integer $category_code, string $course_language, integer $course_admin_id, string $db_prefix, integer $firstExpirationDelay)

Not tested yet.

We need this new function so not every script that creates courses needs to be changed when the behaviour necessary to create a course changes. This will reduce bugs.




Tags:

return:  if the course creation was succesful, false otherwise.


Parameters

string   $wanted_code   Course code requested (might be altered to match possible values)
string   $title   Course title
string   $tutor_name   Tutor name
integer   $category_code   Course category code
string   $course_language   Course language
integer   $course_admin_id   Course admin ID
string   $db_prefix   DB prefix
integer   $firstExpirationDelay   Expiration delay in unix timestamp
[ Top ]



define_course_keys [line 107]

array define_course_keys( $wantedCode $wantedCode, [string $prefix4all = ""], [ $prefix4baseName = ""], [ $prefix4path = ""], [ $addUniquePrefix = false], [ $useCodeInDepedentKeys = true])

Defines the four needed keys to create a course based on several parameters.



Tags:

return:  with the needed keys ["currentCourseCode"], ["currentCourseId"], ["currentCourseDbName"], ["currentCourseRepository"]
todo:  eliminate globals


Parameters

$wantedCode   $wantedCode   the code you want for this course
string   $prefix4all   prefix // prefix added for ALL keys
   $prefix4baseName  
   $prefix4path  
   $addUniquePrefix  
   $useCodeInDepedentKeys  
[ Top ]



fill_course_repository [line 1514]

void fill_course_repository( $courseRepository)

Fills the course repository with some example content.



Tags:

version:  1.2


Parameters

   $courseRepository  
[ Top ]



fill_Db_course [line 1707]

void fill_Db_course( $courseDbName, $courseRepository, $language, $default_document_array)

Fills the course database with some required content and example content.



Tags:

version:  1.2


Parameters

   $courseDbName  
   $courseRepository  
   $language  
   $default_document_array  
[ Top ]



generate_course_code [line 84]

void generate_course_code( $course_title)



Parameters

   $course_title  
[ Top ]



lang2db [line 1697]

string lang2db( string $string)

Function to convert a string from the Dokeos language files to a string ready to insert into the database.



Tags:

return:  The string converted to insert into the database
author:  Bart Mollet (bart.mollet@hogent.be)


Parameters

string   $string   The string to convert
[ Top ]



prepare_course_repository [line 214]

void prepare_course_repository( $courseRepository, $courseId)



Parameters

   $courseRepository  
   $courseId  
[ Top ]



readPropertiesInArchive [line 2181]

void readPropertiesInArchive( $archive, [ $isCompressed = TRUE])



Parameters

   $archive  
   $isCompressed  
[ Top ]



register_course [line 2058]

void register_course( $courseSysCode, $courseScreenCode, string $courseRepository, string $courseDbName, $titular, string $category, string $title, string $course_language, $uidCreator, [integer $expiration_date = ""], [array $teachers = array()], string $courseId, string $courseCode, string $tutor_name, string $uid)

function register_course to create a record in the course table of the main database



Parameters

string   $courseId  
string   $courseCode  
string   $courseRepository  
string   $courseDbName  
string   $tutor_name  
string   $category  
string   $title   complete name of course
string   $course_language   lang for this course
string   $uid   uid of owner
integer   $expiration_date   Expiration date in unix time representation
array   $teachers   Optional array of teachers' user ID
   $courseSysCode  
   $courseScreenCode  
   $titular  
   $uidCreator  
[ Top ]



sort_pictures [line 1498]

void sort_pictures( $files, $type)



Parameters

   $files  
   $type  
[ Top ]



string2binary [line 2032]

void string2binary( string $variable)

function string2binary converts the string "true" or "false" to the boolean true false (0 or 1)

This is used for the Dokeos Config Settings as these store true or false as string and the api_get_setting('course_create_active_tools') should be 0 or 1 (used for the visibility of the tool)




Tags:

author:  Patrick Cool, patrick.cool@ugent.be


Parameters

string   $variable  
[ Top ]



update_Db_course [line 270]

void update_Db_course( $courseDbName)



Parameters

   $courseDbName  
[ Top ]



Documentation generated on Thu, 12 Jun 2008 12:53:29 -0500 by phpDocumentor 1.4.1