Includes change so that updating completion resets the cache, and a debugging
warning if any module calls the completion viewed thing after it's already
printed navigation (which will mean navigation obviously doesn't update right
away). All existing modules that currently update after printing navigation
were updated.
This commit:
a) moves modinfo code into new library modinfolib.php
b) uses classes instead of stdClass objects, allowing a huge amount of documentation (and IDE completion)
c) adds hooks so that plugins other than forum can display messages like forum's 'unread', and plugins other than label can display html (apart from/as well as their view.php link) on the course view page
d) removes current hacks for forum and label (mainly in print_section but also across the code), replacing with new 'content' and similar variables [this is the reason for the changes in blocks, etc]
e) reduces size of modinfo in database (only when rebuilt) by excluding empty fields
The change is intended to be backward compatible and does not affect the format of modinfo in database.
The only case when sesskey is not available is when we came to
subscribe.php from a link in email. In that case, we display a
confirmation page that redirects back providing the sesskey.
All other links to subscribe.php are fixed now so they provide sesskey
as a parameter.
I also polished $mode parameter handling a bit because the check
against empty string was not correct as the value is cast to PARAM_INT.
The string [cannotsubscribe,mod_forum] is supposed to be used for group
membership check only. I have fixed the two other usages of the string.
Note that the condition if (forum_subscribe()) was useless as the
function return true values only now after $DB conversion.
Previous string was used together with the legacy:guest capability.
However, the current code checks is_enrolled() instead. This led to a
weird situation when non-enrolled admin or manager could not subscribe
to a forum and the error message was completely confusing for them.
The problem was in the order of the content preparing. Now when the
filters are always skipped (they have to) we must always run
format_text() first. That will prepare nice HTML in which we just
rewrite the portfolio URIs.
Note that we are still calling clean_text() so that we do not export
malicious code for portfolios like File download. In the future, this
may be changed, made format specific or even per-export configurable.
As a side product of the patch, I have re-enabled online assignment
portfolio export and switched $options->para to false consistently.
The display mode selector is supposed to display in the middle of the
row. Move discussion selector should be on the right, portfolio export
selector on the left. Thanks Sam Marshall for the report and testing the
patches.
The API of the function forum_print_posts_threaded() was changed in
63e87951e6ce93aadc2b891556bf832fe4b5226c but this call was not updated.
This led to not displaying other replies when replying to a forum post.
Filters can replace text with images (smilies, temporary TeX images
etc.), links to glossaries or databases or embedded media players.
Therefore it is important to disable filter processing during portfolio
export.
During the portfolio export, portfolio_rewrite_pluginfile_urls() must be
called before format_text(). Otherwise some filters can interfere with
internal raw record syntax. For example, the Algebra Notation uses @@
for its own purposes and it used to break @@PLUGINFILE@@ placeholder.