The 'user' parameter has been added to the 'mod_data > presets'
generator, to let define the author of the preset.
When it's not defined, admin is used as the author.
From now on, the data_generate_default_template method will always return
a string with the template content or an empty string when there is no
content available (for instance, when the database has no fields).
This method won't return a boolean anymore.
The 'user' parameter has been added to the 'mod_data > entries'
generator, to let define the author of the entry.
When it's not defined, admin is used as the author.
For a long time, Moodle has had the feature to force the language
for a whole course. This change adds the same feature at activity
level.
The course-level feature was controlled by a capability
moodle/course:setforcedlanguage, and I decided to use the same
capability to control this feature. I think a new capability would be
overkill.
This is a regression from MDL-75146, when the manager class was created.
The field class was not found in the Single view, because the field.class.php
file was not included (so the base class was used in all the cases for this
view). That's why the image field was displaying only the image name instead
of building the <img element or the URLs were displaying only the text, instead
of creating a link for them.
This commit adds support to description field for presets:
- For plugin presets, description will be stored in the module_help
string in lang files.
- For saved presets, a new element, <description>, has been added
to the preset.xml file, to include this information.
A new field has been added to the "Save as preset" modal, to let users
define description (which is empty by default, to support pre-existing
presets that won't have it).
Apart from that, the "Save as preset" workflow has been slightly improved,
following the Product UX/UX suggestions to hide the checkbox to overwrite
the preset by default and show it only if the user tries to save a preset
with an existing name.
- Add a new help text.
- Add captions to table columns.
- Move action icons to action menu, and fix code to display the remove
action only for presets created by users.
- CSS improvements to fit the prototype.
In order to achive the previous points, the renderer has been improved,
to return the data and let the mustache to print it properly (instead of
returning the formatted HTML table).
This activity currently supports two different preset types:
- Datapreset plugins, that can be installed copying them to the
mod/data/preset folder.
- Presets saved manually by users.
This commit adds an attribute to the presets to mark them, in order
to identify them later (because, for instance, the plugins can't be
removed).
Apart from that, the methods in lib.php, involved with this issue, have
been deprecated. New methods have been implemented in the manager class,
covering them with PHPUnit tests.
While covering is_directory_a_preset() with PHPUnit tests, it has been
identified that there was a missing file in the Image gallery preset.
The template will be reviewed in the future (in a separate issue) but,
for now, I'm going to add the default template for advanced search.