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:
Parameters
| |
$file_name_2_check |
|
| |
$counter |
|
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:
Parameters
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:
delete_category [line 122]
void delete_category(
$action, $id)
|
|
This function deletes a dropbox category
Tags:
Parameters
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:
Parameters
| |
$part |
|
| |
$categories |
|
| |
$current_category |
|
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:
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. |
display_add_form [line 480]
this function displays the form to upload a new item to the dropbox.
Tags:
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:
Parameters
| $id |
$id |
the unique id of the file |
| $part |
$part |
are we dealing with a sent or with a received file? |
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:
Parameters
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:
Parameters
dropbox_cnf [line 785]
void dropbox_cnf(
$variable)
|
|
Function that finds a given config setting
Tags:
Parameters
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:
Parameters
feedback [line 1022]
void feedback(
an $array)
|
|
this function transforms the array containing all the feedback into something visually attractive.
Tags:
Parameters
| an |
$array |
array containing all the feedback about the given message. |
feedback_form [line 1058]
this function returns the code for the form for adding a new feedback message to a dropbox file.
Tags:
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:
Parameters
| $feedback_array |
$feedback |
an array that contains all the feedback messages about the given document. |
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:
Parameters
| |
$files |
|
| |
$dont_show_columns |
|
| |
$make_link |
|
getLoginFromId [line 656]
void getLoginFromId(
$id)
|
|
returns loginname or false if user isn't registered anymore
Tags:
Parameters
getUserNameFromId [line 634]
void getUserNameFromId(
$id)
|
|
returns username or false if user isn't registered anymore
Tags:
Parameters
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:
Parameters
| |
$mailingPseudoId |
|
| |
$owner |
|
| |
$or_die |
|
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:
Parameters
| $filter |
$filter |
default '', when we need only the categories of the sent or the received part. |
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:
Parameters
| $tool |
$tool |
string the tool constant |
| $course_code |
$course_code |
the course_id |
| $user_id |
$user_id |
the id of the user |
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:
Parameters
handle_multiple_actions [line 38]
void handle_multiple_actions(
)
|
|
This function is a wrapper function for the multiple actions feature.
Tags:
isCourseMember [line 672]
boolean isCourseMember(
$user_id)
|
|
Tags:
Parameters
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:
Parameters
| $p_event |
$p_event |
a variable of PCLZip |
| $p_header |
&$p_header |
a variable of PCLZip |
removeMoreIfMailing [line 739]
void removeMoreIfMailing(
$file_id)
|
|
Tags:
Parameters
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
store_addcategory [line 342]
void store_addcategory(
)
|
|
This functions stores a new dropboxcategory
Tags:
store_add_dropbox [line 797]
void store_add_dropbox(
)
|
|
store_feedback [line 1086]
store_move [line 205]
language store_move(
$id $id, $target $target, $part $part)
|
|
This function moves a file to a different category
Tags:
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? |
zip_download [line 1119]
void zip_download(
$array $array)
|
|
This function downloads all the files of the inputarray into one zip
Tags:
Parameters
| $array |
$array |
an array containing all the ids of the files that have to be downloaded. |
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:
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) |
|