mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
19168d0934
The problem with the previous implementation was that the table's $this->prefs can contain valid non-empty value in its default state - the default column to sort by. On resetting, we must not throw away these default prefs. This patch simplifies the TABLE_VAR_RESET interpretation. If such an HTTP parameter is passed via the request, the table simply behaves as if there were no previously stored preferences (does not matter if coming from the current session, or from the persistent cross-session storage). The logic that decides on whether or not the reset widget should be displayed is put into a new method can_be_reset() with unit tests attached. Finally, the previously private method render_reset_button() is now protected and the reset widget is given a new semantic CSS class.