Note:

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

Admin tools: Difference between revisions

From MoodleDocs
Line 20: Line 20:
# update all links to admin tools /$CFG->admin/report/ to /$CFG->admin/tool/
# update all links to admin tools /$CFG->admin/report/ to /$CFG->admin/tool/
# add language pack with at least 'pluginname' string
# add language pack with at least 'pluginname' string
# update all language strings (use 'tool_yourplugin' instead of 'report_yourplugin')
# update all language strings (use 'tool_yourplugin' instead of 'report_yourplugin') - use [[Languages/AMOS]] hints in commit message
# update all capability names
# update all capability names
# create db/install.php migration script - delete old settings and capabilities (see converted plugins for examples)
# create db/install.php migration script - delete old settings and capabilities (see converted plugins for examples)

Revision as of 09:21, 22 November 2011

Admin tools
Project state Implemented
Tracker issue MDL-29029
Discussion n/a
Assignee Petr Škoda (škoďák)

Moodle 2.2


Previous problems

Before 2.2 tools for administrators were created as admin reports (because we did not have better pluggable place) or placed directly into /admin/ directory.

  • confusing /admin/report/ or /local/ content
  • no way to disable or remove custom admin tools
  • /local/qeupgradehelper - official distribution should not include local plugins by definition

Upgrades

How to migrate existing admin reports:

  1. copy all files to new /admin/tool/yourplugin/ location
  2. update all links to admin tools /$CFG->admin/report/ to /$CFG->admin/tool/
  3. add language pack with at least 'pluginname' string
  4. update all language strings (use 'tool_yourplugin' instead of 'report_yourplugin') - use Languages/AMOS hints in commit message
  5. update all capability names
  6. create db/install.php migration script - delete old settings and capabilities (see converted plugins for examples)
  7. grep the plugin codebase and look for any remaining 'coursereport' occurrences
  8. update CSS selectors

FAQs

Is it necessary to migrate existing admin reports?
Yes. Old admin reports directory is completely ignored.
Is it difficult to migrate admin reports?
No, it takes less than an hour to migrate and test admin tools.
What is the difference between report and admin tool?
Report is a view of live or historical data, it may also contain export feature, standard reports do not modify data usually. Admin tools are intended mostly for administrators, they usually work only in system context.
What is the difference between admin tool and local plugin?
Local plugin is everything else, it may be intended for non-admin users. Examples of local plugins: event handlers, web service/function definitions, shared library hacks, new lang strings used in core hacks, etc.