Creating a plugin

The MCImageManager has a powerful event driven plugin architecture very similar to the one TinyMCE has. These plugins enables you to add custom RPC commands, listen to file modifications, override config options, authenticate users, stream binary files, handle file uploads, add custom information back to TinyMCE etc etc.

Creating a plugin for the PHP version

Here are the steps to create a plugin for the PHP version:

  • Copy the _Template directory and name it to a desired name for example MyPlugin.
  • Rename the Template.php to the name of your plugin for example MyPlugin.php.
  • Open the MyPlugin.php plugin and rename the class name from Moxiecode_TemplatePlugin to your plugins name for example: YourCompany_MyPlugin.
  • Change the registration call at the end of the file to match the new plugin name.
  • Add your new plugin to the general.plugins comma separated list. Remember that *nix systems are case sensitive.
  • Start adding code to the events/methods you need to and remove the ones you don't need anymore to make the file nice and tidy.

More details on each event/method can be found in the Template.php file.

Creating a plugin for the .NET version

Here are the steps to create a plugin for the .NET version:

  • Copy the _Template directory and name it to a desired name for example MyPlugin.
  • Rename the src/csharp/TemplatePlugin.cs or src/vb/TemplatePlugin.vb to the name of your plugin for example MyPlugin.cs.
  • Open the MyPlugin.cs/MyPlugin.vb plugin and rename the class name from TemplatePlugin to your plugins name for example: MyPlugin you can also change the namespace.
  • Add your new plugin to the plugins config section.
  • Start adding code to the events/methods you need to and remove the ones you don't need anymore to make the file nice and tidy.
  • Run the make.bat file in the src/csharp or src/vb directory it will build the plugin, you might need to change the framework path in this file you can of curse use Visual Studio if you like. Double click the build.bat in Visual Studio environment and change the name of dll, example:

csc /nologo /target:library /out:..\..\bin\MyPlugin.dll /reference:..\..\..\..\bin\MCManager.dll *.cs

More details on each event/method can be found in the TemplatePlugin.cs file or in the chm files in the docs directory.

If you have any problems, visit the forum for help.