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:

Public Member Functions

 access ($attr, $path, $data, $volume, $isDir, $relpath)
 
- 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 ()
 

Protected Member Functions

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

Additional Inherited Members

- Public Attributes inherited from Controller
const CSRF_TOKEN_PARAM = 'csrf_token'
 

Member Function Documentation

◆ doExecute()

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

Reimplemented from Controller.

Definition at line 56 of file MediaController.php.

◆ onFileMoved()

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 156 of file MediaController.php.

◆ access()

access (   $attr,
  $path,
  $data,
  $volume,
  $isDir,
  $relpath 
)

Access control.

Parameters
$attrAttribute name (read|write|locked|hidden)
$pathAbsolute file path
$dataValue of volume option accessControlData
$volumeelFinder volume driver object
$isDirPath is directory (true: directory, false: file, null: unknown)
$relpathFile path relative to volume root directory started with directory separator
Returns
Boolean or null (elFinder decides)

Definition at line 177 of file MediaController.php.

◆ getResourceBaseDir()

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 188 of file MediaController.php.