This is an old revision of the document!
Table of Contents
DownloadAdminController
Layer: Controller · Source: lib/controller/DownloadAdminController.php:25 (lines 25–356)
class DownloadAdminController extends BaseApp
Handle admin download management
Docblock Metadata
^ Tag ^ Value ^ | ''@category'' | Controller Class | | ''@author'' | M.Noermoehammad | | ''@license'' | MIT | | ''@version'' | 1.0 | | ''@since'' | Since Release 1.0 |
Inheritance
^ Relation ^ Type ^ Meaning ^ | extends | [[scriptlog:lib:core:baseapp|''BaseApp'']] | parent class/interface |
Constants (0)
None.
Properties (0)
None declared.
Methods (22)
^ Visibility ^ Method ^ Summary ^ Line ^ | public | ''__construct()'' | (undocumented) | 30 | | public | ''listItems()'' | List all downloads - displays download management page | 38 | | public | ''viewStatistics()'' | View download statistics | 114 | | public | ''viewDownloadHistory()'' | View download history | 124 | | public | ''getDownloadHistoryForMedia()'' | Get download history for AJAX | 135 | | public | ''expireDownload()'' | Expire a single download | 146 | | public | ''regenerateDownload()'' | Regenerate a single download | 157 | | public | ''deleteDownload()'' | Delete a single download | 168 | | public | ''bulkExpireDownloads()'' | Bulk expire downloads | 178 | | public | ''bulkRegenerateDownloads()'' | Bulk regenerate downloads | 194 | | public | ''bulkDeleteDownloads()'' | Bulk delete downloads | 210 | | public | ''createDownloadLink()'' | Create a new download link for a media file | 228 | | public | ''bulkCreateDownloadLinks()'' | Bulk create download links for media IDs | 239 | | private | ''getIdentifiersFromPost()'' | Get identifiers from POST data | 256 | | public | ''getRecentDownloads()'' | Get recent downloads | 273 | | public | ''getFileTypeDistribution()'' | Get file type distribution | 283 | | public | ''getDownloadHistory()'' | Get download history | 294 | | public | ''viewDownloadHistoryPage()'' | Render download history page | 307 | | protected | ''setView()'' | Set view for rendering | 324 | | protected | ''insert()'' | Insert - not implemented for downloads | 332 | | protected | ''update()'' | Update - not implemented for downloads | 342 | | protected | ''remove()'' | Remove - not implemented for downloads | 352 |
__construct()
public function __construct(DownloadService $downloadService)
lines 30–33 (4)
^ Parameter ^ Type ^ Default ^ Description ^ | ''$downloadService'' | [[scriptlog:lib:service:downloadservice|''DownloadService'']] | //required// | //none// |
listItems()
public function listItems()
lines 38–109 (72)
List all downloads - displays download management page
Takes no parameters.
Returns: (none declared)
viewStatistics()
public function viewStatistics()
lines 114–117 (4)
View download statistics
Takes no parameters.
Returns: (none declared)
viewDownloadHistory()
public function viewDownloadHistory($mediaId)
lines 124–127 (4)
View download history
^ Parameter ^ Type ^ Default ^ Description ^ | ''$mediaId'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared)
getDownloadHistoryForMedia()
public function getDownloadHistoryForMedia($mediaId)
lines 135–138 (4)
Get download history for AJAX
^ Parameter ^ Type ^ Default ^ Description ^ | ''$mediaId'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared) — array
expireDownload()
public function expireDownload($identifier)
lines 146–149 (4)
Expire a single download
^ Parameter ^ Type ^ Default ^ Description ^ | ''$identifier'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared) — bool
regenerateDownload()
public function regenerateDownload($identifier)
lines 157–160 (4)
Regenerate a single download
^ Parameter ^ Type ^ Default ^ Description ^ | ''$identifier'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared) — string|false
deleteDownload()
public function deleteDownload($identifier)
lines 168–171 (4)
Delete a single download
^ Parameter ^ Type ^ Default ^ Description ^ | ''$identifier'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared) — bool
bulkExpireDownloads()
public function bulkExpireDownloads()
lines 178–187 (10)
Bulk expire downloads
Takes no parameters.
Returns: (none declared) — bool
bulkRegenerateDownloads()
public function bulkRegenerateDownloads()
lines 194–203 (10)
Bulk regenerate downloads
Takes no parameters.
Returns: (none declared) — bool
bulkDeleteDownloads()
public function bulkDeleteDownloads()
lines 210–219 (10)
Bulk delete downloads
Takes no parameters.
Returns: (none declared) — bool
createDownloadLink()
public function createDownloadLink($mediaId, $ipAddress = '')
lines 228–231 (4)
Create a new download link for a media file
^ Parameter ^ Type ^ Default ^ Description ^ | ''$mediaId'' | ''(untyped)'' | //required// | //none// | | ''$ipAddress'' | ''(untyped)'' | '''''' | //none// |
Returns: (none declared) — string|false New identifier or false
bulkCreateDownloadLinks()
public function bulkCreateDownloadLinks($mediaIds)
lines 239–249 (11)
Bulk create download links for media IDs
^ Parameter ^ Type ^ Default ^ Description ^ | ''$mediaIds'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared) — bool
getIdentifiersFromPost()
private function getIdentifiersFromPost()
lines 256–265 (10)
Get identifiers from POST data
Takes no parameters.
Returns: (none declared) — array
getRecentDownloads()
public function getRecentDownloads($limit = 10)
lines 273–276 (4)
Get recent downloads
^ Parameter ^ Type ^ Default ^ Description ^ | ''$limit'' | ''(untyped)'' | ''10'' | //none// |
Returns: (none declared) — array
getFileTypeDistribution()
public function getFileTypeDistribution()
lines 283–286 (4)
Get file type distribution
Takes no parameters.
Returns: (none declared) — array
getDownloadHistory()
public function getDownloadHistory($limit = 50)
lines 294–297 (4)
Get download history
^ Parameter ^ Type ^ Default ^ Description ^ | ''$limit'' | ''(untyped)'' | ''50'' | //none// |
Returns: (none declared) — array
viewDownloadHistoryPage()
public function viewDownloadHistoryPage($mediaId, $mediaFilename, $history)
lines 307–317 (11)
Render download history page
^ Parameter ^ Type ^ Default ^ Description ^ | ''$mediaId'' | ''(untyped)'' | //required// | //none// | | ''$mediaFilename'' | ''(untyped)'' | //required// | //none// | | ''$history'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared) — void
setView()
protected function setView($viewName)
lines 324–327 (4)
Set view for rendering
^ Parameter ^ Type ^ Default ^ Description ^ | ''$viewName'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared)
insert()
protected function insert()
lines 332–335 (4)
Insert - not implemented for downloads
Takes no parameters.
Returns: (none declared)
update()
protected function update($id)
lines 342–345 (4)
Update - not implemented for downloads
^ Parameter ^ Type ^ Default ^ Description ^ | ''$id'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared)
remove()
protected function remove($id)
lines 352–355 (4)
Remove - not implemented for downloads
^ Parameter ^ Type ^ Default ^ Description ^ | ''$id'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared)
Imports
^ Alias ^ Fully-qualified name ^ | ''BaseApp'' | [[scriptlog:lib:core:baseapp|''Scriptlog\Core\BaseApp'']] | | ''View'' | [[scriptlog:lib:core:view|''Scriptlog\Core\View'']] | | ''DownloadService'' | [[scriptlog:lib:service:downloadservice|''Scriptlog\Service\DownloadService'']] |
This page is generated from source by 'tools/gendoc'. Edits will be overwritten.
