349 Commits

Author SHA1 Message Date
Shamim Rezaie
88f66617a0 MDL-77375 output: Allow additional options for dropdowns 2023-07-02 00:06:13 +10:00
Sara Arjona
fcd946c862 Merge branch 'MDL-78308-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-08 06:48:40 +02:00
Paul Holden
5c871bff29
MDL-78308 output: better parsing of custom menu item configuration.
Previously certain values would cause deprecation notices in PHP8.1.
2023-05-18 10:19:18 +01:00
Paul Holden
67effa603e
MDL-78225 output: add sesskey for post requests only in renderables. 2023-05-11 22:48:54 +01:00
Anupama Sarjoshi
8b31922739 MDL-77148 core: Fix to export params for templates in correct format
When questions are filtered by tags in the question bank, the qtagids
params are passed in the array format. Though moodle_url handles this,
single_button::export_for_template cannot. Hence changes done in
weblib.php to provide params for export_for_template in the
suitable format.
Thanks Huong. I have added the Behat test you provided in the patch.
2023-04-06 14:38:29 +01:00
Marina Glancy
2dd7290ccb MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc
show notice when null is passed as an argument
2023-01-23 09:16:06 +08:00
Amaia Anabitarte
ab97d41644 MDL-75335 mod_data: Zero state for Fields and Templates 2022-10-25 16:35:58 +02:00
Sara Arjona
16ba7cbe96 MDL-75684 mod_data: Add metadata to templates
Each template should display at the top the information about the
user who has created the entry, when it was created and modified.

Apart from that, this commit also includes:
- For the Journal preset, a link on each card entry title has been
added, to open the Single view.
- For the Resources preset, the Author field has been renamed to
"Author of resource" and the Description to "Content".
- For the Resources preset, the Author and Type fields will be
hidden in the List view for small devices.
2022-10-24 13:01:39 +02:00
Paul Holden
dd0c545ec6 MDL-75077 output: prevent duplicate ID errors in custom menus.
Following on from 8e4a7c6b, we should apply a similar change to
custom menus to account for being collapsed into the "More" menu.
2022-10-05 18:29:17 +01:00
Tim Hunt
797b9fbd62 MDL-75548 misc: final Required parameter follows optional notices 2022-08-22 15:20:13 +01:00
Jun Pataleta
950d617aec MDL-74800 core: action menu role fix
The action menu could have a role button or menubar depending on the
number of options available.
2022-08-08 14:46:42 +02:00
Jun Pataleta
3bdd840e63 MDL-72885 output: Allow additional attributes for custom menu items
* Plus don't render the link title if it's the same as the link text.
2022-05-27 19:38:54 +08:00
Andrew Nicols
649705874d Merge branch 'MDL-70792-master-2' of https://github.com/junpataleta/moodle 2022-02-25 11:39:55 +08:00
Jun Pataleta
13cdef5dc4 MDL-70792 output: Menu items should have -1 tab index
* As per WAI ARIA Authoring Practices 1.1 guidelines for menus,
menu items should have a tab index of -1. Navigation between menu items
is done via arrow keys.

See https://www.w3.org/TR/wai-aria-practices-1.1/#menu
2022-02-24 18:21:12 +08:00
Mihail Geshoski
57125bd86a MDL-73355 output: Set the id when initializing the action_link object 2022-02-23 21:44:08 +08:00
Bas Brands
7c76e1c349 MDL-72466 core_output: dropdown menu alignment 2022-01-27 17:24:20 +01:00
Sara Arjona
81b80edf40 MDL-73584 lib: Remove role menubar from Actions menu
The menubar role defined in the "menubar d-flex" element is not
required and it's causing the following error "Required ARIA children
role not present: group, menuitemradio, menuitem, menuitemcheckbox".
2022-01-17 12:50:53 +01:00
Huong Nguyen
ffca35b805 MDL-72896 Accessibility: Make html_table responsive
The tables are generated by html_table will responsive across viewports
2021-11-09 09:41:27 +07:00
Paul Holden
02680f59d9 MDL-72639 admin: consistent primary buttons during site upgrade. 2021-10-10 20:42:44 +01:00
Paul Holden
dcc130c7cf MDL-72289 output: allow customised inplace editable icon for editing.
Add optional argument to allow it to be defined by caller, and set
the default icon for `select` type as appropriate.
2021-08-31 11:37:02 +01:00
abgreeve
42e191cc4d MDL-72005 navigation: Change context header to switch breadcrumbs
- Part of: MDL-69588
This changes the context header to switch the breadcrumbs to the
top in boost. It also changes the context header in the modules
to have the activity name instead of the course name, and adds
an icon for the activity.
2021-08-23 17:46:40 +08:00
Luca Bösch
7dd58aac64 MDL-60331 questions: prevent double escaping question categories. 2021-04-28 17:30:46 +02:00
sam marshall
5e72715e4f MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:47:23 +00:00
sam marshall
987e55452f MDL-45242 Course: Enrol feature supports custom profile fields 2021-03-10 10:57:11 +00:00
sam marshall
558cc1b85e MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:57:10 +00:00
sam marshall
60a1b159aa MDL-45242 Lib: Deprecate field-related library functions 2021-03-08 09:20:18 +00:00
Brendan Heywood
ded82b7f5b MDL-70583 cli: Allow progress bars to be rendered in cli scripts 2021-02-02 22:07:14 +11:00
Mikhail Golenkov
8325c83b20 MDL-68792 theme_boost: Show the fake blocks on embedded layout. 2020-12-18 12:06:03 +11:00
Jun Pataleta
7ef7aaecac MDL-69262 core: Make instance count variable as a static class variable
With the static function variable $instance, calls to
\action_menu_link::export_for_template() from its subclasses are stored
in different variables. This causes duplicate IDs when different
implementations of action menu links are rendered on the action menu
trigger/link template. (e.g. action_menu_link and
action_menu_link_secondary both rendered on the same page).
To make the incrementing uniform for the action_menu_link class and its
implementations, the $instance variable is moved out of the
export_to_template() method and is now made to a static class variable.
2020-08-27 13:24:42 +08:00
Andrew Nicols
9777b0fa19 Merge branch 'MDL-68312-master-2' of git://github.com/rezaies/moodle 2020-06-03 08:00:57 +08:00
Shamim Rezaie
96896e0dd7 MDL-68312 gradereport_grader: Use caption instead of summary in table
The summary attribute on the table element is obsolete.
2020-05-28 19:18:38 +10:00
Sara Arjona
8e1b43f0d5 Merge branch 'MDL-68343-master' of git://github.com/rezaies/moodle 2020-05-27 15:09:39 +02:00
Eloy Lafuente (stronk7)
9b0a1e2a98 Merge branch 'MDL-68427-master' of git://github.com/andrewnicols/moodle 2020-04-30 23:35:09 +02:00
Shamim Rezaie
d28b4ec326 MDL-68343 output: fix html table structure
A <th> that contains no text may result in cells with missing or
incorrect header information. WAVE advises that we should make a cell
a <td> rather than a <th> if the cell must remain empty (such as the
top-left cell in a data table).

