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

Procedural File: main_api.lib.php

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



Classes:

api_failure
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 encupsalation principle


Page Details:

This is a code library for Dokeos.

It is included by default in every Dokeos file (through including the global.inc.php)







array $api_failureList [line 988]

Pile the last failure in the failure list



Tags:

return:  false to stay consistent with the main script
author:  Hugues Peeters <peeters@ipm.ucl.ac.be>
Default value:  


[ Top ]





CONFIGURATION_PATH [line 87]

CONFIGURATION_PATH = 'CONFIGURATION_PATH'

[ Top ]



COURSEMANAGER [line 50]

COURSEMANAGER = 1
global status of a user: course manager


[ Top ]



COURSE_VISIBILITY_CLOSED [line 54]

COURSE_VISIBILITY_CLOSED = 0
only visible for course admin


[ Top ]



COURSE_VISIBILITY_OPEN_PLATFORM [line 58]

COURSE_VISIBILITY_OPEN_PLATFORM = 2
open for all registered users on the platform


[ Top ]



COURSE_VISIBILITY_OPEN_WORLD [line 60]

COURSE_VISIBILITY_OPEN_WORLD = 3
open for the whole world


[ Top ]



COURSE_VISIBILITY_REGISTERED [line 56]

COURSE_VISIBILITY_REGISTERED = 1
only visible for users registered in the course


[ Top ]



DIR_HOTPOTATOES [line 135]

DIR_HOTPOTATOES = '/HotPotatoes_files'

[ Top ]



GARBAGE_PATH [line 80]

GARBAGE_PATH = 'GARBAGE_PATH'

[ Top ]



INCLUDE_PATH [line 85]

INCLUDE_PATH = 'INCLUDE_PATH'

[ Top ]



LIBRARY_PATH [line 86]

LIBRARY_PATH = 'LIBRARY_PATH'

[ Top ]



PLATFORM_AUTH_SOURCE [line 132]

PLATFORM_AUTH_SOURCE = 'platform'

[ Top ]



PLUGIN_PATH [line 82]

PLUGIN_PATH = 'PLUGIN_PATH'

[ Top ]



REL_CLARO_PATH [line 74]

REL_CLARO_PATH = 'REL_CLARO_PATH'

[ Top ]



REL_COURSE_PATH [line 73]

REL_COURSE_PATH = 'REL_COURSE_PATH'

[ Top ]



REL_PATH [line 70]

REL_PATH = 'REL_PATH'

[ Top ]



SECTION_CAMPUS [line 124]

SECTION_CAMPUS = 'mycampus'

[ Top ]



SECTION_COURSES [line 125]

SECTION_COURSES = 'mycourses'

[ Top ]



SECTION_COURSE_ADMIN [line 128]

SECTION_COURSE_ADMIN = 'course_admin'

[ Top ]



SECTION_MYAGENDA [line 127]

SECTION_MYAGENDA = 'myagenda'

[ Top ]



SECTION_MYPROFILE [line 126]

SECTION_MYPROFILE = 'myprofile'

[ Top ]



SECTION_PLATFORM_ADMIN [line 129]

SECTION_PLATFORM_ADMIN = 'platform_admin'

[ Top ]



STUDENT [line 48]

STUDENT = 5
global status of a user: student


[ Top ]



SUBSCRIBE_ALLOWED [line 62]

SUBSCRIBE_ALLOWED = 1

[ Top ]



SUBSCRIBE_NOT_ALLOWED [line 63]

SUBSCRIBE_NOT_ALLOWED = 0

[ Top ]



SYS_ARCHIVE_PATH [line 84]

SYS_ARCHIVE_PATH = 'SYS_ARCHIVE_PATH'

[ Top ]



SYS_CODE_PATH [line 76]

SYS_CODE_PATH = 'SYS_CODE_PATH'

[ Top ]



SYS_COURSE_PATH [line 72]

SYS_COURSE_PATH = 'SYS_COURSE_PATH'

[ Top ]



SYS_LANG_PATH [line 77]

SYS_LANG_PATH = 'SYS_LANG_PATH'

[ Top ]



SYS_PATH [line 69]

SYS_PATH = 'SYS_PATH'

[ Top ]



SYS_PLUGIN_PATH [line 81]

