Friday, April 20, 2012

Plugins Plugins Plugins

I have been in and out of moodle plugins since I first began looking at moodle. One of the first tasks i jumped into was figuring out how to add custom functionality to moodle.

Anything added to moodle,  a report, a theme, a block,  is a plugin.

A few moodle plugin pointers

1 - Start at the front door of the development road map, spend time here.
2 - Start at the front door of the forums.
3 - Take the development course(s)
4 - Core developer documentation
5 - The current plugin page, where all the existing plugins are listed.
6 - The best matrix of different types of plugins to develop

Really page attention to the core APIs pages

When building code, use the API as much as possible. If you build a form, query data and show it in a report, use the API functions to do that.  This allows the plugin to be more universally usable and stable.

Why the API again?

Remember, moodle is used on many different platforms, not just the one you are developing on.  The API encapsulates the differences between the platforms and databases.

Common files to expect in a plugin.

  • index.php - home page for the plugin.
  • version.php - tells moodle what version necessary and tells plugin manager when to upgrade
  • db\access.php - contains capability permissions in the plugin
  • lang\en\pluginname.php - where pluginame matches the name - contains strings used throughout the plugin
  • settings.php - contains definitions and variables used by the plugin code
  • \images - images used in the plugin
  • db\install.php - contains installation directives for the plugin.

No comments:

Post a Comment