Table of Contents

Mantis Plug-ins Requirements

Introduction

Mantis currently supports some extensibility features like custom fields, custom functions, custom constants, and custom strings. These has proven to be useful features that allowed Mantis users to tweak their own installations without having to change Mantis code base and hence making the upgrade experience much easier. The aim of Mantis Plug-ins support is to take this to the next level and enable users to do more powerful additions to Mantis and be able to make these publicly available to other users. Some of the Plug-ins will be distributed with Mantis and others will be available through Mantis website / bugtracker.

Types of Plug-in

Plug-ins Support Infrastructure

Information about a plugin

We can add support for dependencies on DB type, DB version, web server, etc. However, ideally we should target to reduce such dependencies when possible.

Directory Structure

mantis/
  admin/
  core/
  lang/
  modules/
    #modulename#/
      css/
        *.css
      images/
        logo.jpg (some plugins may have logos, file name is configurable)
      core/
      javascript/
        *.js
      doc/
        readme.html
      lang/
        strings_english.txt
      pages/
        (new pages - included from module_page.php based on module name and action)
      #modulename#_constants_inc.php
      #modulename#_defaults_inc.php
      #modulename#_inc.php

Configuration Options

Note that the plugins are always applied to all projects. It is up to the plugin to scope down its functionality (if necessary).

New Pages

The following pages will allow management of plug-ins and all their related details:

Plug-ins APIs

This is the standard APIs that are used in managing modules and allowing modules to interact with some standard Mantis functionality. In addition to these APIs, the plug-in implementation can use the rest of the APIs like strings_api, etc.

Events

Events are integration points that are similar to custom functions, however, they can be handled by one or more of the installed plug-ins. Typically, events take in parameters and do not have a return value.

Output Hooks

Plug-ins should be able to create new pages, however, they should also be able to enrich the content of some of the existing pages. This is through some pre-defined output hooks. Following are the initial set. In the future, it should be easy to add more of these hooks. In each of these pages there can be one or more places where content can be injected.

Ideas for Plugins

To be Spec'd

Feedback

This is still in progress, but you are free to contribute ideas.

$t_pkg['plugin'] = 'string'; // The plugin name
$t_pkg['check'] = array(); // The array of requirements to be checked, eg: array( 'mantis' => array( 'min' => '1.0.5' ), 
                           //    'php' => array( 'min' => '4.0.0' ), 'plugins' => array( 'pluginmanager' => array( 'min' => '0.1.2' ) ) );
$t_pkg['files'] = array(); // The files of the plugin (base64 encoded), eg: array( 'plugins/bbcode/core.php' => base64_string, ... )
$t_pkg['remove'] = array(); // The list of files to remove.
$t_pkg['info'] = array(); // The plugin info (version, name, id...)
$t_pkg['info_pm'] = array(); // The plugin manager info

First implementation

A first implementation has been written, you can find it here. This implementation does not respect the requirements. You can play with it here, create an account and go to the plugin page (take care this is a real bugtracker, not a demo version).

Respect

Does not respect

mantis/
  admin/
  core/
  lang/
  plugins_page.php
  plugins/
    plugin1/
    plugin2/
    plugin3/
      index.php
      info.php
      core/
        functions_api.php
      lang/
        strings_english.txt

What the plugin manager does?