Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Plugin files: Difference between revisions

From MoodleDocs
(Lang file is needed)
Line 25: Line 25:
:; '''question/bank/'''
:; '''question/bank/'''
:: This is where you define new question bank column types. See mod_quiz as an example.
:: This is where you define new question bank column types. See mod_quiz as an example.
[[Category:Plugins]]

Revision as of 18:40, 9 January 2015


There are some files that work the same in all plugin types (if they are present). We document them here.

version.php
give metadata about the plugin, like the version number.
lang/en/plugintype_pluginname.php
strings for your plugin, at least 'pluginname' must be present
db/
this folder contains information that is used to install the plugin.
install.xml
upgrade.php
install.php
These three files are to do with creating the and updating the database tables required by your plugin.
access.php
This is where you define any capabilities that your plugin uses.
...
There are lots of other things that can go in the db folder, but I don't have time to describe them now.
classes/
This folder contains the definition of any classes for your plugin that you want the auto-loader to be able to find. You can define any classes you like at the top level.
[core API name]
within classes/, the top level folders are reserved for the names of Core APIs except for
local/
You can put whatever you like within the local namespace, including as many nested namespaces as you like.
question/bank/
This is where you define new question bank column types. See mod_quiz as an example.