TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
OnlineMediaController Class Reference

Public Member Functions

 createAction (ServerRequestInterface $request, ResponseInterface $response)
 
 mainAction (ServerRequestInterface $request, ResponseInterface $response)
 

Protected Member Functions

 addMediaFromUrl ($url, $targetFolderIdentifier, array $allowedExtensions=[])
 
 getBackendUser ()
 
 getLanguageService ()
 

Detailed Description

Class OnlineMediaController handles uploading online media

Definition at line 30 of file OnlineMediaController.php.

Member Function Documentation

addMediaFromUrl (   $url,
  $targetFolderIdentifier,
array  $allowedExtensions = [] 
)
protected
Parameters
string$url
string$targetFolderIdentifier
string[]$allowedExtensions
Returns
File|NULL

Definition at line 115 of file OnlineMediaController.php.

References OnlineMediaController\getBackendUser(), OnlineMediaHelperRegistry\getInstance(), and ResourceFactory\getInstance().

Referenced by OnlineMediaController\createAction(), and OnlineMediaController\mainAction().

createAction ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

AJAX endpoint for storing the URL as a sys_file record

Parameters
ServerRequestInterface$request
ResponseInterface$response
Returns
ResponseInterface

Definition at line 39 of file OnlineMediaController.php.

References OnlineMediaController\addMediaFromUrl(), OnlineMediaController\getLanguageService(), and GeneralUtility\trimExplode().

getBackendUser ( )
protected
Returns

Definition at line 150 of file OnlineMediaController.php.

References $GLOBALS.

Referenced by OnlineMediaController\addMediaFromUrl().

getLanguageService ( )
protected
Returns
LanguageService

Definition at line 158 of file OnlineMediaController.php.

References $GLOBALS.

Referenced by OnlineMediaController\createAction(), and OnlineMediaController\mainAction().

mainAction ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

Process add media request

Parameters
ServerRequestInterface$request
ResponseInterface$response
Returns
ResponseInterface

Definition at line 65 of file OnlineMediaController.php.

References OnlineMediaController\addMediaFromUrl(), AbstractMessage\ERROR, OnlineMediaController\getLanguageService(), GeneralUtility\locationHeaderUrl(), GeneralUtility\makeInstance(), AbstractMessage\OK, GeneralUtility\sanitizeLocalUrl(), and GeneralUtility\trimExplode().