Stud.IP  2.0 Revision 48548
 All Data Structures Namespaces Files Functions Variables Pages
datei.inc.php File Reference

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

Function Documentation

check_protected_download (   $document_id)

checks if the 'protected' flag of a file is set and if the course access is closed

Parameters
stringMD5 id of the file
Returns
bool

Here is the call graph for this function:

Here is the caller graph for this function:

copy_doc (   $doc_id,
  $new_range,
  $new_sem = false 
)

Here is the call graph for this function:

Here is the caller graph for this function:

copy_folder (   $folder_id,
  $new_range,
  $seed = false 
)

Here is the call graph for this function:

Here is the caller graph for this function:

copy_item (   $item_id,
  $new_parent,
  $change_sem_to = false 
)

Here is the call graph for this function:

create_folder (   $name,
  $description,
  $parent_id,
  $permission = 7 
)

Here is the call graph for this function:

Here is the caller graph for this function:

create_zip_from_directory (   $fullpath,
  $zip_file_name 
)

Here is the caller graph for this function:

create_zip_from_file (   $file_name,
  $zip_file_name 
)
create_zip_from_newest_files ( )

Here is the call graph for this function:

createFolderZip (   $folder_id,
  $perm_check = TRUE,
  $size_check = false 
)

creates a zip file from all files in given folder, including subfolders

Parameters
string$folder_idid of document folder
bool$perm_checkif true, files are checked for folder permissions
bool$size_checkif true, number and size of files are checked against config values
Returns
string filename(id) of the created zip without path

Here is the call graph for this function:

createSelectedZip (   $file_ids,
  $perm_check = TRUE,
  $size_check = false 
)

creates a zip file from given ids in tmp directory

Parameters
array$file_idsarray of document ids
bool$perm_checkif true, files are checked for folder permissions
bool$size_checkif true, number and size of files are checked against config values
Returns
string filename(id) of the created zip without path

Here is the call graph for this function:

createTempFolder (   $folder_id,
  $tmp_full_path,
  $perm_check = TRUE 
)

used by createFolderZip() to dive into subfolders

Parameters
string$folder_idid of a folder
string$tmp_full_pathtemporary path
bool$perm_checkif true, files are checked for folder permissions
Returns
bool

Here is the call graph for this function:

Here is the caller graph for this function:

delete_all_documents (   $range_id)

Here is the call graph for this function:

Here is the caller graph for this function:

delete_document (   $dokument_id,
  $delete_only_file = FALSE 
)

Here is the call graph for this function:

Here is the caller graph for this function:

delete_folder (   $folder_id,
  $delete_subfolders = false 
)

Here is the call graph for this function:

delete_link (   $dokument_id)

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

doc_challenge (   $parent_id)

Here is the call graph for this function:

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

Parameters
$parent_ida folder id
$range_idthe range id for the folder, course or institute id
Returns
integer

Here is the call graph for this function:

Here is the caller graph for this function:

doc_newest (   $parent_id)

Here is the call graph for this function:

Here is the caller graph for this function:

doc_sum_filesize (   $parent_id)

Here is the call graph for this function:

Here is the caller graph for this function:

edit_item (   $item_id,
  $type,
  $name,
  $description,
  $protected = 0,
  $url = "",
  $filesize = "" 
)

Here is the call graph for this function:

Here is the caller graph for this function:

form (   $refresh = FALSE)

Here is the call graph for this function:

Here is the caller graph for this function:

get_flash_player (   $document_id,
  $filename,
  $type 
)

Here is the call graph for this function:

Here is the caller graph for this function:

get_mime_type (   $filename)

Determines an appropriate MIME type for a file based on the extension of the file name.

Parameters
string$filenamefile name to check

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
stringMD5 id of the uploaded file

Here is the caller graph for this function:

get_user_documents_in_folder (   $folder_id,
  $user_id 
)

Here is the caller graph for this function:

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')

Parameters
string$file_id
string$file_name
integer$typesendfile type 1,2,3,4,5 or 6
string$dltype'normal', 'zip' or 'force' (or 'force_download')
Returns
string downloadlink

Here is the call graph for this function:

Here is the caller graph for this function:

getFileExtension (   $str)

Here is the caller graph for this function:

GetFileIcon (   $ext,
  $with_img_tag = false 
)

Here is the caller graph for this function:

getFolderChildren (   $folder_id)

Returns the read- and executable subfolders to a given folder_id : id of the target folder

Returns
: array($subfolders, $numberofsubfolders)

Here is the call graph for this function:

Here is the caller graph for this function:

getFolderId (   $parent_id,
  $in_recursion = false 
)

Here is the call graph for this function:

Here is the caller graph for this function:

getLinkPath (   $file_id)

Here is the caller graph for this function:

insert_entry_db (   $range_id,
  $sem_id = 0,
  $refresh = FALSE 
)

Here is the call graph for this function:

Here is the caller graph for this function:

insert_link_db (   $range_id,
  $the_file_size,
  $refresh = FALSE 
)

Here is the call graph for this function:

Here is the caller graph for this function:

JS_for_upload ( )

Here is the call graph for this function:

link_form (   $range_id,
  $updating = FALSE 
)

Here is the call graph for this function:

Here is the caller graph for this function:

link_item (   $range_id,
  $create = FALSE,
  $echo = FALSE,
  $refresh = FALSE,
  $link_update = FALSE 
)

Here is the call graph for this function:

Here is the caller graph for this function:

move_item (   $item_id,
  $new_parent,
  $change_sem_to = false 
)

Here is the call graph for this function:

Here is the caller graph for this function:

parse_header (   $header)

Here is the caller graph for this function:

parse_link (   $link,
  $level = 0 
)

Here is the call graph for this function:

Here is the caller graph for this function:

pclzip_convert_filename_cb (   $p_event,
$p_header 
)
prepareFilename (   $filename,
  $shorten = FALSE 
)

Here is the call graph for this function:

Here is the caller graph for this function:

if ($GLOBALS['ZIP_USE_INTERNAL']) readfile_chunked (   $filename)
recursiv_folder_delete (   $parent_id)

Here is the call graph for this function:

Here is the caller graph for this function:

rmdirr (   $dirname)

Delete a file, or a folder and its contents

Author
Aidan Lister aidan.nosp@m.@php.nosp@m..net
Version
1.0
Parameters
string$dirnameThe directory to delete
Returns
bool Returns true on success, false on failure

Here is the caller graph for this function:

unzip_file (   $file_name,
  $dir_name = '',
  $testonly = false 
)

Here is the caller graph for this function:

upload (   $the_file,
  $refresh = false 
)

Here is the call graph for this function:

Here is the caller graph for this function:

upload_item (   $range_id,
  $create = FALSE,
  $echo = FALSE,
  $refresh = FALSE 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
range_idDie ID des Ordners unter dem die Verzeichnisstruktur
dir
Returns
(no return value)

Here is the call graph for this function:

Here is the caller graph for this function:

upload_zip_file (   $dir_id,
  $file 
)

Eine einzelne Datei in das Verzeichnis mit der dir_id einfuegen.

Here is the call graph for this function:

Here is the caller graph for this function:

upload_zip_item ( )

Here is the call graph for this function:

validate_upload (   $the_file,
  $real_file_name = '' 
)

Checks whether a given file upload is valid and allowed.

Parameters
$the_filefile to upload to Stud.IP
$real_file_namean optional real file name for handling files inside a ZIP (otherwise, the filename of the ZIP itself would always be used)
Returns
Can the given file be uploaded to Stud.IP?

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

$countfiles = 0
$countfolder = 0
$droppable_folder = 0