Actions

Developer Area/Plugins

From Mahara Wiki

< Developer Area

Note: If you are looking for plugins to download, you can browse a list of them at http://wiki.mahara.org/Plugins

Mahara has a highly pluggable architecture. Currently, you can write plugins for authentication, content types (artefacts), blocks, notifications, search and more. In addition, you can theme Mahara, and also translate the UI to different languages.

Third party plugins within Mahara system

Mahara, being open source, relies on a number of other open source plugins for certain parts of its functionality. To check what plugins are being used you can look at the Third party plugin list, or run this command from base install directory to find their version number.

find ./ -iname readme.mahara -exec grep -H 'Version' {} \;

Developer Documentation

If you want to include third-party code as a part of your plugin, please verify that that code is compatible with GPL v3, which is the license that the Mahara is licensed under.

You can verify license compatibility using the following references:

Remove a plugin

Currently there is no automated system to remove a plugin. But following these steps should get a thirdparty plugin removed. 1) Check if the plugin has an install.xml file and if so make a note of any custom tables it has added 2) Delete the related rows from the database. This will be specific to the plugin type. - Begin by trying to delete the row in the [plugin]_installed table -- which should complain about foreign key issues so you need to delete those rows first -- if they complain about foreign key issues you will need to delete those rows first, etc.

For example if you are wanting to delete the 'cpds' plugin, which has both a block and artefact component, you can use the following SQL commands (written for Postgres but if doing for Mysql the resourceid::int will just be resourceid).

 --- deleting tags ---
 delete from tag where resourcetype = 'artefact' and resourceid::int in (select id from artefact where artefacttype in (select name from artefact_installed_type where plugin = 'cpds'));
 delete from tag where resourcetype = 'artefact' and resourceid::int in (select id from block_instance where blocktype = 'cpds');
 --- deleting view/artefact connections ---
 delete from view_artefact where artefact in (select id from artefact where artefacttype in (select name from artefact_installed_type where plugin = 'cpds'));
 --- delete any custom table info ---
 delete from artefact_cpds_activity;
 --- deleting blocks ---
 delete from block_instance_dimension where block in (select id from block_instance where blocktype = 'cpds');
 delete from blocktype_installed_category where blocktype = 'cpds';
 delete from blocktype_installed_viewtype where blocktype = 'cpds';
 delete from block_instance where blocktype = 'cpds';
 delete from blocktype_installed where name = 'cpds';
 --- deleting artefacts ---
 delete from artefact where artefacttype in (select name from artefact_installed_type where plugin = 'cpds');
 delete from artefact_installed_type where plugin = 'cpds';
 delete from artefact_installed where name = 'cpds';

3) Delete the plugin's directory

Admin stuff

We used to maintain a "mahara-contrib" project in Gitorious and Launchpad, where we invited plugin developers to keep their projects. This fell into disuse circa 2010, and now we encourage plugin developers to host their project wherever they wish, and we'll link to it on our Plugins page.