MediaController Class Reference

Detailed Description

MediaController integrates elFinder (https://github.com/Studio-42/elFinder) into wCMF.

Note
This class requires ElFinder

The controller supports the following actions:

Action browseMedia
Run elFinder.

Parameter Description
in directory elFinder startPath parameter
in / out fieldName The name of the input field that should receive the url of the selected file. if not given, elFinder will search for a CkEditor instance and set the url on that.
out rootUrl Root url of all media as derived from the configuration value uploadDir in the configuration section media
out rootPath Root path of all media as derived from the configuration value uploadDir in the configuration section media
Response Actions
ok In all cases
Note
elFinder defines action names in the cmd parameter.
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 51 of file MediaController.php.

+ Inheritance diagram for MediaController:

Protected Member Functions

 doExecute ($method=null)
 
 onFileMoved ($cmd, $result, $args, $elfinder)
 
 getResourceBaseDir ()
 
- Protected Member Functions inherited from Controller
 validate ()
 
 doExecute ($method=null)
 
 executeSubAction ($action)
 
 redirect ($location, $key=null, $data=null)
 
 getLogger ()
 
 getSession ()
 
 getPersistenceFacade ()
 
 getPermissionManager ()
 
 getActionMapper ()
 
 getLocalization ()
 
 getMessage ()
 
 getConfiguration ()
 
 requireTransaction ()
 
 endTransaction ($commit)
 
 isLocalizedRequest ()
 
 checkLanguageParameter ()
 
 generateCsrfToken ($name)
 
 validateCsrfToken ($name)
 
 getLocalSessionValue ($key, $default=null)
 
 setLocalSessionValue ($key, $value)
 
 clearLocalSessionValues ()
 

Additional Inherited Members

- Public Member Functions inherited from Controller
 __construct (Session $session, PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ActionMapper $actionMapper, Localization $localization, Message $message, Configuration $configuration)
 
 initialize (Request $request, Response $response)
 
 execute ($method=null)
 
 getRequest ()
 
 getResponse ()
 
- Public Attributes inherited from Controller
const CSRF_TOKEN_PARAM = 'csrf_token'
 

Member Function Documentation

doExecute (   $method = null)
protected
See also
Controller::doExecute()

Definition at line 56 of file MediaController.php.

onFileMoved (   $cmd,
  $result,
  $args,
  $elfinder 
)
protected

Called when file is moved.

Parameters
$cmdelFinder command name
$resultCommand result as array
$argsCommand arguments from client
$elfinderelFinder instance

Definition at line 121 of file MediaController.php.

getResourceBaseDir ( )
protected

Get the base directory for resources.

The default implementation returns the directory configured by the 'uploadDir' key in section 'media'.

Returns
The directory name
Note
Subclasses will override this method to implement special application requirements

Definition at line 138 of file MediaController.php.