Skip to content

Cleanup and improve admin settings navigation#78

Merged
daniil-berg merged 4 commits intomainfrom
feat/better-admin-navigation
Apr 2, 2026
Merged

Cleanup and improve admin settings navigation#78
daniil-berg merged 4 commits intomainfrom
feat/better-admin-navigation

Conversation

@malteschmitz
Copy link
Copy Markdown
Collaborator

This pull requests performs some refactoring to clean the code and optimise the UI of the admin settings navigation tree:

  • require_once("$CFG->dirroot/mod/assign/adminlib.php") is not needed. We do not need a library from mod_assign.
  • I tried to make the names of the admin tree nodes more consistent and tried to following the implicit Moodle conventions:
    • tool_monitoring is the category
      • tool_monitoring_overview is the external page with the overview table
      • tool_monitoring_exporters is the category for the exporters
  • The admin external page now uses admin_externalpage_setup('tool_monitoring_overview') and $PAGE->set_secondary_active_tab('modules') to correctly setup this page as an admin external page. As a result the title, header, breadcrumb navigation and the active indicator in the secondary navigation are now shown correctly. See below for a before and after screenshot.

Before:

After:

Our admin category for comparison:

Our metrics overview admin external page now has the same look and feel as the regular admin category page.

The type annotation comment for global variables must be placed directly before the first usage of that variable. Unfortunately global $ADMIN does not count as usage.
@daniil-berg daniil-berg merged commit 6cb15da into main Apr 2, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants