Files
moodle/lib/db/hooks.php
T
Andrew Nicols b9a5ed7737 MDL-83245 core_files: Update file redaction API
This change:
- Moves the API to use the `before_file_created` hook
- Remove the newly created `$notify` param for `after_file_created` hook
- Stop persisting redactable content
- Update manager to not deal with `stored_file` instances
- Correct namespace from `\core\filereact` to `\core_files\redactor`
- Add `redactor` as a valid L2 namespace within the `core_files` API
- Correct config setting names
- Adds missing unit tests
- Disables the service for PHPUnit tests

AMOS BEGIN
  MOV [fileredact,core_files],[redactor,core_files]
  MOV [fileredact,core_files],[redactor:exifremover,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:emptyremovetags,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:enabled,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:enabled_desc,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:failedprocessexiftool,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:failedprocessgd,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:heading,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:mimetype,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:mimetype_desc,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:removetags,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:removetags_desc,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:tag:all,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:tag:gps,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:tooldoesnotexist,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:toolpath,core_files]
  MOV [fileredact,core_files],[redactor:exifremover:toolpath_desc,core_files]
AMOS END
2024-09-26 11:24:17 +08:00

118 lines
4.9 KiB
PHP

<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Hook listener callbacks.
*
* @package core
* @copyright 2023 Safat Shahin <safat.shahin@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$callbacks = [
[
'hook' => \core_group\hook\after_group_created::class,
'callback' => \core_communication\hook_listener::class . '::create_group_communication',
],
[
'hook' => \core_group\hook\after_group_updated::class,
'callback' => \core_communication\hook_listener::class . '::update_group_communication',
],
[
'hook' => \core_group\hook\after_group_deleted::class,
'callback' => \core_communication\hook_listener::class . '::delete_group_communication',
],
[
'hook' => \core_group\hook\after_group_membership_added::class,
'callback' => \core_communication\hook_listener::class . '::add_members_to_group_room',
],
[
'hook' => \core_group\hook\after_group_membership_removed::class,
'callback' => \core_communication\hook_listener::class . '::remove_members_from_group_room',
],
[
'hook' => \core_course\hook\after_course_created::class,
'callback' => \core_communication\hook_listener::class . '::create_course_communication',
],
[
'hook' => \core_course\hook\after_course_updated::class,
'callback' => \core_communication\hook_listener::class . '::update_course_communication',
],
[
'hook' => \core_course\hook\before_course_deleted::class,
'callback' => \core_communication\hook_listener::class . '::delete_course_communication',
],
[
'hook' => \core_user\hook\before_user_updated::class,
'callback' => \core_communication\hook_listener::class . '::update_user_room_memberships',
],
[
'hook' => \core_user\hook\before_user_deleted::class,
'callback' => \core_communication\hook_listener::class . '::delete_user_room_memberships',
],
[
'hook' => \core\hook\access\after_role_assigned::class,
'callback' => \core_communication\hook_listener::class . '::update_user_membership_for_role_changes',
],
[
'hook' => \core\hook\access\after_role_unassigned::class,
'callback' => \core_communication\hook_listener::class . '::update_user_membership_for_role_changes',
],
[
'hook' => \core_enrol\hook\after_enrol_instance_status_updated::class,
'callback' => \core_communication\hook_listener::class . '::update_communication_memberships_for_enrol_status_change',
],
[
'hook' => \core_enrol\hook\before_enrol_instance_deleted::class,
'callback' => \core_communication\hook_listener::class . '::remove_communication_memberships_for_enrol_instance_deletion',
],
[
'hook' => \core_enrol\hook\after_user_enrolled::class,
'callback' => \core_communication\hook_listener::class . '::add_communication_membership_for_enrolled_user',
],
[
'hook' => \core_enrol\hook\before_user_enrolment_updated::class,
'callback' => \core_communication\hook_listener::class . '::update_communication_membership_for_updated_user_enrolment',
],
[
'hook' => \core_enrol\hook\before_user_enrolment_removed::class,
'callback' => \core_communication\hook_listener::class . '::remove_communication_membership_for_unenrolled_user',
],
[
'hook' => \core\hook\output\before_standard_footer_html_generation::class,
'callback' => \core_userfeedback::class . '::before_standard_footer_html_generation',
],
[
'hook' => \core\hook\output\after_standard_main_region_html_generation::class,
'callback' => \core_message\hook_callbacks::class . '::add_messaging_widget',
'priority' => 0,
],
[
'hook' => \core\hook\task\after_failed_task_max_delay::class,
'callback' => core\task\failed_task_callbacks::class . '::send_failed_task_max_delay_message',
],
[
'hook' => \core\hook\di_configuration::class,
'callback' => [\core\router\hook_callbacks::class, 'provide_di_configuration'],
],
[
'hook' => \core_files\hook\before_file_created::class,
'callback' => [\core_files\redactor\hook_listener::class, 'file_redaction_handler'],
],
];