Class MOXMAN_CorePlugin

InheritanceMOXMAN_CorePlugin
ImplementsMOXMAN_Http_IHandler, MOXMAN_ICommandHandler, MOXMAN_IPlugin

Core plugin contains core commands and logic.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() MOXMAN_CorePlugin
bind() Binds a specific event by name for a specific plugin instance. MOXMAN_CorePlugin
copyThumbnail() MOXMAN_CorePlugin
createThumbnail() Creates a thumbnail for the specified file and returns that file object or the input file if thumbnails are disabled or not supported. MOXMAN_CorePlugin
deleteThumbnail() Deletes any existing thumbnail for the specified file. MOXMAN_CorePlugin
execute() Gets executed when a RPC call is made. MOXMAN_CorePlugin
fileToJson() Converts a file instance to a JSON serializable object. MOXMAN_CorePlugin
fire() This method will fire a specific event by name with the specified event args instance. MOXMAN_CorePlugin
getThumbnail() MOXMAN_CorePlugin
init() Initializes the core plugin. MOXMAN_CorePlugin
moveThumbnail() MOXMAN_CorePlugin
onFileAction() Event handler function. Gets executed when a file action event occurs. MOXMAN_CorePlugin
processRequest() Process a request using the specified context. MOXMAN_CorePlugin
unbind() Unbinds a specific event by name from a specific plugin instance. MOXMAN_CorePlugin

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
fireThumbnailTargetFileAction() MOXMAN_CorePlugin

Method Details

__construct() public method

public void __construct ( )
bind() public method

Binds a specific event by name for a specific plugin instance.

public MOXMAN_PluginManager bind ( $name, $func, $plugin )
$name string

Event name to bind.

$func string

String name of the function to call.

$plugin \MOXMAN_Plugin

Plugin instance to call event method on.

return MOXMAN_PluginManager

PluginManager instance to enable chainablity.

copyThumbnail() public method

public void copyThumbnail ( MOXMAN_Vfs_IFile $fromFile, MOXMAN_Vfs_IFile $toFile )
$fromFile
$toFile
createThumbnail() public method

Creates a thumbnail for the specified file and returns that file object or the input file if thumbnails are disabled or not supported.

public MOXMAN_Vfs_IFile createThumbnail ( MOXMAN_Vfs_IFile $file, $localTempFile null )
$file MOXMAN_Vfs_IFile

File to generate thumbnail for.

$localTempFile
return MOXMAN_Vfs_IFile

File instance that got generated or input file.

deleteThumbnail() public method

Deletes any existing thumbnail for the specified file.

public void deleteThumbnail ( MOXMAN_Vfs_IFile $file )
$file MOXMAN_Vfs_IFile

File to remove thumbnail for.

execute() public method

Gets executed when a RPC call is made.

public Object execute ( $name, $params )
$name string

Name of RPC command to execute.

$params Object

Object passed in from RPC handler.

return Object

Return object that gets passed back to client.

fileToJson() public static method

Converts a file instance to a JSON serializable object.

public static stdClass fileToJson ( $file, $meta false )
$file MOXMAN_Vfs_IFile

File to convert into JSON format.

$meta Boolean

State if the meta data should be returned or not.

return stdClass

JSON serializable object.

fire() public method

This method will fire a specific event by name with the specified event args instance.

public MOXMAN_PluginManager fire ( $name, MOXMAN_Util_EventArgs $args )
$name string

Name of the event to fire for example custom info.

$args MOXMAN_Util_EventArgs

Event args to pass to all event listeners.

return MOXMAN_PluginManager

PluginManager instance to enable chainablity.

fireThumbnailTargetFileAction() protected method

protected void fireThumbnailTargetFileAction ( $action, $fromFile, $toFile )
$action
$fromFile
$toFile
getThumbnail() public method

public void getThumbnail ( MOXMAN_Vfs_IFile $file )
$file
init() public method

Initializes the core plugin.

public void init ( )
moveThumbnail() public method

public void moveThumbnail ( MOXMAN_Vfs_IFile $fromFile, MOXMAN_Vfs_IFile $toFile )
$fromFile
$toFile
onFileAction() public method

Event handler function. Gets executed when a file action event occurs.

public void onFileAction ( MOXMAN_Vfs_FileActionEventArgs $args )
$args MOXMAN_Vfs_FileActionEventArgs

File action event arguments.

processRequest() public method

Process a request using the specified context.

public void processRequest ( MOXMAN_Http_Context $httpContext )
$httpContext MOXMAN_Http_Context

Context instance to pass to use for the handler.

unbind() public method

Unbinds a specific event by name from a specific plugin instance.

public MOXMAN_PluginManager unbind ( $name, $func, $plugin )
$name string

Event name to unbind.

$func string

String name of the function not to call.

$plugin MOXMAN_IPlugin

Plugin instance to not call event method on.

return MOXMAN_PluginManager

PluginManager instance to enable chainablity.