download.php
Encapsules all download possibilites of the personal file area.
- Author
- Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m @license GPL2 or any later version
- Copyright
- Stud.IP Core-Group
- Since
- 3.1
◆ __construct()
| __construct |
( |
|
$dispatcher | ) |
|
Overwritten constructor of the controller. Ensures no cid is present the request.
- Parameters
-
◆ addToZip()
| addToZip |
( |
& |
$zip, |
|
|
|
$entry, |
|
|
|
$path = '', |
|
|
& |
$remove = array() |
|
) |
| |
|
protected |
Adds a file or folder to the zip archive.
- Parameters
-
| ZipArchive | $zip | The actual zip archive |
| mixed | $entry | Directory entry or file to add |
| String | $path | Path to add the entry to (for subdirs) |
| Array | $remove | Since files are copied to temp folder, this array will contain the names of the copied files so they can be removed after the archive has been sent |
◆ after_filter()
| after_filter |
( |
|
$action, |
|
|
|
$args |
|
) |
| |
After filter of the controller actually transmit the file contents and removes all files that were created or copied during the download process.
- Parameters
-
| String | $action | Action that was executed |
| Array | $args | Arguments that were passed |
Reimplemented from StudipController.
◆ before_filter()
| before_filter |
( |
& |
$action, |
|
|
& |
$args |
|
) |
| |
Before filter ensures index is the action to be called.
- Parameters
-
| String | $action | Action to execute |
| Array | $args | Arguments passed for the action (might be empty) |
Reimplemented from StudipController.
◆ download_file()
Downloads a single file.
- Parameters
-
| DirectoryEntry | $entry | Directory entry to download |
| bool | $inline | Download as inline |
◆ download_files()
| download_files |
( |
|
$files, |
|
|
|
$filename = 'Stud-IP.zip' |
|
) |
| |
|
protected |
Downloads a bunch of files as a zip archive.
- Parameters
-
| Array | $files | Directory entries or files to download |
| String | $filename | Filename for the archive. |
◆ index_action()
| index_action |
( |
|
$entry_id, |
|
|
|
$inline = false |
|
) |
| |
Downloads a file, a folder or a bunch of either.
- Parameters
-
| String | $entry_id | Directory entry id of the file or folder or 'flashed' for a bulk operation |
| bool | $inline | Indicates whether the download should be marked as inline (to display the file in the browser) |
◆ initiateDownload()
| initiateDownload |
( |
|
$inline, |
|
|
|
$filename, |
|
|
|
$mime_type, |
|
|
|
$size, |
|
|
|
$handle |
|
) |
| |
|
protected |
Initiates the download. Sets correct headers and prepares the download handle which will be used to transmit the file in the after filter.
- Parameters
-
| bool | $inline | Send the file inline? |
| String | $filename | Transmitted filename |
| String | $mime_type | Transmitted mime type |
| int | $size | Transmitted file size |
| resource | $handle | Underlying file resource handle |
- See also
- Document_DownloadController::after_filter
◆ sanitizeFilename()
| sanitizeFilename |
( |
|
$filename | ) |
|
|
protected |
Sanitizes a filename by translating all umlauts to ascii characters, compressing dashes and whitespace and removing all invalid characters.
- Parameters
-
| String | $filename | "Dirty" filename |
- Returns
- String Sanitized filename
◆ $allow_nobody
◆ $download_handle
◆ $download_remove
The documentation for this class was generated from the following file: