[CORE] Added documentation and fixed typo in attachments action
This commit is contained in:
parent
ee8bac9ad7
commit
d295d8b43c
@ -205,6 +205,8 @@ class AttachmentAction extends ManagedAction
|
||||
* Include $filepath in the response, for viewing and downloading.
|
||||
* If provided, $filesize is used to size the HTTP request,
|
||||
* otherwise it's value is calculated
|
||||
* @param string $filepath the absolute path to the file to send
|
||||
* @param $filesize optional, calculated if unkown
|
||||
*/
|
||||
static function sendFile(string $filepath, $filesize) {
|
||||
if (is_string(common_config('site', 'x-static-delivery'))) {
|
||||
|
@ -21,7 +21,7 @@ class Attachment_downloadAction extends AttachmentAction
|
||||
$mimetype = $this->attachment->getFileOrThumbnailMimetype();
|
||||
|
||||
if (empty($filepath)) {
|
||||
$thiis->clientError(_('No such attachment'), 404);
|
||||
$this->clientError(_('No such attachment'), 404);
|
||||
}
|
||||
|
||||
$filename = MediaFile::getDisplayName($this->attachment);
|
||||
|
@ -53,6 +53,12 @@ class Attachment_thumbnailAction extends AttachmentAction
|
||||
$this->thumb_c = $this->boolean('c');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show an inline representation of an attachment of the size
|
||||
* requested in the GET variables (read in the constructor). Tries
|
||||
* to send the most appropriate file with the correct size and
|
||||
* headers or displays an error if it's not possible.
|
||||
*/
|
||||
public function showPage()
|
||||
{
|
||||
|
||||
|
@ -19,7 +19,7 @@ class Attachment_viewAction extends AttachmentAction
|
||||
$mimetype = $this->attachment->getFileOrThumbnailMimetype();
|
||||
|
||||
if (empty($filepath)) {
|
||||
$thiis->clientError(_('No such attachment'), 404);
|
||||
$this->clientError(_('No such attachment'), 404);
|
||||
}
|
||||
|
||||
$filename = MediaFile::getDisplayName($this->attachment);
|
||||
|
Loading…
Reference in New Issue
Block a user