Thursday, January 31, 2008

Plugins

Moodle has about 22 different types of plugins last time I counted. Plugins can generally be self-contained in a single directory containing scripts, images, stylesheets and language files all in one package that can be dropped into the Moodle script directory in the right place. After that the admin just needs to visit the admin page to install them.

Most plugins work in one of two ways, they either provide a lib.php filled with common functions and some scripts with standard names, or they subclass a proto-plugin and override a few method functions to achieve their goals.

The best way to learn is to pick an example from the core code that is similar to what you want to do and start playing with it. There are also some template plugins to help get you started.

No comments: