374 Commits

Author SHA1 Message Date
Mikel Martín
4d23fe8a58 MDL-81597 theme_boost: Fix header bar alignment
- Refactot context_header class to implement named templatable so
render_context_header in core and theme_boost can be removed
- Refactor context_header to use templates
- Fix context header layout and styles
2024-05-28 16:33:21 +02:00
Andrew Nicols
613f933442
Merge branch 'MDL-80820' of https://github.com/marinaglancy/moodle 2024-04-15 10:42:22 +08:00
Jun Pataleta
1c4f896883
MDL-70829 output: Remove the presentation role for html_writer::img()
* A presentation role is not necessary for the img tag.
  - If a non-empty alt text is provided, the presentation role will
  conflict with the alt text.
  - An empty alt text denotes a decorative image. The presence of a
  presentation role is redundant.
* Make sure that the alt text is set to an empty string. Otherwise,
  an img tag without an alt attribute will be produced which is an
  invalid markup.
2024-04-12 11:44:22 +08:00
Marina Glancy
ef1759da74 MDL-80820 various: fix incorrect phpdocs 2024-04-08 10:13:10 +01:00
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Paul Holden
87f865ea24
MDL-80768 output: stricter progress bar component percentage type.
Avoid mixing float/string types, where the decimal separator could
vary according to current locale.
2024-01-30 23:11:13 +00:00
Huong Nguyen
854ba5dc20 Merge branch 'MDL-80676-main' of https://github.com/junpataleta/moodle 2024-01-25 09:07:25 +07:00
Jun Pataleta
beadaddcd8
MDL-80676 core: Deprecate \action_menu_link::$instance
\action_menu_link::$instance is only being used to provide unique IDs
for the <span> tag that contains the text within the action menu link's
<a> tag. This <span> tag's ID is then being used for the action menu
link's <a> tag's aria-labelledby attribute which is totally unnecessary
given that the <span> tag is already within the action menu link and
already serves as the default label for the <a> tag.
2024-01-19 14:12:05 +08:00
Paul Holden
3f9277723b
MDL-80499 datafield_date: specify UTC time when editing field content. 2024-01-10 19:23:08 +00:00
David Woloszyn
cbbcacdd8f MDL-78426 core_theme: Move theme's settings to theme card
Theme selector and theme settings have been renamed. Theme admin
section has been removed and contents merged into Appearance category.
2023-11-20 17:05:35 +11:00
Ferran Recio
7fea815e0f MDL-78954 output: remove default chevron from kebab menus
Action menus have a method set_kebab_trigger that converts the action
menu button into a proper kebab icon. However, this method does not
remove the standard bootstrap dropdown chevron and the visual
information is replicated (kebab icon + chevron). For now this method is
only used a couple of times but in every case (grade, course...) they
add unnecessary adhoc css rules to hide the chevron when it should be
the standard behaviour. This commit remove the chevron when the action
menu is displayed as a kebab menu.
2023-08-21 13:19:22 +02:00
Amaia Anabitarte
36b865b3d9 MDL-78746 formslib: add variables to addHelpButton()
addHelpButton() function should allow to get variables to pass to get_string
to improve help button text.
2023-08-11 11:13:29 +02:00
Ferran Recio
105324e6fd MDL-78665 output: add subpanels to action menu
Many times the action menu item triggers modals to show more information
to the user. In most cases this is enough, however, a modal will close
the menu and the user is not able to see the modal content in the page
context. To solve this now menus can define subpanels that are displayed
next the the menu item when the item is focused or hover. This will be
used to group options like the group mode in activities or to replace
the adhoc solution implemented to select language in the user menu.
2023-08-04 16:09:29 +02:00
Shamim Rezaie
8207eaa5d3 MDL-77375 output: Deprecate action_menu::set_constraint() 2023-07-02 00:41:22 +10:00
Shamim Rezaie
aaadb0d6ef MDL-77375 output: Allow additional options for dropdowns 2023-06-30 11:24:45 +10:00
Meirza
97ff68fd6b MDL-78159 lib: Added missing properties for core libraries
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-06-21 15:39:53 +07:00
Brendan Heywood
73ed05ecf2 MDL-78341 core: Improve the progress bar style 2023-06-14 09:09:43 +10:00
Sara Arjona
253b66ec81 Merge branch 'MDL-78308' of https://github.com/paulholden/moodle 2023-06-08 06:48:27 +02:00
Paul Holden
0f134c563d
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:22 +01:00
Paul Holden
af42f88c42
MDL-78225 output: add sesskey for post requests only in renderables. 2023-05-11 22:46:18 +01:00
Sara Arjona
9ce4fb65fd Merge branch 'MDL-77164-master' of https://github.com/marinaglancy/moodle 2023-04-13 14:00:18 +02:00
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Anupama Sarjoshi
e6a3295fba 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 13:22:01 +01:00
Sara Arjona
ae53d04144 Merge branch 'MDL-75337-master' of https://github.com/laurentdavid/moodle 2023-01-24 16:07:35 +01:00
Laurent David
377c962f11 MDL-75337 core: Single button - API changes
* Update component library for new features of single_button and modal
    * Update core_notification javascript
2023-01-23 13:45:21 +01:00
Marina Glancy
b0a83aa7bd 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:15:54 +08:00
Jun Pataleta
fad05d7929 Merge branch 'MDL-76583-master-withoutrename' of https://github.com/andrewnicols/moodle 2023-01-19 09:44:48 +08:00
Andrew Nicols
a3cc26f8bb MDL-76583 core: Update uses of external_* classes 2023-01-19 07:34:09 +08:00
Jun Pataleta
aedbfba858 Merge branch 'MDL-76358-master' of https://github.com/laurentdavid/moodle 2023-01-16 09:32:56 +08:00
Laurent David
45317d6db5 MDL-76358 mod_data: Add options to preset menu
* Add "Preview" and "Use this preset" menus to the preset plugin page's
burger menu
* Refactor importmapping dialogue to use the 'data-action' selector
* Add a new set_kebab_trigger action menu method
* Use set_additional_classes method for action menu
* Remove redundant parameter to add_action_menu
2023-01-11 10:59:04 +01:00
Mathew May
d83fcf1976 MDL-76134 core: Provide a option to render initials bars smaller 2023-01-09 09:22:20 +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