Dokeos
[ class tree: Dokeos ] [ index: Dokeos ] [ all elements ]

Procedural File: dropbox_functions.inc.php

Source Location: /main/dropbox/dropbox_functions.inc.php



Page Details:

This file contains additional dropbox functions. Initially there were some functions in the init files also but I have moved them over

to one file -- Patrick Cool <patrick.cool@UGent.be>, Ghent University










check_file_name [line 1269]

void check_file_name( $file_name_2_check, [ $counter = 0])

This function checks if the real filename of the dropbox files doesn't already exist in the temp folder. If this is the case then it will generate a different filename;



Tags:

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


Parameters

   $file_name_2_check  
   $counter  
[ Top ]



check_number_feedback [line 1409]

void check_number_feedback( $key, $array)

this function checks if the key exists. If this is the case it returns the value, if not it returns 0



Tags:

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


Parameters

   $key  
   $array  
[ Top ]



cleanup_temp_dropbox [line 1301]

true cleanup_temp_dropbox( )

Cleans the temp zip files that were created when users download several files or a whole folder at once. T



Tags:

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


[ Top ]



delete_category [line 122]

void delete_category( $action, $id)

This function deletes a dropbox category



Tags:

author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
version:  march 2006
todo:  give the user the possibility what needs to be done with the files in this category: move them to the root, download them as a zip, delete them


Parameters

   $action  
   $id  
[ Top ]



display_action_options [line 247]

html display_action_options( $part, $categories, [ $current_category = 0])

This functions displays all teh possible actions that can be performed on multiple files. This is the dropdown list that appears below the sortable table of the sent / or received files.



Tags:

return:  value for the dropdown list
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
version:  march 2006


Parameters

   $part  
   $categories  
   $current_category  
[ Top ]



display_addcategory_form [line 408]

void display_addcategory_form( [$category_name $category_name = ''], [$id $id = ''])

This function displays the form to add a new category.



Tags:

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


Parameters

$category_name   $category_name   this parameter is the name of the category (used when no section is selected)
$id   $id   this is the id of the category we are editing.
[ Top ]



display_add_form [line 480]

void display_add_form( )

this function displays the form to upload a new item to the dropbox.



Tags:

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


[ Top ]



display_file_checkbox [line 284]

html display_file_checkbox( $id $id, $part $part)

this function returns the html code that displays the checkboxes next to the files so that multiple actions on one file are possible.



Tags:

return:  code
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
version:  march 2006


Parameters

$id   $id   the unique id of the file
$part   $part   are we dealing with a sent or with a received file?
[ Top ]



display_move_form [line 175]

html display_move_form( $part, $id, [ $target = array()])

Displays the form to move one individual file to a category



Tags:

return:  code of the form that appears in a dokeos message box.
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
version:  march 2006


Parameters

   $part  
   $id  
   $target  
[ Top ]



display_user_link [line 989]

void display_user_link( $user_id, [ $name = ''])

This function displays the firstname and lastname of the user as a link to the user tool.



Tags:

author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
version:  march 2006
see:  this is the same function as in the new forum, so this probably has to move to a user library.
todo:  move this function to the user library


Parameters

   $user_id  
   $name  
[ Top ]



dropbox_cnf [line 785]

void dropbox_cnf( $variable)

Function that finds a given config setting



Tags:

author:  Ren� Haentjens, Ghent University


Parameters

   $variable  
[ Top ]



dropbox_lang [line 774]

void dropbox_lang( $variable, [ $notrans = 'DLTT'])

The dropbox has a deviant naming scheme for language files so it needs an additional language function



Tags:

author:  Ren� Haentjens, Ghent University
todo:  check if this function is still necessary.


Parameters

   $variable  
   $notrans  
[ Top ]



feedback [line 1022]

void feedback( an $array)

this function transforms the array containing all the feedback into something visually attractive.



Tags:

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


Parameters

an   $array   array containing all the feedback about the given message.
[ Top ]



feedback_form [line 1058]

html feedback_form( )

this function returns the code for the form for adding a new feedback message to a dropbox file.



Tags:

return:  code
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
version:  march 2006


[ Top ]



format_feedback [line 1042]

html format_feedback( $feedback_array $feedback)

This function returns the html code to display the feedback messages on a given dropbox file



Tags:

return:  code
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
version:  march 2006
todo:  add the form for adding new comment (if the other party has not deleted it yet).


Parameters

$feedback_array   $feedback   an array that contains all the feedback messages about the given document.
[ Top ]



generate_html_overview [line 1331]

void generate_html_overview( $files, [ $dont_show_columns = array()], [ $make_link = array()])

generates the contents of a html file that gives an overview of all the files in the zip file. This is to know the information of the files that are inside the zip file (who send it, the comment, ...)



Tags:

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


Parameters

   $files  
   $dont_show_columns  
   $make_link  
[ Top ]



getLoginFromId [line 656]

void getLoginFromId( $id)

returns loginname or false if user isn't registered anymore



Tags:

todo:  check if this function is still necessary. There might be a library function for this.


Parameters

   $id  
[ Top ]



getUserNameFromId [line 634]

void getUserNameFromId( $id)

returns username or false if user isn't registered anymore



Tags:

todo:  check if this function is still necessary. There might be a library function for this.


