When rendering content items, check whether the plugin has monologo
icons. If so, add a 'nofilter' class so the plugin icon can be
rendered as is and without the CSS filter.
Removal of the callback get_shortcuts() and its plugin implementations.
The private methods in the content_item_readonly_repository class
which were only used by the callback hook logic are also removed.
Create new entity for exposing report data on course categories,
joining it to the course entity to provide data for the reportbuilder
editor.
Co-authored-by: Carlos Castillo <carlos.castillo@moodle.com>
Makes sure the guest user context exists when fetching
the recommended modules. If the context does not exist
an exception is being thrown describing the problem.
When plugins are removed from disk, an exception is thrown when
calling component_callback_exists.
This exception should be catched here in order to load properly
the activity chooser (otherwise, the exception will be displayed
and no activity will appear).
Legacy items have no id and so can not be favourited nor
recommended. We needed a way to easily determine whether to show
these features in the templates.
Returns all content items which are provided by the plugin, irrespective
of whether or not a user can see an item in a particular course. This is
used to generate a global list of content items, allowing for admin
level features to be added.
This involves a few changes:
- The callback is still called by the repository but only if the
replacement callback get_course_content_items is not implemented.
- Debugging is called when the get_shortcuts callback is called.
- We leave lti's implementation of get_shortcuts alone, in order to
maintain the output of get_module_metadata during its deprecation life
span.
A repository object which caches results for a user and course. This
allows this repository to be called many time in a single request - a
pattern we expect when objects of this type replace the existing
get_module_metadata() method.
Add a read-only repository, which returns the list of content items
which can be added to a course. This class does not handle access
control nor user-related data pertaining to to core content_items.
This will be handled in a future commit in any calling code using
the repositories.
Plugins have always been able to return either a string or a lang string
when implementing the hook, 'get_shortcuts'. Since content_items will
be the replacement for that stdClass implementation, we need a way
for plugins to continue to have this flexibility. This just provides
a small contract and some classes that plugins can use in future.