MDL-78806 core: Remove redundant site name on page titles
* With the site name now being appended to the page titles, there
is no need to manually append the page titles.
It's possible to have some Moodle components soft linked instead
of being real directories within codebase (within dirroot).
For example, Composer's "vendor" directory can be soft linked
(from elsewhere), or also plugins can be installed using soft
links.
In those cases, Moodle calculates the $SCRIPT global as null. And,
then, string operations on it are emitting a PHP deprecation message
with PHP 8.1 and up.
This fix just ensures that the behaviour is the same than before
PHP 8.1, aka: ltrim(null) = '' (empty string), without any PHP warning.
Secondary nav previously had to be in my_plugin\local\views\secondary; this
location continues to work but is deprecated. The new location is
my_plugin\navigation\views\secondary.
Some pages have settings that really aren't required anymore.
These have been removed and a function has been aded so that other
developers can turn off the navigation overflow if they want.
The coding exception hint should say it all. Creating an activity module
should not need any output function call. It turned out it can lead to
hard-to-debug bugs and unexpected behaviour. So better to explicitly
fail and let the developer fix the code.
If enabled $CFG->allowcohortthemes, then themes can be set at the cohort level.
This will affect all users with only one cohort or more than one but with the same theme.
The default theme order will be: course, category, session, user, cohort, site.
Previous commits were overlooked, they should have passed the
system context to filter_manager::setup_page_for_fitlers(), the
page context was passed instead. Regardless, the processing of
the latter is too excessive for what we need, but, more importantly,
it does not return "Off, but available" filters which we also need.
This introduces a flag to force the settings menu
to be displayed on the page if the theme uses a settings
menu. This is for use by activities and resources.
This patch includes a big set of changes that are all designed to work together to provide
a better way to navigate in the new theme, and a different way of working with blocks.
Blocks have been moved to a "drawer" that can be opened and closed (this is remembered in a user pref).
A new "flat navigation" element is also available in a drawer - which should let you do 90% of things
without needing to open the "blocks" drawer.
The flat navigation is build from specific parts of the nav tree - the top nodes like "calendar, dashboard" are
hand picked. There is a mycourses node listing your enrolled courses.
There is a node for the current course, built from the top nodes in the current course node in the nav tree.
Administrators have a link to the Site admin settings here too.
These nav elements are used by the templates for the new theme, which also has a resigned layout for login and signup.
There have also been some additional fixes / improvements to the scss for the new theme which goes along with these
layout changes.
This set of changes is a collaboration between Martin, Damyon and Alberto (thanks!).
This is required by the LTI plugin when we share an
activity. We do not want the user to be shown the
navigation blocks etc. The activity should be the
only thing displayed.
1. Improve upgrade note
2. Don't abuse $PAGE to get the current course/cm
3. Use validate_context, never $PAGE->set_context()
4. Reset current coursemodule in validate_context().
5. Respect moodlepageclass when calling an external function.
Fix:
$PAGE->context must be reset when calling validate_context
Improve:
Provide wrapper for calling an external function
The wrapper correctly checks the function parameters and return type against
the description of the external function, and stores the PAGE and COURSE global
state variables, restoring them before the function returns.
Fix: buggy unit tests.
These tests are expecting debugging from a bug that was fixed, and calling web
service functions with no user or session.