Also note that the scope attribute is only valid for <th>
2020-04-22 04:30:53 +10:00
Andrew Nicols
3e5a8acc85 MDL-68427 core: Correct previous/next page in paging bar 2020-04-16 14:40:01 +08:00
Eloy Lafuente (stronk7)
d26a13b407 Merge branch 'MDL-66849-master' of https://github.com/ised-isde-canada/moodle 2020-04-16 01:01:32 +02:00
Michael Milette
8056397b7e MDL-66849 output: Remove custom menu title when not specified 2020-04-14 22:27:06 -04:00
Simey Lameze
f7b84afe15 MDL-68288 core_table: support pagination bar for dynamic tables 2020-04-09 07:06:35 +08:00
Shamim Rezaie
1a94ddd31b MDL-68148 output: type attribute is unnecessary for javascript resources 2020-04-08 11:22:34 +10:00
Eloy Lafuente (stronk7)
88d88bd92e MDL-67307 core: Fix onject creation from empty value cases
The "creating default object from empty value" warning is now consistently
thrown if a falsy value is promoted into an stdClass object. Previously some
cases like `$null->prop[0] = $val` missed this warning.
2019-11-22 01:40:42 +01:00
Jun Pataleta
c23313f6e8 Merge branch 'MDL-66968' of https://github.com/stronk7/moodle 2019-10-25 10:20:05 +08:00
Eloy Lafuente (stronk7)
f4feabb83f MDL-66968 php74: array_key_exists() for objects is deprecated
Replace it for correct property_exists() when the element
being inspected is a property of object/class.

Amended and squased changes:
- keep mongo unmodified. The information is array, hence correct.
- fix a couple of messaging phpdocs that were incorrect.

Amended take#2:
- As far as mongo resturns BSONDocument that is ArrayObject, aka
implements ArrayAccess, we have decided to explicitly cast results
to array so existing array_key_exists() and other accesses will
continue working the same.
2019-10-25 00:49:04 +02:00
Tim Hunt
701ae1eb4b MDL-66816 question bank: replace row of edit icons with an Edit menu 2019-10-18 14:27:50 +01:00
David Monllaó
ca81e906e0 MDL-62191 output: New extra attributes for single_button
Useful for data- attributes.
2019-09-27 14:12:48 +08:00
Tim Hunt
9a3af544ff MDL-65915 quiz regrading: better progress information
This makes it easier to diagnose problems if the regrade fails in the
middle.

Along the way, I added one un-declared field to the class, and
converted some SQL-construction code to $DB->get_in_or_equal().

I also added the ability to set attributes on the label in
html_writer::checkbox.
2019-06-18 11:37:12 +01:00
Juan Leyva
26e778d1b7 MDL-60680 file: Support any user id when creating tokens for files.
$includetoken parameter type has been changed. Now supports:
   boolean: False indicates to not include the token, true indicates to generate a token for the current user ($USER).
   integer: Indicates to generate a token for the user whose id is the integer value.
2019-04-23 13:16:15 +02:00
Jun Pataleta
5f30600f43 MDL-65081 core_output: Set single_select and url_select attributes 2019-03-22 11:12:21 +08:00
Eloy Lafuente (stronk7)
fc414a2577 Merge branch 'MDL-62680-master' of git://github.com/damyon/moodle 2019-02-07 10:23:39 +01:00
Damyon Wiese
ef96eb02fb MDL-62680 output: Only hide icons with no label
For accessibility we don't want to read an icon with a label immediately next to the label,
but in this case it's clearer for the icon to have no alt text / title for both
screen readers and non-screen readers. Worse is not reading important information just
because it's displayed as an icon.
2019-02-07 10:08:19 +08:00
Luca Bösch
1bfed23bf5 MDL-62439 output: Debugstringids in overlay windows. 2019-01-10 22:18:50 +01:00