Stud.IP  3.1 Revision 48552
 All Data Structures Namespaces Files Functions Variables Groups Pages
Document_DownloadController Class Reference
Inheritance diagram for Document_DownloadController:
Inheritance graph
Collaboration diagram for Document_DownloadController:
Collaboration graph

Public Member Functions

 __construct ($dispatcher)
 before_filter (&$action, &$args)
 index_action ($entry_id, $inline=false)
 after_filter ($action, $args)

Protected Member Functions

 download_file (DirectoryEntry $entry, $inline)
 download_files ($files, $filename= 'Stud-IP.zip')
 addToZip (&$zip, $entry, $path= '', &$remove=array())
 sanitizeFilename ($filename)
 initiateDownload ($inline, $filename, $mime_type, $size, $handle)

Protected Attributes

 $allow_nobody = true
 $download_handle = null
 $download_remove = null
- Protected Attributes inherited from AuthenticatedController
 $allow_nobody = false

Detailed Description

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 GPL2 or any later version
Since
3.1

Constructor & Destructor Documentation

__construct (   $dispatcher)

Overwritten constructor of the controller. Ensures no cid is present the request.

Parameters
Trails_Dispatcher$dispatcher

Here is the call graph for this function:

Member Function Documentation

addToZip ( $zip,
  $entry,
  $path = '',
$remove = array() 
)
protected

Adds a file or folder to the zip archive.

Parameters
ZipArchive$zipThe actual zip archive
mixed$entryDirectory entry or file to add
String$pathPath to add the entry to (for subdirs)
Array$removeSince 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

Here is the caller graph for this function:

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$actionAction that was executed
Array$argsArguments that were passed

Reimplemented from AuthenticatedController.

before_filter ( $action,
$args 
)

Before filter ensures index is the action to be called.

Parameters
String$actionAction to execute
Array$argsArguments passed for the action (might be empty)

Reimplemented from AuthenticatedController.

download_file ( DirectoryEntry  $entry,
  $inline 
)
protected

Downloads a single file.

Parameters
DirectoryEntry$entryDirectory entry to download
bool$inlineDownload as inline

Here is the call graph for this function:

Here is the caller graph for this function:

download_files (   $files,
  $filename = 'Stud-IP.zip' 
)
protected

Downloads a bunch of files as a zip archive.

Parameters
Array$filesDirectory entries or files to download
String$filenameFilename for the archive.

Here is the call graph for this function:

Here is the caller graph for this function:

index_action (   $entry_id,
  $inline = false 
)

Downloads a file, a folder or a bunch of either.

Parameters
String$entry_idDirectory entry id of the file or folder or 'flashed' for a bulk operation
bool$inlineIndicates whether the download should be marked as inline (to display the file in the browser)

Here is the call graph for this function:

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$inlineSend the file inline?
String$filenameTransmitted filename
String$mime_typeTransmitted mime type
int$sizeTransmitted file size
resource$handleUnderlying file resource handle
See Also
Document_DownloadController::after_filter

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the caller graph for this function:

Field Documentation

$allow_nobody = true
protected
$download_handle = null
protected
$download_remove = null
protected

The documentation for this class was generated from the following file: