Note:

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

Frankenstyle: Difference between revisions

From MoodleDocs
Line 14: Line 14:
= Plugin types =
= Plugin types =


* Module: '''mod_'''
* Activity modules: [mod] => /mod
* Block: '''block_''' ''(Not blocks. The fact that the top-level folder is a very old mistake that it is too late to fix now.)''
* Authentication plugins: [auth] => /auth
* Admin report: '''report_'''
* Enrolment plugins: [enrol] => /enrol
* Course report: '''coursereport_'''
* Messaging consumers: [message] => /message/output
* ... (TODO - somebody else add these as they come up please)
* Blocks:  [block] => /blocks
* Filters: [filter] => /filter
* Editors: [editor] => /lib/editor
* Course formats:  [format] => /course/format
* User profile fields:  [profilefield] => /user/profile/field
* Admin reports: [report] => /admin/report
* Course reports: [coursereport] => /course/report
* Grade export plugins: [gradeexport] => /grade/export
* Grade import plugins: [gradeimport] => /grade/import
* Grade reports: [gradereport] => /grade/report
* Mnet services: [mnetservice] => /mnet/service
* Webservice protocols: [webservice] => /webservice
* Repository plugins: [repository] => /repository
* Portfolio plugins: [portfolio] => /portfolio
* Question behaviours: [qbehaviour] => /question/behaviour
* Question formats: [qformat] => /question/format
* Question types: [qtype] => /question/type
* Plagiarism plugins: [plagiarism] => /plagiarism
* Themes: [theme] => /theme
* Assignments: [assignment] => /mod/assignment/type
* Database field types: [datafield] => /mod/data/field
* Database presets:  [datapreset] => /mod/data/preset
* Quiz reports: [quiz] => /mod/quiz/report
* SCORM reports: [scormreport] => /mod/scorm/report
* Workshop grading forms: [workshopform] => /mod/workshop/form
* Workshop allocation strategies:  [workshopallocation] => /mod/workshop/allocation
* Workshop evaluation plugins: [workshopeval] => /mod/workshop/eval
* Local plugins: [local] => /local


To get a definitive list, do <tt>print_object(get_plugin_types());</tt> in a Moodle 2.0 install.
 
To get a definitive list, do <tt>print_object(get_plugin_types());</tt> in a Moodle 2.x install.


= Usages =
= Usages =

Revision as of 09:38, 23 August 2011

'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

  • Activity modules: [mod] => /mod
  • Authentication plugins: [auth] => /auth
  • Enrolment plugins: [enrol] => /enrol
  • Messaging consumers: [message] => /message/output
  • Blocks: [block] => /blocks
  • Filters: [filter] => /filter
  • Editors: [editor] => /lib/editor
  • Course formats: [format] => /course/format
  • User profile fields: [profilefield] => /user/profile/field
  • Admin reports: [report] => /admin/report
  • Course reports: [coursereport] => /course/report
  • Grade export plugins: [gradeexport] => /grade/export
  • Grade import plugins: [gradeimport] => /grade/import
  • Grade reports: [gradereport] => /grade/report
  • Mnet services: [mnetservice] => /mnet/service
  • Webservice protocols: [webservice] => /webservice
  • Repository plugins: [repository] => /repository
  • Portfolio plugins: [portfolio] => /portfolio
  • Question behaviours: [qbehaviour] => /question/behaviour
  • Question formats: [qformat] => /question/format
  • Question types: [qtype] => /question/type
  • Plagiarism plugins: [plagiarism] => /plagiarism
  • Themes: [theme] => /theme
  • Assignments: [assignment] => /mod/assignment/type
  • Database field types: [datafield] => /mod/data/field
  • Database presets: [datapreset] => /mod/data/preset
  • Quiz reports: [quiz] => /mod/quiz/report
  • SCORM reports: [scormreport] => /mod/scorm/report
  • Workshop grading forms: [workshopform] => /mod/workshop/form
  • Workshop allocation strategies: [workshopallocation] => /mod/workshop/allocation
  • Workshop evaluation plugins: [workshopeval] => /mod/workshop/eval
  • Local plugins: [local] => /local


To get a definitive list, do print_object(get_plugin_types()); in a Moodle 2.x 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.