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

Class: DocumentManager

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

Class Overview




Methods



Class Details

[line 74]


[ Top ]


Class Methods


method delete_document [line 683]

boolean delete_document( array $_course, $path, string $base_work_dir, string $path,)

This deletes a document by changing visibility to 2, renaming it to filename_DELETED_#id Files/folders that are inside a deleted folder get visibility 2



Tags:

return:  true/false
todo:  now only files/folders in a folder get visibility 2, we should rename them too.


Parameters:

array   $_course  
string   $path,   path stored in the database
string   $base_work_dir   ,$base_work_dir, path to the documents folder
   $path  

[ Top ]

method file_get_mime_type [line 111]

void file_get_mime_type( string $filename)

Get the content type of a file by checking the extension We could use mime_content_type() with php-versions > 4.3, but this doesn't work as it should on Windows installations



Tags:

author:  ? first version
author:  Bert Vanderkimpen


Parameters:

string   $filename   or boolean TRUE to return complete array

[ Top ]

method file_send_for_download [line 336]

false file_send_for_download( string $full_file_name, [boolean $forced = false], [string $name = ''])

This function streams a file to the client



Tags:

return:  if file doesn't exist, true if stream succeeded


Parameters:

string   $full_file_name  
boolean   $forced  
string   $name  

[ Top ]

method file_visible_to_user [line 309]

true file_visible_to_user( $this_course, $doc_url)



Tags:

return:  if the user is allowed to see the document, false otherwise
author:  Roan Embrechts, bugfix
author:  Sergio A Kessler, first version
todo:  ??not only check if a file is visible, but also check if the user is allowed to see the file??


Parameters:

   $this_course  
   $doc_url  

[ Top ]

method get_all_document_data [line 484]

array get_all_document_data( array $_course, [string $path = '/'], [int $to_group_id = 0], [int $to_user_id = NULL], [boolean $can_see_invisible = false])

Fetches all document data for the given user/group



Tags:

return:  with all document data


Parameters:

array   $_course  
string   $path  
int   $to_group_id  
int   $to_user_id  
boolean   $can_see_invisible  

[ Top ]

method get_all_document_folders [line 575]

array get_all_document_folders( array $_course, [int $to_group_id = '0'], [boolean $can_see_invisible = false])

Gets the paths of all folders in a course

can show all folders (exept for the deleted ones) or only visible ones




Tags:

return:  with paths


Parameters:

array   $_course  
boolean   $can_see_invisible  
int   $to_group_id  

[ Top ]

method get_course_quota [line 80]

the get_course_quota( )



Tags:

return:  document folder quuta of the current course, in bytes
todo:  eliminate globals


[ Top ]

method get_document_id [line 803]

int get_document_id( array $_course, string $path)

Gets the id of a document with a given path



Tags:

return:  id of document / false if no doc found


Parameters:

array   $_course  
string   $path  

[ Top ]

method set_document_as_template [line 832]

void set_document_as_template( string $title, string $description, int $document_id_for_template, string $couse_code, int $user_id)

Allow to set a specific document as a new template for FCKEditor for a particular user in a particular course



Parameters:

string   $title  
string   $description  
int   $document_id_for_template   the document id
string   $couse_code  
int   $user_id  

[ Top ]

method string_send_for_download [line 409]

false string_send_for_download( string $full_string, [boolean $forced = false], [string $name = ''])

This function streams a string to the client for download.

You have to ensure that the calling script then stops processing (exit();) otherwise it may cause subsequent use of the page to want to download other pages in php rather than interpreting them.




Tags:

return:  if file doesn't exist, true if stream succeeded


Parameters:

string   $full_string   The string contents
boolean   $forced   Whether "save" mode is forced (or opening directly authorized)
string   $name   The name of the file in the end (including extension)

[ Top ]

method unset_document_as_template [line 857]

void unset_document_as_template( int $document_id, string $couse_code, int $user_id)

Unset a document as template



Parameters:

int   $document_id  
string   $couse_code  
int   $user_id  

[ Top ]


Documentation generated on Thu, 12 Jun 2008 13:19:43 -0500 by phpDocumentor 1.4.1