Stud.IP
2.0 Revision 48548
|
Functions | |
if($GLOBALS['ZIP_USE_INTERNAL']) | readfile_chunked ($filename) |
parse_header ($header) | |
parse_link ($link, $level=0) | |
createSelectedZip ($file_ids, $perm_check=TRUE, $size_check=false) | |
createFolderZip ($folder_id, $perm_check=TRUE, $size_check=false) | |
createTempFolder ($folder_id, $tmp_full_path, $perm_check=TRUE) | |
getFolderChildren ($folder_id) | |
getFolderId ($parent_id, $in_recursion=false) | |
doc_count ($parent_id, $range_id=null) | |
doc_sum_filesize ($parent_id) | |
doc_newest ($parent_id) | |
doc_challenge ($parent_id) | |
get_user_documents_in_folder ($folder_id, $user_id) | |
move_item ($item_id, $new_parent, $change_sem_to=false) | |
copy_item ($item_id, $new_parent, $change_sem_to=false) | |
copy_doc ($doc_id, $new_range, $new_sem=false) | |
copy_folder ($folder_id, $new_range, $seed=false) | |
edit_item ($item_id, $type, $name, $description, $protected=0, $url="", $filesize="") | |
create_folder ($name, $description, $parent_id, $permission=7) | |
form ($refresh=FALSE) | |
prepareFilename ($filename, $shorten=FALSE) | |
getFileExtension ($str) | |
validate_upload ($the_file, $real_file_name='') | |
upload ($the_file, $refresh=false) | |
insert_entry_db ($range_id, $sem_id=0, $refresh=FALSE) | |
JS_for_upload () | |
upload_item ($range_id, $create=FALSE, $echo=FALSE, $refresh=FALSE) | |
insert_link_db ($range_id, $the_file_size, $refresh=FALSE) | |
link_item ($range_id, $create=FALSE, $echo=FALSE, $refresh=FALSE, $link_update=FALSE) | |
link_form ($range_id, $updating=FALSE) | |
display_file_body ($datei, $folder_id, $open, $change, $move, $upload, $all, $refresh=FALSE, $filelink="") | |
display_file_line ($datei, $folder_id, $open, $change, $move, $upload, $all, $refresh=FALSE, $filelink="", $anchor_id, $position="middle") | |
display_folder_body ($folder_id, $open, $change, $move, $upload, $refresh=FALSE, $filelink="", $anchor_id) | |
display_folder ($folder_id, $open, $change, $move, $upload, $refresh=FALSE, $filelink="", $anchor_id, $position="middle", $isissuefolder=false) | |
getLinkPath ($file_id) | |
GetFileIcon ($ext, $with_img_tag=false) | |
get_mime_type ($filename) | |
GetDownloadLink ($file_id, $file_name, $type=0, $dltype= 'normal', $range_id= '', $list_id= '') | |
delete_document ($dokument_id, $delete_only_file=FALSE) | |
delete_link ($dokument_id) | |
delete_folder ($folder_id, $delete_subfolders=false) | |
recursiv_folder_delete ($parent_id) | |
delete_all_documents ($range_id) | |
rmdirr ($dirname) | |
create_zip_from_file ($file_name, $zip_file_name) | |
create_zip_from_directory ($fullpath, $zip_file_name) | |
create_zip_from_newest_files () | |
unzip_file ($file_name, $dir_name= '', $testonly=false) | |
upload_zip_item () | |
upload_recursively ($range_id, $dir) | |
upload_zip_file ($dir_id, $file) | |
pclzip_convert_filename_cb ($p_event, &$p_header) | |
get_flash_player ($document_id, $filename, $type) | |
get_upload_file_path ($document_id) | |
check_protected_download ($document_id) |
Variables | |
$countfiles = 0 | |
$countfolder = 0 | |
$droppable_folder = 0 |
check_protected_download | ( | $document_id | ) |
checks if the 'protected' flag of a file is set and if the course access is closed
string | MD5 id of the file |
copy_doc | ( | $doc_id, | |
$new_range, | |||
$new_sem = false |
|||
) |
copy_folder | ( | $folder_id, | |
$new_range, | |||
$seed = false |
|||
) |
copy_item | ( | $item_id, | |
$new_parent, | |||
$change_sem_to = false |
|||
) |
create_folder | ( | $name, | |
$description, | |||
$parent_id, | |||
$permission = 7 |
|||
) |
create_zip_from_directory | ( | $fullpath, | |
$zip_file_name | |||
) |
create_zip_from_file | ( | $file_name, | |
$zip_file_name | |||
) |
create_zip_from_newest_files | ( | ) |
createFolderZip | ( | $folder_id, | |
$perm_check = TRUE , |
|||
$size_check = false |
|||
) |
creates a zip file from all files in given folder, including subfolders
string | $folder_id | id of document folder |
bool | $perm_check | if true, files are checked for folder permissions |
bool | $size_check | if true, number and size of files are checked against config values |
createSelectedZip | ( | $file_ids, | |
$perm_check = TRUE , |
|||
$size_check = false |
|||
) |
creates a zip file from given ids in tmp directory
array | $file_ids | array of document ids |
bool | $perm_check | if true, files are checked for folder permissions |
bool | $size_check | if true, number and size of files are checked against config values |
createTempFolder | ( | $folder_id, | |
$tmp_full_path, | |||
$perm_check = TRUE |
|||
) |
used by createFolderZip() to dive into subfolders
string | $folder_id | id of a folder |
string | $tmp_full_path | temporary path |
bool | $perm_check | if true, files are checked for folder permissions |
delete_all_documents | ( | $range_id | ) |
delete_document | ( | $dokument_id, | |
$delete_only_file = FALSE |
|||
) |
delete_folder | ( | $folder_id, | |
$delete_subfolders = false |
|||
) |
delete_link | ( | $dokument_id | ) |
display_file_body | ( | $datei, | |
$folder_id, | |||
$open, | |||
$change, | |||
$move, | |||
$upload, | |||
$all, | |||
$refresh = FALSE , |
|||
$filelink = "" |
|||
) |
Displays the body of a file containing the decription, downloadbuttons and change-forms
display_file_line | ( | $datei, | |
$folder_id, | |||
$open, | |||
$change, | |||
$move, | |||
$upload, | |||
$all, | |||
$refresh = FALSE , |
|||
$filelink = "" , |
|||
$anchor_id, | |||
$position = "middle" |
|||
) |
Displays one file/document with all of its information and options.
display_folder | ( | $folder_id, | |
$open, | |||
$change, | |||
$move, | |||
$upload, | |||
$refresh = FALSE , |
|||
$filelink = "" , |
|||
$anchor_id, | |||
$position = "middle" , |
|||
$isissuefolder = false |
|||
) |
Displays the folder and all of its documents and recursively subfolders. This function is not dependent on the recursive-level so it looks as if it all starts from here.
display_folder_body | ( | $folder_id, | |
$open, | |||
$change, | |||
$move, | |||
$upload, | |||
$refresh = FALSE , |
|||
$filelink = "" , |
|||
$anchor_id | |||
) |
Displays the body of a folder including the description, changeform, subfolder and files
doc_challenge | ( | $parent_id | ) |
doc_count | ( | $parent_id, | |
$range_id = null |
|||
) |
Counts and returns the number files in the given folder and subfolders. Files not visible to the current user are not counted
$parent_id | a folder id |
$range_id | the range id for the folder, course or institute id |
doc_newest | ( | $parent_id | ) |
doc_sum_filesize | ( | $parent_id | ) |
edit_item | ( | $item_id, | |
$type, | |||
$name, | |||
$description, | |||
$protected = 0 , |
|||
$url = "" , |
|||
$filesize = "" |
|||
) |
form | ( | $refresh = FALSE | ) |
get_flash_player | ( | $document_id, | |
$filename, | |||
$type | |||
) |
get_mime_type | ( | $filename | ) |
Determines an appropriate MIME type for a file based on the extension of the file name.
string | $filename | file name to check |
get_upload_file_path | ( | $document_id | ) |
Return the absolute path of an uploaded file. The uploaded files are organized in sub-folders of UPLOAD_PATH to avoid performance problems with large directories. If the document_id is empty, NULL is returned.
string | MD5 id of the uploaded file |
get_user_documents_in_folder | ( | $folder_id, | |
$user_id | |||
) |
GetDownloadLink | ( | $file_id, | |
$file_name, | |||
$type = 0 , |
|||
$dltype = 'normal' , |
|||
$range_id = '' , |
|||
$list_id = '' |
|||
) |
Erzeugt einen Downloadlink abhaengig von der Konfiguration des Systems ($GLOBALS['SENDFILE_LINK_MODE'] = 'normal'|'old'|'rewrite')
string | $file_id | |
string | $file_name | |
integer | $type | sendfile type 1,2,3,4,5 or 6 |
string | $dltype | 'normal', 'zip' or 'force' (or 'force_download') |
getFileExtension | ( | $str | ) |
GetFileIcon | ( | $ext, | |
$with_img_tag = false |
|||
) |
getFolderChildren | ( | $folder_id | ) |
Returns the read- and executable subfolders to a given folder_id : id of the target folder
getFolderId | ( | $parent_id, | |
$in_recursion = false |
|||
) |
getLinkPath | ( | $file_id | ) |
insert_entry_db | ( | $range_id, | |
$sem_id = 0 , |
|||
$refresh = FALSE |
|||
) |
insert_link_db | ( | $range_id, | |
$the_file_size, | |||
$refresh = FALSE |
|||
) |
JS_for_upload | ( | ) |
link_form | ( | $range_id, | |
$updating = FALSE |
|||
) |
link_item | ( | $range_id, | |
$create = FALSE , |
|||
$echo = FALSE , |
|||
$refresh = FALSE , |
|||
$link_update = FALSE |
|||
) |
move_item | ( | $item_id, | |
$new_parent, | |||
$change_sem_to = false |
|||
) |
parse_header | ( | $header | ) |
parse_link | ( | $link, | |
$level = 0 |
|||
) |
pclzip_convert_filename_cb | ( | $p_event, | |
& | $p_header | ||
) |
prepareFilename | ( | $filename, | |
$shorten = FALSE |
|||
) |
if ($GLOBALS['ZIP_USE_INTERNAL']) readfile_chunked | ( | $filename | ) |
recursiv_folder_delete | ( | $parent_id | ) |
rmdirr | ( | $dirname | ) |
Delete a file, or a folder and its contents
string | $dirname | The directory to delete |
unzip_file | ( | $file_name, | |
$dir_name = '' , |
|||
$testonly = false |
|||
) |
upload | ( | $the_file, | |
$refresh = false |
|||
) |
upload_item | ( | $range_id, | |
$create = FALSE , |
|||
$echo = FALSE , |
|||
$refresh = FALSE |
|||
) |
upload_recursively | ( | $range_id, | |
$dir | |||
) |
Laedt eine bestehende Verzeichnisstruktur in das System. Die ganze Struktur wird samt Dateien und Unterverzeichnissen rekursiv eingefuegt: 1. Den aktuellen Ordner erstellen. – 2. Die Dateien in alphabetischer Reihenfolge einfuegen. – 3. Die Verzeichnisstruktur jedes Unterordners einfuegen (Rekursion). Nach Einfuegen einer Datei / eines Verzeichnisses wird die Datei oder das Verzeichnis geloescht.
range_id | Die ID des Ordners unter dem die Verzeichnisstruktur |
dir |
upload_zip_file | ( | $dir_id, | |
$file | |||
) |
Eine einzelne Datei in das Verzeichnis mit der dir_id einfuegen.
upload_zip_item | ( | ) |
validate_upload | ( | $the_file, | |
$real_file_name = '' |
|||
) |
Checks whether a given file upload is valid and allowed.
$the_file | file to upload to Stud.IP |
$real_file_name | an optional real file name for handling files inside a ZIP (otherwise, the filename of the ZIP itself would always be used) |
$countfiles = 0 |
$countfolder = 0 |
$droppable_folder = 0 |