Development:Frankenstyle: Difference between revisions
sam marshall (talk | contribs) (New page: 'Frankenstyle' refers to the naming convention that is used to uniquely identify a Moodle plugin based on the type of plugin and its name. Martin Dougiamas is credited with inventing the ...) |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 8: | Line 8: | ||
* The prefix is determined by the type of plugin. For example, the prefix for a module is '''mod'''. | * The prefix is determined by the type of plugin. For example, the prefix for a module is '''mod'''. | ||
* The name is the name of the plugin. (Plugin names are always made of lower-case letters) | * The name is the name of the plugin. (Plugin names are always made of lower-case letters.) | ||
So the frankenstyle name for the quiz module is '''mod_quiz'''. | So the frankenstyle name for the quiz module is '''mod_quiz'''. | ||
Line 18: | Line 18: | ||
* Course report: '''coursereport_''' | * Course report: '''coursereport_''' | ||
* ... (TODO - somebody else add these as they come up please) | * ... (TODO - somebody else add these as they come up please) | ||
To get a definitive list, do <tt>print_object(get_plugin_types());</tt> in a Moodle 2.0 install. | |||
= Usages = | = Usages = | ||
Line 23: | Line 25: | ||
Frankenstyle is used in: | Frankenstyle is used in: | ||
== Table names == | |||
All table names for a plugin must begin with its frankenstyle name (after the standard Moodle table prefix). | |||
Examples: mdl_'''mod_quiz''', mdl_'''mod_quiz'''_attempts | |||
== Capabilities == | |||
All capabilities for a plugin use the frankenstyle name, except with a / instead of a _. | |||
Example: '''mod/quiz''':viewattempt | |||
== Other places (TODO) == | |||
Please add more as they come up. |
Latest revision as of 14:00, 12 November 2010
'Frankenstyle' refers to the naming convention that is used to uniquely identify a Moodle plugin based on the type of plugin and its name.
Martin Dougiamas is credited with inventing the word 'frankenstyle'. (It is a great word!)
Format
Frankenstyle names have a prefix and then a name, separated by an underscore.
- The prefix is determined by the type of plugin. For example, the prefix for a module is mod.
- The name is the name of the plugin. (Plugin names are always made of lower-case letters.)
So the frankenstyle name for the quiz module is mod_quiz.
Plugin types
- Module: mod_
- Admin report: report_
- Course report: coursereport_
- ... (TODO - somebody else add these as they come up please)
To get a definitive list, do print_object(get_plugin_types()); in a Moodle 2.0 install.
Usages
Frankenstyle is used in:
Table names
All table names for a plugin must begin with its frankenstyle name (after the standard Moodle table prefix).
Examples: mdl_mod_quiz, mdl_mod_quiz_attempts
Capabilities
All capabilities for a plugin use the frankenstyle name, except with a / instead of a _.
Example: mod/quiz:viewattempt
Other places (TODO)
Please add more as they come up.