Parameters

   $id  
[ Top ]



getUserOwningThisMailing [line 718]

void getUserOwningThisMailing( $mailingPseudoId, [ $owner = 0], [ $or_die = ''])

RH: Mailing (2 new functions)

Mailing zip-file is posted to (dest_user_id = ) mailing pseudo_id and is only visible to its uploader (user_id).

Mailing content files have uploader_id == mailing pseudo_id, a normal recipient, and are visible initially to recipient and pseudo_id.




Tags:

author:  Ren� Haentjens, Ghent University
todo:  check if this function is still necessary.


Parameters

   $mailingPseudoId  
   $owner  
   $or_die  
[ Top ]



get_dropbox_categories [line 305]

array get_dropbox_categories( [$filter $filter = ''])

This function retrieves all the dropbox categories and returns them as an array



Tags:

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


Parameters

$filter   $filter   default '', when we need only the categories of the sent or the received part.
[ Top ]



get_last_tool_access [line 1438]

string get_last_tool_access( $tool $tool, [$course_code $course_code = ''], [$user_id $user_id = ''])

Get the last access to a given tool of a given user



Tags:

return:  last tool access date
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
version:  march 2006
todo:  consider moving this function to a more appropriate place.


Parameters

$tool   $tool   string the tool constant
$course_code   $course_code   the course_id
$user_id   $user_id   the id of the user
[ Top ]



get_total_number_feedback [line 1390]

void get_total_number_feedback( [ $file_id = ''])

This function retrieves the number of feedback messages on every document. This function might become obsolete when the feedback becomes user individual.



Tags:

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


Parameters

   $file_id  
[ Top ]



handle_multiple_actions [line 38]

void handle_multiple_actions( )

This function is a wrapper function for the multiple actions feature.



Tags:

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


[ Top ]



isCourseMember [line 672]

boolean isCourseMember( $user_id)



Tags:

return:  indicating if user with user_id=$user_id is a course member
todo:  eliminate global
todo:  check if this function is still necessary. There might be a library function for this.


Parameters

   $user_id  
[ Top ]



my_pre_add_callback [line 1194]

void my_pre_add_callback( $p_event $p_event, $p_header &$p_header)

This is a callback function to decrypt the files in the zip file to their normal filename (as stored in the database)



Tags:

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


Parameters

$p_event   $p_event   a variable of PCLZip
$p_header   &$p_header   a variable of PCLZip
[ Top ]



removeMoreIfMailing [line 739]

void removeMoreIfMailing( $file_id)



Tags:

author:  Ren� Haentjens, Ghent University
todo:  check if this function is still necessary.


Parameters

   $file_id  
[ Top ]



removeUnusedFiles [line 684]

void removeUnusedFiles( )

Checks if there are files in the dropbox_file table that aren't used anymore in dropbox_person table.

If there are, all entries concerning the file are deleted from the db + the file is deleted from the server




[ Top ]



store_addcategory [line 342]

void store_addcategory( )

This functions stores a new dropboxcategory



Tags:

var:  might not seem very elegant if you create a category in sent and in received with the same name that you get two entries in the dropbox_category table but it is the easiest solution. You get cat_name | received | sent | user_id test | 1 | 0 | 237 test | 0 | 1 | 237 more elegant would be test | 1 | 1 | 237
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
version:  march 2006


[ Top ]



store_add_dropbox [line 797]

void store_add_dropbox( )



[ Top ]



store_feedback [line 1086]

a store_feedback( )



Tags:

return:  language string (depending on the success or failure.
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
version:  march 2006


[ Top ]



store_move [line 205]

language store_move( $id $id, $target $target, $part $part)

This function moves a file to a different category



Tags:

return:  string
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
version:  march 2006


Parameters

$id   $id   the id of the file we are moving
$target   $target   the id of the folder we are moving to
$part   $part   are we moving a received file or a sent file?
[ Top ]



zip_download [line 1119]

void zip_download( $array $array)

This function downloads all the files of the inputarray into one zip



Tags:

author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
version:  march 2006
todo:  integrate some cleanup function that removes zip files that are older than 2 days
todo:  consider removing the check if the user has received or sent this file (zip download of a folder already sufficiently checks for this).


Parameters

$array   $array   an array containing all the ids of the files that have to be downloaded.
[ Top ]



zip_download_alternative [line 1215]

void zip_download_alternative( $files $files)

This function is an alternative zip download. It was added because PCLZip causes problems on PHP5 when using PCLZIP_CB_PRE_ADD and a callback function to rename

the files inside the zip file (dropbox scrambles the files to prevent




Tags:

author:  Patrick Cool <patrick.cool@UGent.be>, Ghent University
version:  march 2006
todo:  consider using a htaccess that denies direct access to the file but only allows the php file to access it. This would remove the scrambling requirement but it would require additional checks to see if the filename of the uploaded file is not used yet.
todo:  when we copy the files there might be two files with the same name. We need a function that (recursively) checks this and changes the name


Parameters

$files   $files   is an associative array that contains the files that the user wants to download (check to see if the user is allowed to download these files already happened so the array is clean!!. The key is the filename on the filesystem. The value is an array that contains both the filename on the filesystem and the original filename (that will be used in the zip file)
[ Top ]



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