SYS_PLUGIN_PATH = 'SYS_PLUGIN_PATH'

[ Top ]



TOOL_ANNOUNCEMENT [line 96]

TOOL_ANNOUNCEMENT = 'announcement'

[ Top ]



TOOL_BACKUP [line 111]

TOOL_BACKUP = 'backup'

[ Top ]



TOOL_BLOGS [line 104]

TOOL_BLOGS = 'blog_management'

[ Top ]



TOOL_CALENDAR_EVENT [line 92]

TOOL_CALENDAR_EVENT = 'calendar_event'

[ Top ]



TOOL_CHAT [line 105]

TOOL_CHAT = 'chat'

[ Top ]



TOOL_CONFERENCE [line 106]

TOOL_CONFERENCE = 'conference'

[ Top ]



TOOL_COPY_COURSE_CONTENT [line 112]

TOOL_COPY_COURSE_CONTENT = 'copy_course_content'

[ Top ]



TOOL_COURSE_DESCRIPTION [line 94]

TOOL_COURSE_DESCRIPTION = 'course_description'

[ Top ]



TOOL_COURSE_HOMEPAGE [line 114]

TOOL_COURSE_HOMEPAGE = 'course_homepage'

[ Top ]



TOOL_COURSE_MAINTENANCE [line 117]

TOOL_COURSE_MAINTENANCE = 'course_maintenance'

[ Top ]



TOOL_COURSE_RIGHTS_OVERVIEW [line 115]

TOOL_COURSE_RIGHTS_OVERVIEW = 'course_rights'

[ Top ]



TOOL_COURSE_SETTING [line 110]

TOOL_COURSE_SETTING = 'course_setting'

[ Top ]



TOOL_DOCUMENT [line 90]

TOOL_DOCUMENT = 'document'

[ Top ]



TOOL_DROPBOX [line 100]

TOOL_DROPBOX = 'dropbox'

[ Top ]



TOOL_FORUM [line 97]

TOOL_FORUM = 'forum'

[ Top ]



TOOL_GROUP [line 103]

TOOL_GROUP = 'group'

[ Top ]



TOOL_HOMEPAGE_LINK [line 109]

TOOL_HOMEPAGE_LINK = 'homepage_link'

[ Top ]



TOOL_HOTPOTATOES [line 91]

TOOL_HOTPOTATOES = 'hotpotatoes'

[ Top ]



TOOL_LEARNPATH [line 95]

TOOL_LEARNPATH = 'learnpath'

[ Top ]



TOOL_LINK [line 93]

TOOL_LINK = 'link'

[ Top ]



TOOL_POST [line 99]

TOOL_POST = 'post'

[ Top ]



TOOL_QUIZ [line 101]

TOOL_QUIZ = 'quiz'

[ Top ]



TOOL_RECYCLE_COURSE [line 113]

TOOL_RECYCLE_COURSE = 'recycle_course'

[ Top ]



TOOL_STUDENTPUBLICATION [line 107]

TOOL_STUDENTPUBLICATION = 'student_publication'

[ Top ]



TOOL_SURVEY [line 121]

TOOL_SURVEY = 'survey'

[ Top ]



TOOL_THREAD [line 98]

TOOL_THREAD = 'thread'

[ Top ]



TOOL_TRACKING [line 108]

TOOL_TRACKING = 'tracking'

[ Top ]



TOOL_UPLOAD [line 116]

TOOL_UPLOAD = 'file_upload'

[ Top ]



TOOL_USER [line 102]

TOOL_USER = 'user'

[ Top ]



TOOL_VISIO [line 118]

TOOL_VISIO = 'visio'

[ Top ]



TOOL_VISIO_CLASSROOM [line 120]

TOOL_VISIO_CLASSROOM = 'visio_classroom'

[ Top ]



TOOL_VISIO_CONFERENCE [line 119]

TOOL_VISIO_CONFERENCE = 'visio_conference'

[ Top ]



UNSUBSCRIBE_ALLOWED [line 64]

UNSUBSCRIBE_ALLOWED = 1

[ Top ]



UNSUBSCRIBE_NOT_ALLOWED [line 65]

UNSUBSCRIBE_NOT_ALLOWED = 0

[ Top ]



WEB_CODE_PATH [line 75]

