Plugin files: Difference between revisions
From MoodleDocs
No edit summary |
David Mudrak (talk | contribs) (Lang file is needed) |
||
Line 5: | Line 5: | ||
; '''[[version.php]]''' | ; '''[[version.php]]''' | ||
: give metadata about the plugin, like the version number. | : 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/''' | ; '''db/''' | ||
: this folder contains information that is used to install the plugin. | : this folder contains information that is used to install the plugin. |
Revision as of 14:41, 19 March 2014
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.