Commit Graph

197 Commits

Author SHA1 Message Date
Paul Holden a0d5133f10 MDL-81781 dataformat: public helper method to get writer instance. 2024-06-07 11:29:10 +01:00
Andrew Nicols 613f933442 Merge branch 'MDL-80820' of https://github.com/marinaglancy/moodle 2024-04-15 10:42:22 +08:00
Andrew Nicols ab70c74a04 MDL-81327 core: Remove unnecessary table filter
The \Traversable interface does not define the `valid` method.
Furthermore, the `valid` method actually checks that there is a _next_
value, which requires the value already be fetched and waiting. This is
not the case for all Iterators. For example the CallbackFilterIterator
does not load the initial value until it is requested.

It is completely unnecessary to do this check anyway as an invalid
Iterator will just not return any values.
2024-04-09 15:10:37 +02:00
Marina Glancy ef1759da74 MDL-80820 various: fix incorrect phpdocs 2024-04-08 10:13:10 +01:00
Luca Bösch 6bb59759e7 MDL-80082 table: Output 'Nothing to display' as notification. 2024-02-19 15:10:32 +01:00
Andrew Nicols 85c1dd0077 MDL-80072 core: Deprecate format_text smiley option
This was actually deprecated in Moodle 2.0 but did not emit.
2024-02-12 11:11:18 +08:00
Simey Lameze 6af7654d8d MDL-80538 phpdoc: add missing null parameter type to phpdoc 2024-02-01 12:06:43 +08:00
info@eWallah.net 8e62bcd9aa MDL-80538 phpdoc: Incorrect dataformat type documentation in table lib 2024-01-30 15:22:53 +01:00
danghieu1407 34bc6214dc MDL-78556 tablelib: flexible_table should support caption tag 2023-07-11 13:40:33 +07:00
Lior Gil f92437428e MDL-76629 core_table: add sticky column option 2023-06-19 12:46:29 +03:00
Marina Glancy 8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Andrew Nicols f4a48a517b MDL-76867 core_table: Allow dynamic table filterset to be specified
The previous behaviour guessed the table filterset based on the table's
class name, but this is not very flexible if you wish to create an
abstract table class and use a generic filter for all implementations.

This change adds the ability to specify the filterset class, with the
default behaviour using the table class name as a prefix.
2023-03-14 08:44:15 +08:00
Mikel Martín 86311f5a40 MDL-77150 core_table: Fix classes added as columnsattributes are ignored
Fix columnattributes with key 'class' being ingored by adding them to every 'column_class'.
2023-02-28 16:19:19 +01:00
Andrew Nicols ef09257dc1 MDL-76362 core: Use empty default string when getting prefs
The json_decode function does not accept a null, which is the
traditional default for get_user_preferences. By passing a default of
am empty string we avoid issues in PHP 8.1.
2023-01-23 09:15:54 +08: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
Marina Glancy a800e7e62f MDL-74853 various: add second parameter to htmlentities functions
Default value of the $flag argument changed in PHP 8.1 from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE
To ensure consistent behavior across different PHP version the second parameter is now required for the functions:
htmlspecialchars(), htmlentities(), htmlspecialchars_decode(), html_entity_decode() and get_html_translation_table()
2022-11-28 16:12:20 +01:00
Shamim Rezaie 178c51786c MDL-68550 tablelib: Use aria-role=button
Use the aria-role=button for:
 - show/hide links
 - sort links
 - reset table preferences link
2022-11-10 06:14:01 +11:00
Ilya Tregubov 1a89fd6287 Merge branch 'MDL-72058' of https://github.com/paulholden/moodle 2022-10-20 15:43:02 +03:00
Paul Holden 703f0b2a03 MDL-72058 dataformat: remove HTML when export format lacks support. 2022-10-03 09:16:06 +01:00
Alex Morris fee755bbfa MDL-75170 tablelib: Use sql_order_by_null to sort columns 2022-09-30 11:29:27 +13:00
Mikel Martín eab63e82a1 MDL-72565 tablelib: Add modifications needed for report card view
- new 'set_columns_attributes' method created to add column attributes included in every column cell.
- new 'get_row_cells_html' method created from 'get_row_html', so it can be overriden individually.
2021-11-11 13:55:31 +01:00
Simeon Naydenov 3edf6b02e3 MDL-71375 lib: Fix tooltip in show_hide_icon in flexible table 2021-08-30 09:39:31 +08:00
Paul Holden a4a3721081 MDL-71070 reportbuilder: consistent user fullname columns sorting.
Report columns that display the fullname of users should behave
in a consistent manner with current functionality of tables, in
regards to sorting by each individual component of a name (first
name, middle name, surname, etc).

