mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 19:50:14 +01:00
d4e71a4eed
The dual front-page/system-wide form to edit blocks can be reduced asuming that, always: A) system sets the context to system, recursively and with page-type set to "*" B) frontpage only sets the context to site-course, non-recursively and with page-type set to "site-index" C) frontpage all added sets the context to site-course, recursively and with paget-type set to "*" And that is the change that this patch provides, by: 1) detecting properly if we are editing blocks @ protpage 2) passing that information to the form data processor 3) setting parentcontextid, showinsubcontexts and pagetypepattern following the A, B, C immutables above. Finally, and affecting some other system-wide pages, there are cases (my, user templates...) having only one possible pagetypepattern, and it looks badly if the page has subpages, so for those system-wide cases we are showing exceptionaly the pagetypepattern statically. This will be revisited once MDL-30574 is decided and implemented, although perhaps it's ok to leave it as default to places with only one pagetypepattern available.