WEB_CODE_PATH = 'WEB_CODE_PATH'

[ Top ]



WEB_COURSE_PATH [line 71]

WEB_COURSE_PATH = 'WEB_COURSE_PATH'

[ Top ]



WEB_CSS_PATH [line 79]

WEB_CSS_PATH = 'WEB_CSS_PATH'

[ Top ]



WEB_IMG_PATH [line 78]

WEB_IMG_PATH = 'WEB_IMG_PATH'

[ Top ]



WEB_PATH [line 68]

WEB_PATH = 'WEB_PATH'

[ Top ]



WEB_PLUGIN_PATH [line 83]

WEB_PLUGIN_PATH = 'WEB_PLUGIN_PATH'

[ Top ]




api_add_url_param [line 707]

void api_add_url_param( $url, $param)



Parameters

   $url  
   $param  
[ Top ]



api_block_anonymous_users [line 188]

void api_block_anonymous_users( )

Function used to prevent anonymous users from accessing a script.



Tags:

author:  Roan Embrechts


[ Top ]



api_check_password [line 770]

true api_check_password( string $password)

Checks a password to see wether it is OK to use.



Tags:

return:  if the password is acceptable, false otherwise


Parameters

string   $password  
[ Top ]



api_clear_anonymous [line 819]

bool api_clear_anonymous( [bool $db_check = false])

Clear the user ID from the session if it was the anonymous user. Generally used on out-of-tools pages to remove a user ID that could otherwise be used in the wrong context.

This function is to be used in conjunction with the api_set_anonymous() function to simulate the user existence in case of an anonymous visit.




Tags:

return:  true if succesfully unregistered, false if not anonymous.


Parameters

bool   $db_check   database check switch - passed to api_is_anonymous()
[ Top ]



api_display_array [line 1325]

void api_display_array( array $info_array)

Displays the contents of an array in a messagebox.



Parameters

array   $info_array   An array with the messages to show
[ Top ]



api_display_debug_info [line 1339]

void api_display_debug_info( string $debug_info)

Displays debug info



Tags:

author:  Roan Embrechts
version:  1.1, March 2004


Parameters

string   $debug_info   The message to display
[ Top ]



api_display_language_form [line 1671]

void api_display_language_form( )

Displays a form (drop down menu) so the user can select his/her preferred language.

The form works with or without javascript




[ Top ]



api_display_tool_title [line 1217]

void api_display_tool_title( mixed $titleElement)

Displays the title of a tool.

Normal use: parameter is a string: api_display_tool_title("My Tool")

Optionally, there can be a subtitle below the normal title, and / or a supra title above the normal title.

e.g. supra title: group GROUP PROPERTIES

e.g. subtitle: AGENDA calender & events tool




Tags:

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


Parameters

mixed   $titleElement   - it could either be a string or an array containing 'supraTitle', 'mainTitle', 'subTitle'
[ Top ]



api_display_tool_view_option [line 1263]

void api_display_tool_view_option( )

Display options to switch between student view and course manager view

Changes in version 1.2 (Patrick Cool) Student view switch now behaves as a real switch. It maintains its current state until the state is changed explicitly

Changes in version 1.1 (Patrick Cool) student view now works correctly in subfolders of the document tool student view works correctly in the new links tool

Example code for using this in your tools: //if ( $is_courseAdmin && api_get_setting('show_student_view') == 'true' ) //{ // display_tool_view_option($isStudentView); //} //and in later sections, use api_is_allowed_to_edit()




Tags:

author:  Patrick Cool
version:  1.2
todo:  rewrite code so it is easier to understand


[ Top ]



api_disp_html_area [line 1745]

void api_disp_html_area( string $name, [string $content = ''], [int $height = ''], [int $width = '100%'], [string $optAttrib = ''])

Displays the FckEditor WYSIWYG editor for online editing of html



Parameters

string   $name   The name of the form-element
string   $content   The default content of the html-editor
int   $height   The height of the form element
int   $width   The width of the form element
string   $optAttrib   optional attributes for the form element
[ Top ]



api_generate_password [line 751]

string api_generate_password( [ $length = 8], int $length,)

Returns a difficult to guess password.



Tags:

return:  the generated password


Parameters

int   $length,   the length of the password
   $length  
[ Top ]



api_get_anonymous_id [line 480]

int api_get_anonymous_id( )

Gets an anonymous user ID

For some tools that need tracking, like the learnpath tool, it is necessary to have a usable user-id to enable some kind of tracking, even if not perfect. An anonymous ID is taken from the users table by looking for a status of "6" (anonymous).




Tags:

return:  User ID of the anonymous user, or O if no anonymous user found


[ Top ]



api_get_cidreq [line 500]

void api_get_cidreq( )

Returns the cidreq parameter name + current course id



[ Top ]



api_get_course_id [line 438]

void api_get_course_id( )

Returns the current course id (integer)



[ Top ]



api_get_course_info [line 527]

void api_get_course_info( )

Returns the current course info array.

Note: this array is only defined if the user is inside a course. Array elements: ['name'] ['official_code'] ['sysCode'] ['path'] ['dbName'] ['dbNameGlu'] ['titular'] ['language'] ['extLink']['url' ] ['extLink']['name'] ['categoryCode'] ['categoryName']




Tags:

todo:  same behaviour as api_get_user_info so that api_get_course_id becomes absolete too


[ Top ]



api_get_course_path [line 449]

string api_get_course_path( )

Returns the current course directory

This function relies on api_get_course_info()




Tags:

return:  The directory where the course is located inside the Dokeos "courses" directory
author:  Yannick Warnier <yannick.warnier@dokeos.com>


[ Top ]



api_get_course_setting [line 459]

mixed api_get_course_setting( string $setting_name)

Gets a course setting from the current course_setting table. Try always using integer values.



Tags:

return:  The value of that setting in that table. Return -1 if not found.


Parameters

string   $setting_name   The name of the setting we want from the table
[ Top ]



api_get_interface_language [line 1119]

string api_get_interface_language( )

Gets the current interface language



Tags:

return:  The current language of the interface


[ Top ]



api_get_languages [line 1717]

array api_get_languages( )

Return a list of all the languages that are made available by the admin.



Tags:

return:  An array with all languages. Structure of the array is array['name'] = An array with the name of every language array['folder'] = An array with the corresponding dokeos-folder


[ Top ]



api_get_last_failure [line 955]

string api_get_last_failure( [void 0 = ])

get the last failure stored in $api_failureList;



Tags:

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


Parameters

void   0  
[ Top ]



api_get_navigator [line 209]

an api_get_navigator( )



Tags:

return:  array with the navigator name and version


[ Top ]



api_get_path [line 281]

void api_get_path( one $path_type)

Returns a full path to a certain Dokeos area, which you specify through a parameter.

See $_configuration['course_folder'] in the configuration.php to alter the WEB_COURSE_PATH and SYS_COURSE_PATH parameters.




Tags:

example:  example not found


Parameters

one   $path_type   of the following constants: WEB_PATH, SYS_PATH, REL_PATH, WEB_COURSE_PATH, SYS_COURSE_PATH, REL_COURSE_PATH, REL_CLARO_PATH, WEB_CODE_PATH, SYS_CODE_PATH, SYS_LANG_PATH, WEB_IMG_PATH, GARBAGE_PATH, PLUGIN_PATH, SYS_ARCHIVE_PATH, INCLUDE_PATH, LIBRARY_PATH, CONFIGURATION_PATH
[ Top ]



api_get_self [line 1041]

string api_get_self( )

Returns an escaped version of $_SERVER['PHP_SELF'] to avoid XSS injection



Tags:

return:  Escaped version of $_SERVER['PHP_SELF']


[ Top ]



api_get_setting [line 1031]

void api_get_setting( $variable, [ $key = NULL])

Returns the value of a setting from the web-adjustable admin config settings.

WARNING true/false are stored as string, so when comparing you need to check e.g. if(api_get_setting("show_navigation_menu") == "true") //CORRECT instead of if(api_get_setting("show_navigation_menu") == true) //INCORRECT




Tags:

author:  Rene Haentjens
author:  Bart Mollet


Parameters

   $variable  
   $key  
[ Top ]



api_get_user_id [line 390]

integer api_get_user_id( )

This function returns the id of the user which is stored in the $_user array.



Tags:

return:  the id of the current user
example:  example not found


[ Top ]



api_get_user_info [line 405]

$user_info api_get_user_info( [$user_id $user_id = ''])

find all the information about a user. If no paramater is passed you find all the information about the current user.



Tags:

return:  (array): user_id, lastname, firstname, username, email, ...
author:  Patrick Cool <patrick.cool@UGent.be>
version:  21 September 2004


Parameters

$user_id   $user_id   (integer): the id of the user
[ Top ]



api_is_allowed [line 1384]

void api_is_allowed( $tool $tool, $action $action, [ $task_id = 0])

this fun



Tags:

author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
version:  1.0


Parameters

$tool   $tool   the tool we are checking ifthe user has a certain permission
$action   $action   the action we are checking (add, edit, delete, move, visibility)
   $task_id  
[ Top ]



api_is_allowed_to_create_course [line 1144]

boolean api_is_allowed_to_create_course( )

Check if current user is allowed to create courses



Tags:

return:  True if the user has course creation rights, false otherwise.


[ Top ]



api_is_allowed_to_edit [line 1363]

boolean, api_is_allowed_to_edit( )

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.



Tags:

return:  true: the user has the rights to edit, false: he does not
author:  Patrick Cool
author:  Roan Embrechts
version:  1.1, February 2004


[ Top ]



api_is_anonymous [line 1459]

bool api_is_anonymous( [int $user_id = null], [bool $db_check = false])

Tells whether this user is an anonymous user



Tags:

return:  true if this user is anonymous, false otherwise


Parameters

int   $user_id   User ID (optional, will take session ID if not provided)
bool   $db_check   Whether to check in the database (true) or simply in the session (false) to see if the current user is the anonymous user
[ Top ]



api_is_coach [line 1160]

boolean api_is_coach( )

Check if the current user is a course or session coach



Tags:

return:  True if current user is a course or session coach


[ Top ]



api_is_course_admin [line 1152]

boolean api_is_course_admin( )

Check if the current user is a course administrator



Tags:

return:  True if current user is a course administrator


[ Top ]



api_is_platform_admin [line 1135]

boolean api_is_platform_admin( )

Check if current user is a platform administrator



Tags:

return:  True if the user has platform admin rights, false otherwise.


[ Top ]



api_is_plugin_installed [line 1878]

boolean api_is_plugin_installed( $plugin_list, $plugin_name)

Checks to see wether a certain plugin is installed.



Tags:

return:  true if the plugin is installed, false otherwise.


Parameters

   $plugin_list  
   $plugin_name  
[ Top ]



api_is_self_registration_allowed [line 243]

True api_is_self_registration_allowed( )



Tags:

return:  if user selfregistration is allowed, false otherwise.


[ Top ]



api_item_property_update [line 1585]

boolean api_item_property_update( $_course $_course, $tool $tool, $item_id $item_id, $lastedit_type $lastedit_type, $user_id $user_id, [$to_group_id $to_group_id = 0], [$to_user_id $to_user_id = NULL], [string $start_visible = 0], [unknown_type $end_visible = 0])

update the item_properties table (if entry not exists, insert) of the course



Tags:

return:  False if update fails.
author:  Toon Van Hoecke <Toon.VanHoecke@UGent.be>, Ghent University
version:  January 2005


Parameters

string   $start_visible   0000-00-00 00:00:00 format
unknown_type   $end_visible   0000-00-00 00:00:00 format
$_course   $_course   : array with course properties
$tool   $tool   : tool id, linked to 'rubrique' of the course tool_list (Warning: language sensitive !!)
$item_id   $item_id   : id of the item itself, linked to key of every tool ('id', ...), "*" = all items of the tool
$lastedit_type   $lastedit_type   : add or update action (1) message to be translated (in trad4all) : e.g. DocumentAdded, DocumentUpdated; (2) "delete"; (3) "visible"; (4) "invisible";
$user_id   $user_id   : id of the editing/adding user
$to_group_id   $to_group_id   : id of the intended group ( 0 = for everybody), only relevant for $type (1)
$to_user_id   $to_user_id   : id of the intended user (always has priority over $to_group_id !), only relevant for $type (1)
[ Top ]



api_max_sort_value [line 1805]

int api_max_sort_value( $user_course_category, $user_id, int $user_course_category:)

Find the largest sort value in a given user_course_category

This function is used when we are moving a course to a different category and also when a user subscribes to a courses (the new courses is added to the end of the main category




Tags:

return:  the value of the highest sort of the user_course_category
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

int   $user_course_category:   the id of the user_course_category
   $user_course_category  
   $user_id  
[ Top ]



api_not_allowed [line 1495]

void api_not_allowed( [bool $print_headers = false])

Displays message "You are not allowed here..." and exits the entire script.



Tags:

author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
author:  Roan Embrechts
author:  Yannick Warnier
version:  1.0, February 2004
version:  dokeos 1.8, August 2006


Parameters

bool   $print_headers   Whether or not to print headers (default = false -> does not print them)
[ Top ]



api_number_of_plugins [line 1847]

void api_number_of_plugins( $location)

Determines the number of plugins installed for a given location



Parameters

   $location  
[ Top ]



api_parse_tex [line 1895]

string api_parse_tex( $textext, string $text)

Apply parsing to content to parse tex commandos that are seperated by [tex] [/tex] to make it readable for techexplorer plugin.



Tags:

return:  The text after parsing.
author:  Patrick Cool <patrick.cool@UGent.be>
version:  June 2004


Parameters

string   $text   The text to parse
   $textext  
[ Top ]



api_plugin [line 1861]

void api_plugin( $location)

including the necessary plugins



Tags:

author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

   $location  
[ Top ]



api_protect_admin_script [line 174]

void api_protect_admin_script( )

Function used to protect an admin script.

The function blocks access when the user has no platform admin rights. This is only the first proposal, test and improve!




Tags:

author:  Roan Embrechts


[ Top ]



api_protect_course_script [line 155]

void api_protect_course_script( [boolean $print_headers = false])

Function used to protect a course script.

The function blocks access when

  • there is no $_SESSION["_course"] defined; or
  • $is_allowed_in_course is set to false (this depends on the course
visibility and user status).

This is only the first proposal, test and improve!




Tags:

author:  Roan Embrechts
todo:  replace global variable


Parameters

boolean   $print_headers   Option to print headers when displaying error message. Default: false
[ Top ]



api_return_html_area [line 1761]

void api_return_html_area( $name, [ $content = ''], [ $height = ''], [ $width = '100%'], [ $optAttrib = ''])



Parameters

   $name  
   $content  
   $height  
   $width  
   $optAttrib  
[ Top ]



api_send_mail [line 1791]

void api_send_mail( string $to, string $subject, string $message, [string $additional_headers = null], [string $additional_parameters = null])

Send an email.

Wrapper function for the standard php mail() function. Change this function to your needs. The parameters must follow the same rules as the standard php mail() function. Please look at the documentation on http: //www. php. net/manual/en/function. mail.php




Parameters

string   $to  
string   $subject  
string   $message  
string   $additional_headers  
string   $additional_parameters  
[ Top ]



api_session_clear [line 684]

void api_session_clear( )

Clear the session



Tags:

author:  Olivier Brouckaert


[ Top ]



api_session_destroy [line 695]

void api_session_destroy( )

Destroy the session



Tags:

author:  Olivier Brouckaert


[ Top ]



api_session_register [line 661]

void api_session_register( string $variable)

save a variable into the session

BUG: function works only with global variables




Tags:

author:  Olivier Brouckaert


Parameters

string   $variable   variable - the variable name to save into the session
[ Top ]



api_session_start [line 613]

void api_session_start( [string $already_installed = true])

Start the Dokeos session.

The default lifetime for session is set here. It is not possible to have it as a database setting as it is used before the database connection has been made. It is taken from the configuration file, and if it doesn't exist there, it is set to 360000 seconds




Tags:

author:  Olivier Brouckaert


Parameters

string   $already_installed   variable - the variable name to save into the session
[ Top ]



api_session_unregister [line 673]

void api_session_unregister( string $variable)

Remove a variable from the session.



Tags:

author:  Olivier Brouckaert


Parameters

string   $variable   variable - the variable name to remove from the session
[ Top ]



api_set_anonymous [line 923]

bool api_set_anonymous( )

Sets the current user as anonymous if it hasn't been identified yet. This

function should be used inside a tool only. The function api_clear_anonymous() acts in the opposite direction by clearing the anonymous user's data every time we get on a course homepage or on a neutral page (index, admin, my space)




Tags:

return:  true if set user as anonymous, false if user was already logged in or anonymous id could not be found


[ Top ]



api_set_failure [line 909]

bolean api_set_failure( string $failureType)

Fills a global array called $api_failureList

This array collects all the failure occuring during the script runs The main purpose is allowing to manage the display messages externaly from the functions or objects. This strengthens encupsalation principle




Tags:

return:  false to stay consistent with the main script
author:  Hugues Peeters <peeters@ipm.ucl.ac.be>


Parameters

string   $failureType   - the type of failure
[ Top ]



api_sql_query [line 548]

resource api_sql_query( string $query, [string $file = ''], [string $line = 0])

Executes an SQL query You have to use addslashes() on each value that you want to record into the database



Tags:

return:  - the return value of the query
author:  Olivier Brouckaert


Parameters

string   $query   - SQL query
string   $file   - optional, the file path and name of the error (__FILE__)
string   $line   - optional, the line of the error (__LINE__)
[ Top ]



api_store_result [line 587]

array api_store_result( resource $result)

Store the result of a query into an array



Tags:

return:  - the value returned by the query
author:  Olivier Brouckaert


Parameters

resource   $result   - the return value of the query
[ Top ]



api_time_to_hms [line 1915]

string api_time_to_hms( integer $seconds)

Transform a number of seconds in hh:mm:ss format



Tags:

return:  the formated time
author:  Julian Prud'homme


Parameters

integer   $seconds   the number of seconds
[ Top ]



api_trunc_str [line 843]

void api_trunc_str( string $text, [integer $length = 30], [string $endStr = '...'], [boolean $middle = false])

truncates a string



Tags:

author:  Brouckaert Olivier


Parameters

string   $text   text - text to truncate
integer   $length   length - length of the truncated text
string   $endStr   endStr - suffix
boolean   $middle   middle - if true, truncates on string middle
[ Top ]



convert_mysql_date [line 1557]

unix convert_mysql_date( $last_post_datetime $last_post_datetime)

convert sql date to unix timestamp



Tags:

return:  timestamp
author:  Toon Van Hoecke <Toon.VanHoecke@UGent.be>
version:  October 2003


Parameters

$last_post_datetime   $last_post_datetime   standard output date in a sql query
[ Top ]



copyr [line 1947]

void copyr( the $source, the $dest, [an $exclude = array()], [copied_files $copied_files = array()])

function adapted from a php.net comment

copy recursively a folder




Parameters

the   $source   source folder
the   $dest   dest folder
an   $exclude   array of excluded file_name (without extension)
copied_files   $copied_files   the returned array of copied files
[ Top ]



domesticate [line 875]

void domesticate( string $input)

handling simple and double apostrofe in order that strings be stored properly in database



Tags:

author:  Denes Nagy


Parameters

string   $input   variable - the variable to be revised
[ Top ]



get_lang [line 1062]

language get_lang( $variable, [ $notrans = 'DLTT'])

Whenever the server type in the Dokeos Config settings is set to test/development server you will get an indication that a language variable is not translated and a link to a suggestions form of DLTT.



Tags:

return:  variable '$lang'.$variable or language variable $variable.
author:  Roan Embrechts
author:  Patrick Cool


Parameters

   $variable  
   $notrans  
[ Top ]



get_setting [line 1014]

void get_setting( $variable, [ $key = NULL])

DEPRECATED, use api_get_setting instead



Parameters

   $variable  
   $key  
[ Top ]



is_allowed_to_edit [line 1348]

void is_allowed_to_edit( )



[ Top ]



shorten [line 860]

void shorten( $input, [ $length = 15])



Parameters

   $input  
   $length  
[ Top ]



string_2_boolean [line 1832]

boolean string_2_boolean( string $string)

This function converts the string "true" or "false" to a boolean true or false.

This function is in the first place written for the Dokeos Config Settings (also named AWACS)




Tags:

return:  true or false
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University


Parameters

string   $string   "true" or "false"
[ Top ]



Documentation generated on Wed, 05 Sep 2007 06:14:56 +0200 by phpDocumentor 1.4.0