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
Action crop
Crop the given image.

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.
in / out oid The filename of the image to crop
in cropX The x value of the top-left corner of the crop frame
in cropY The y value of the top-left corner of the crop frame
in cropWidth The width of the crop frame
in cropHeight The height of the crop frame
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
browseMedia If all crop parameters are defined
ok In crop parameters are missing
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 72 of file MediaController.php.

+ Inheritance diagram for MediaController:

Protected Member Functions

 doExecute ()
 
 onFileMoved ($cmd, $result, $args, $elfinder)
 
 getResourceBaseDir ()
 
- Protected Member Functions inherited from Controller
 validate ()
 
 executeSubAction ($action)
 
 getLogger ()
 
 getSession ()
 
 getPersistenceFacade ()
 
 getPermissionManager ()
 
 getActionMapper ()
 
 getLocalization ()
 
 getMessage ()
 
 getConfiguration ()
 
 assignResponseDefaults ()
 
 isLocalizedRequest ()
 
 checkLanguageParameter ()
 

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 ()
 

Member Function Documentation

doExecute ( )
protected
See also
Controller::doExecute()

Definition at line 77 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 172 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 189 of file MediaController.php.