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
No edit summary
(Update migration status and path)
Tag: Replaced
Line 1: Line 1:
{{Infobox Project
{{Template:Migrated|newDocId=/general/projects/api/admin-tools}}
|name = Admin tools
|state = Implemented
|tracker = MDL-29029
|discussion = n/a
|assignee = [[User:Petr Škoda (škoďák)|Petr Škoda (škoďák)]]
}}
{{Moodle 2.2}}
 
Admin tools are advanced plugins that are intended especially for site administrators, they are accessible via the admin site administration tree menu. Ideally most of the functionality in /admin/ directory should be moved to separate plugins in the future.
 
==Previous problems==
Before 2.2 tools for administrators were created as admin reports (because we did not have better pluggable place), placed directly into /admin/ or /local/ directory.
* confusing /admin/report/ or /local/ plugins
* no way to disable or remove or add custom admin tools
* /local/qeupgradehelper - official distribution should not include local plugins by definition
 
==Benefits==
* major cleanup in /admin/
* no need to abuse admin reports
* contrib admin tools can be distributed easier
* it is possible to remove or replace core admin tools (no hardcoded links)
 
==Upgrades==
 
How to migrate existing admin reports:
# move all files to new /admin/tool/yourplugin/ location
# update all links to admin tools /$CFG->admin/report/ to /$CFG->admin/tool/
# rename/add language pack file with at least 'pluginname' string
# update all language strings (use 'tool_yourplugin' instead of 'report_yourplugin') - use [[Languages/AMOS|AMOS]] hints in commit message
# update all capability names
# create db/install.php migration script - delete old settings and capabilities (see converted plugins for examples)
# grep the plugin codebase and look for any remaining 'coursereport' occurrences
# 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 usually takes less than an hour to migrate and test one admin tool.
 
;What is the difference between report and admin tool?
:Report is a view of live or historical data, it may also contain export feature, reports usually do not modify data. 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.
 
==See also==
* [[General report plugins]]
 
[[Category:Plugins]]

Revision as of 14:29, 19 September 2023

Important:

This content of this page has been updated and migrated to the new Moodle Developer Resources. The information contained on the page should no longer be seen up-to-date.

Why not view this page on the new site and help us to migrate more content to the new site!