Conversation
Add a global admin setting that controls the order of the Kickstart navigation pages (course template, student view, help, and the Pro course library / create template pages) in the tertiary navigation dropdown. The order also determines the default page: the visible page with the lowest order is shown first. A page set to order 0 is hidden. When the configured order leaves only a single visible page, the dropdown collapses to a plain page title instead of a pointless single-option selector. - lib.php: central page list + ordering/visibility/default helpers, and order-aware menu builders - settings.php: numeric "order" field per available page - format.php / list.php: default nav derived from the configured order - general_action_bar: render a title when only one page is visible - PHPUnit coverage for ordering, hiding, default and the single-item bar Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
Replace the free-text order inputs with a select dropdown offering positions 1..N (one per available page) plus a "Hide" option for 0, so admins pick a valid position instead of typing an arbitrary number. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a global admin setting that defines the order of the pages in the Kickstart tertiary-navigation dropdown (course template, student view, help, plus the Pro course-library and create-template pages). The configured order also determines the default page — the visible page with the lowest order is shown first — and a page set to order
0is hidden from the dropdown.As a bonus, when the configuration leaves only a single visible page, the dropdown collapses to a plain page title instead of a one-option selector with a useless toggle arrow.
Changes
lib.php— new single source of truth for the page list plus ordering helpers:format_kickstart_get_all_pages()— every available page (base + Pro) in canonical orderformat_kickstart_get_ordered_pages()— applies the admin order; drops pages set to0; unset settings keep their canonical position (so a fresh install never hides everything); stable tie-breakformat_kickstart_get_default_nav()— first visible page, with a safecoursetemplatefallback..._get_breadcump_menus,..._get_action_selector_menus) are now order-aware; the Pro create-template capability gate is preservedsettings.php— a "Navigation page order" heading and one numericPARAM_INTfield per available page (Pro fields appear only when Pro is installed)format.php/list.php— defaultnavnow comes fromformat_kickstart_get_default_nav()instead of the hardcodedcoursetemplategeneral_action_bar+ template — render a bold title (no selector) when only one page is visible, and nothing when all are hiddenlang/en— new strings (pageordersettings,pageorder, …) documenting that0hides a page and the lowest number is the defaultversion.php— bumped so the new settings register on upgradeTests
Added PHPUnit coverage in
tests/format_kickstart_test.php:format_kickstart_get_all_pages/_get_ordered_pages(default, reorder, hide)format_kickstart_get_default_nav(lowest-order default + all-hidden fallback)general_action_bar::export_for_template(single-item title vs multi-item selector)Locally verified with
php -land the Moodle code checker (moodlehq/moodle-cs,--standard=moodle) — clean. PHPUnit/Behat run via this pipeline.