Stud.IP  jlu_3.3 Revision
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)
 
- Public Member Functions inherited from StudipController
 before_filter (&$action, &$args)
 
 perform ($unconsumed_path)
 
 after_filter ($action, $args)
 
 validate_args (&$args, $types=NULL)
 
 url_for ($to='')
 
 link_for ($to='')
 
 relocate ($to)
 
 rescue ($exception)
 
 setInfoBoxImage ($image)
 
 addToInfobox ($category, $text, $icon='blank.gif')
 
 render_json ($data)
 
 relay ($to_uri)
 
 perform_relayed ($unconsumed)
 
 render_template_as_string ($template, $layout=null)
 

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 Member Functions inherited from StudipController
 populateInfobox ()
 

Protected Attributes

 $allow_nobody = true
 
 $download_handle = null
 
 $download_remove = null
 
- Protected Attributes inherited from AuthenticatedController
 $with_session = true
 
 $allow_nobody = false
 
- Protected Attributes inherited from StudipController
 $with_session = false
 
 $allow_nobody = true
 
 $encoding = "windows-1252"
 
 $utf8decode_xhr = 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 @license GPL2 or any later version
Since
3.1

Constructor & Destructor Documentation

◆ __construct()

__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()

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 call graph for this function:
Here is the caller graph for this function:

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

Reimplemented from StudipController.

◆ before_filter()

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 StudipController.

◆ download_file()

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

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

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

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

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

$allow_nobody = true
protected

◆ $download_handle

$download_handle = null
protected

◆ $download_remove

$download_remove = null
protected

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