To facilitate this, instead of a hard-coded assumption that such
columns are always named 'fullname', table classes can now define
additional columns containing a users name.
2021-08-03 12:05:59 +01:00
Eloy Lafuente (stronk7) 3ed772f418 Merge branch 'MDL-71099-master' of https://github.com/sammarshallou/moodle 2021-03-27 10:17:43 +01: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
Mikel Martín 2471e6ec8d MDL-70871 table: Add 'Show all X' functionality to dynamic_table 2021-03-23 09:55:16 +01: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
Marina Glancy 9cfacff738 MDL-65552 user: escape idnumber and email in table_sql 2021-03-03 23:15:07 +08:00
Paul Holden 70936e0c5e MDL-69201 core: consistent table primary sort column/order. 2020-11-09 19:45:49 +00:00
Michael Hawkins c2f188311e MDL-69336 lib: Reinstating tablelib column show/hide functionality
Also added behat testing for hide/show columns in participants table.
2020-08-04 15:18:39 +08:00
Andrew Nicols a95f458cde MDL-69110 table: Remove commented code 2020-07-06 13:25:31 +08:00
Jun Pataleta b583c46297 MDL-69110 core: Unset the correct sort data element 2020-07-04 00:47:14 +08:00
Andrew Nicols c4bd1858db MDL-67743 table: Sort direction is an integer 2020-05-27 11:16:24 +08:00
Andrew Nicols 7d02452504 Merge branch 'MDL-67547' of https://github.com/paulholden/moodle 2020-05-26 08:06:39 +08:00
Andrew Nicols a31a2b6d54 MDL-68508 core_table: Improve sorting to support sorting by multiple columns 2020-05-22 10:42:30 +08:00
Andrew Nicols ed23725bc6 MDL-68463 user: Update select/show [count] links dynamically 2020-05-18 20:03:38 +08:00
Simey Lameze d717918c87 MDL-68417 core_table: add some css styling to loading icon 2020-05-12 21:44:42 +08:00
Simey Lameze c0db61e45f MDL-68462 core_table: add missing global 2020-05-06 14:40:33 +08:00
Simey Lameze 68c46a28d6 MDL-68462 core_table: add support for reset table preferences 2020-05-06 09:44:39 +08:00
Paul Holden 118a109499 MDL-67547 dataformat: allow plugins to declare support for HTML. 2020-05-05 19:23:32 +01:00
Andrew Nicols 5615a772a6 MDL-68454 table: Move guessing of base URL to flexible 2020-05-04 11:52:19 +08:00
Andrew Nicols 56143dd622 MDL-68454 table: Move filterset functionality to flexible_table 2020-05-04 11:52:19 +08:00
Andrew Nicols c00552b3b0 MDL-68454 table: Move get_context from dynamic to flexible 2020-05-04 11:52:19 +08:00
Simey Lameze e2f12c2220 MDL-67915 core_table: add support for hide and show of columns 2020-04-24 18:23:34 +08:00
Simey Lameze 4cf97b7f42 MDL-68341 core_table: add component parameter to fetch WS 2020-04-21 10:28:01 +08:00
Simey Lameze f7b84afe15 MDL-68288 core_table: support pagination bar for dynamic tables 2020-04-09 07:06:35 +08:00
Andrew Nicols 7aa6398830 Merge branch 'MDL-68148-master' of git://github.com/rezaies/moodle 2020-04-08 11:20:39 +08:00
Shamim Rezaie 0ad48a3e68 MDL-68148 core: remove cellspacing
The cellspacing attribute of <table> is not supported in HTML5.
So the removed line did not have any effect since ages ago.
2020-04-08 11:22:34 +10:00
Andrew Nicols c540a575db MDL-68286 table: Support initials bar for dynamic tables 2020-04-03 16:54:13 +08:00
Andrew Nicols 1c112ac5fd MDL-68286 table: Empty tables need the dynamic table wrapper 2020-04-03 12:08:48 +08:00