FileRUN - Web based document flow management system

Custom file actions

From FileRun Documentation

Starting with version 130509A ([1]), you can easily add custom options in the file contextual menu. Here is a step by step guide:

  1. Make a copy of "/path-to-filerun/customizables/custom_actions/_example" inside the same folder and rename it to "my-action" (you are free to name the folder as you wish). (Putting an underscore in front of the folder's name disables the option.)
  2. Open the file "my-action/app.php" in a PHP editor:
  • Rename the class to "custom_my-action". (Note that this depends on the folder's name.)
  • Edit the code according to your requirements:
$this->JSconfig['title']

Defines the text that will be displayed for the contextual menu option.

$this->JSconfig['icon']

Defines the URL of the contextual menu option's icon.

$this->JSconfig['popup'] = array(
 "width" => 840,
 "height" => 570
);

The above key will make the option to open a popup window with the specified size. If you wish to execute a JavaScript function (perhaps making an Ajax call) instead of opening a popup, remove this key and replace it with the following one:

$this->JSconfig['fn'] = "alert('Option clicked!')";
When using a popup window, the output of the method "custom_my-action::run()" will be displayed inside the popup. The "$this->data" array can be used to find the file's path:
function run() {
 echo $this->data['filePath'];
}


Misc custom actions:

  • View documents online with Vuzit.com (download)
  • Open PDF documents in your browser (download)