MDL-85897 core: Move all deprecations to emit_deprecation
This commit is contained in:
@@ -31,6 +31,6 @@ class core_availability_renderer extends plugin_renderer_base {
|
||||
*/
|
||||
#[\core\attribute\deprecated(availability_info::class, since: '4.0', mdl: 'MDL-71691', final: true)]
|
||||
public function render_core_availability_multiple_messages(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ abstract class base_controller extends backup implements loggable {
|
||||
*/
|
||||
#[\core\attribute\deprecated(since: '4.1', mdl: 'MDL-74548', final: true)]
|
||||
public function set_copy(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,6 +119,6 @@ abstract class base_controller extends backup implements loggable {
|
||||
*/
|
||||
#[\core\attribute\deprecated('restore_controller::get_copy()', since: '4.1', mdl: 'MDL-74548', final: true)]
|
||||
public function get_copy() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ class course_badges extends system_report {
|
||||
*/
|
||||
#[\core\attribute\deprecated('course_badges::initialise', since: '4.5', mdl: 'MDL-82503')]
|
||||
protected function initialise(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $USER;
|
||||
// Our main entity, it contains all of the column definitions that we need.
|
||||
$badgeentity = new badge();
|
||||
@@ -103,7 +103,7 @@ class course_badges extends system_report {
|
||||
*/
|
||||
#[\core\attribute\deprecated('course_badges::can_view', since: '4.5', mdl: 'MDL-82503')]
|
||||
protected function can_view(): bool {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
return has_capability('moodle/badges:viewbadges', $this->get_context());
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ class course_badges extends system_report {
|
||||
*/
|
||||
#[\core\attribute\deprecated('course_badges::add_columns', since: '4.5', mdl: 'MDL-82503')]
|
||||
protected function add_columns(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$badgeissuedalias = $this->get_entity('badge_issued')->get_table_alias('badge_issued');
|
||||
|
||||
$this->add_columns_from_entities([
|
||||
@@ -156,7 +156,7 @@ class course_badges extends system_report {
|
||||
*/
|
||||
#[\core\attribute\deprecated('course_badges::add_filters', since: '4.5', mdl: 'MDL-82503')]
|
||||
protected function add_filters(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$this->add_filters_from_entities([
|
||||
'badge:name',
|
||||
'badge_issued:issued',
|
||||
|
||||
@@ -71,7 +71,7 @@ class core_course_management_renderer extends plugin_renderer_base {
|
||||
final: true,
|
||||
)]
|
||||
public function management_heading() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1286,7 +1286,7 @@ class core_course_management_renderer extends plugin_renderer_base {
|
||||
final: true,
|
||||
)]
|
||||
public function course_search_form() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -71,7 +71,7 @@ class completion {
|
||||
*/
|
||||
#[\core\attribute\deprecated(null, mdl: 'MDL-82467', since: '4.5')]
|
||||
public static function get_days(?int $value, stdClass $row): ?int {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
|
||||
// Do not show anything if there is no userid.
|
||||
if (!$row->userid) {
|
||||
|
||||
+2
-2
@@ -420,7 +420,7 @@ class enrol_self_plugin extends enrol_plugin {
|
||||
*/
|
||||
#[\core\attribute\deprecated('enrol_plugin::send_course_welcome_message_to_user', since: '4.4', mdl: 'MDL-4188')]
|
||||
protected function email_welcome_message($instance, $user) {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
$this->send_course_welcome_message_to_user(
|
||||
instance: $instance,
|
||||
userid: $user->id,
|
||||
@@ -1193,7 +1193,7 @@ class enrol_self_plugin extends enrol_plugin {
|
||||
*/
|
||||
#[\core\attribute\deprecated('enrol_plugin::get_welcome_message_contact', since: '4.4', mdl: 'MDL-4188')]
|
||||
public function get_welcome_email_contact($sendoption, $context) {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
return $this->get_welcome_message_contact(
|
||||
sendoption: $sendoption,
|
||||
context: $context,
|
||||
|
||||
+2
-2
@@ -58,7 +58,7 @@ class core_grades_renderer extends plugin_renderer_base {
|
||||
public function group_selector(object $course, ?string $groupactionbaseurl = null): ?string {
|
||||
global $USER;
|
||||
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
|
||||
if ($groupactionbaseurl !== null) {
|
||||
debugging(
|
||||
@@ -139,7 +139,7 @@ class core_grades_renderer extends plugin_renderer_base {
|
||||
): stdClass {
|
||||
global $SESSION, $COURSE;
|
||||
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
// User search.
|
||||
$searchvalue = optional_param('gpr_search', null, PARAM_NOTAGS);
|
||||
$userid = optional_param('grp_userid', null, PARAM_INT);
|
||||
|
||||
@@ -244,7 +244,7 @@ class behat_grade extends behat_base {
|
||||
*/
|
||||
#[\core\attribute\deprecated('behat_forms::i_set_the_field_to', since: '4.0', final: true)]
|
||||
protected function select_in_gradebook_tabs() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -307,6 +307,6 @@ class behat_grade extends behat_base {
|
||||
*/
|
||||
#[\core\attribute\deprecated('behat_forms::i_set_the_field_to', since: '4.1', final: true)]
|
||||
protected function select_in_gradebook_navigation_selector() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ class admin_settings_aws_region extends \admin_setting_configtext {
|
||||
mdl: 'MDL-80962',
|
||||
)]
|
||||
public function output_html($data, $query='') {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $CFG, $OUTPUT;
|
||||
|
||||
$default = $this->get_defaultsetting();
|
||||
|
||||
@@ -42,7 +42,7 @@ class aws_helper {
|
||||
mdl: 'MDL-80962',
|
||||
)]
|
||||
public static function get_proxy_string(): string {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
global $CFG;
|
||||
$proxy = '';
|
||||
if (empty($CFG->proxytype)) {
|
||||
@@ -79,7 +79,7 @@ class aws_helper {
|
||||
mdl: 'MDL-80962',
|
||||
)]
|
||||
public static function configure_client_proxy(AwsClient $client): AwsClient {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
$client->getHandlerList()->appendBuild(self::add_proxy_when_required(), 'proxy_bypass');
|
||||
return $client;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ class aws_helper {
|
||||
mdl: 'MDL-80962',
|
||||
)]
|
||||
protected static function add_proxy_when_required(): callable {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
return function (callable $fn) {
|
||||
return function (CommandInterface $command, ?RequestInterface $request = null) use ($fn) {
|
||||
if (isset($request)) {
|
||||
|
||||
@@ -41,7 +41,7 @@ class client_factory {
|
||||
mdl: 'MDL-80962',
|
||||
)]
|
||||
public static function get_client(string $class, array $opts): AwsClient {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
// Modify the opts to add HTTP timeouts.
|
||||
if (empty($opts['http'])) {
|
||||
$opts['http'] = ['connect_timeout' => HOURSECS];
|
||||
|
||||
@@ -1399,7 +1399,7 @@ class core_renderer extends renderer_base {
|
||||
mdl: 'MDL-83164',
|
||||
)]
|
||||
protected function render_action_menu_link(\action_menu_link $action) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
return $this->render_action_menu__link($action);
|
||||
}
|
||||
|
||||
@@ -1412,7 +1412,7 @@ class core_renderer extends renderer_base {
|
||||
mdl: 'MDL-83164',
|
||||
)]
|
||||
protected function render_action_menu_filler(\action_menu_filler $action) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
return $this->render_action_menu__filler($action);
|
||||
}
|
||||
|
||||
@@ -1425,7 +1425,7 @@ class core_renderer extends renderer_base {
|
||||
mdl: 'MDL-83164',
|
||||
)]
|
||||
protected function render_action_menu_primary(\action_menu_link $action) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
return $this->render_action_menu__link_primary($action);
|
||||
}
|
||||
|
||||
@@ -1438,7 +1438,7 @@ class core_renderer extends renderer_base {
|
||||
mdl: 'MDL-83164',
|
||||
)]
|
||||
protected function render_action_menu_secondary(\action_menu_link $action) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
return $this->render_action_menu__link_secondary($action);
|
||||
}
|
||||
|
||||
|
||||
@@ -429,7 +429,7 @@ class renderer_base {
|
||||
*/
|
||||
#[\core\attribute\deprecated(null, reason: 'It is no longer used', since: '4.0', final: true)]
|
||||
public function should_display_main_logo() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -96,7 +96,7 @@ class report_helper {
|
||||
*/
|
||||
#[\core\attribute\deprecated(null, reason: 'It is no longer used', since: '4.0', final: true)]
|
||||
public static function save_selected_report() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -896,7 +896,7 @@ class manager {
|
||||
since: '4.5',
|
||||
)]
|
||||
public static function kill_all_sessions(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
self::destroy_all();
|
||||
}
|
||||
|
||||
@@ -913,7 +913,7 @@ class manager {
|
||||
since: '4.5',
|
||||
)]
|
||||
public static function kill_session($sid): void {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
self::destroy($sid);
|
||||
}
|
||||
|
||||
@@ -930,7 +930,7 @@ class manager {
|
||||
since: '4.5',
|
||||
)]
|
||||
public static function kill_sessions_for_auth_plugin(string $pluginname): void {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
self::destroy_by_auth_plugin($pluginname);
|
||||
}
|
||||
|
||||
@@ -947,7 +947,7 @@ class manager {
|
||||
since: '4.5',
|
||||
)]
|
||||
public static function kill_user_sessions($userid, $keepsid = null) {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
self::destroy_user_sessions($userid, $keepsid);
|
||||
}
|
||||
|
||||
|
||||
@@ -672,7 +672,7 @@ class manager {
|
||||
*/
|
||||
#[\core\attribute\deprecated('\core\task\manager::get_next_adhoc_task()', since: '4.1', mdl: 'MDL-67648', final: true)]
|
||||
public static function ensure_adhoc_task_qos(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -131,7 +131,7 @@ abstract class task_base {
|
||||
reason: 'Blocking tasks are no longer supported',
|
||||
)]
|
||||
public function set_blocking($blocking) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,7 +147,7 @@ abstract class task_base {
|
||||
reason: 'Blocking tasks are no longer supported',
|
||||
)]
|
||||
public function is_blocking() {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ class core_text {
|
||||
final: true,
|
||||
)]
|
||||
public static function reset_caches(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+19
-19
@@ -47,7 +47,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
*/
|
||||
#[\core\attribute\deprecated('core_component::get_core_subsystems', since: '4.5', mdl: 'MDL-82287')]
|
||||
function get_core_subsystems($fullpaths = false) {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
global $CFG;
|
||||
|
||||
$subsystems = core_component::get_core_subsystems();
|
||||
@@ -79,7 +79,7 @@ function get_core_subsystems($fullpaths = false) {
|
||||
*/
|
||||
#[\core\attribute\deprecated('core_component::get_plugin_types', since: '4.5', mdl: 'MDL-82287')]
|
||||
function get_plugin_types($fullpaths = true) {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
global $CFG;
|
||||
|
||||
$types = core_component::get_plugin_types();
|
||||
@@ -112,7 +112,7 @@ function get_plugin_types($fullpaths = true) {
|
||||
*/
|
||||
#[\core\attribute\deprecated('core_component::get_plugin_list', since: '4.5', mdl: 'MDL-82287')]
|
||||
function get_plugin_list($plugintype) {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
|
||||
if ($plugintype === '') {
|
||||
$plugintype = 'mod';
|
||||
@@ -137,7 +137,7 @@ function get_plugin_list($plugintype) {
|
||||
*/
|
||||
#[\core\attribute\deprecated('core_component::get_plugin_list_with_class', since: '4.5', mdl: 'MDL-82287')]
|
||||
function get_plugin_list_with_class($plugintype, $class, $file) {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
return core_component::get_plugin_list_with_class($plugintype, $class, $file);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ function get_plugin_list_with_class($plugintype, $class, $file) {
|
||||
*/
|
||||
#[\core\attribute\deprecated('core_component::get_plugin_directory', since: '4.5', mdl: 'MDL-82287')]
|
||||
function get_plugin_directory($plugintype, $name) {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
if ($plugintype === '') {
|
||||
$plugintype = 'mod';
|
||||
}
|
||||
@@ -168,7 +168,7 @@ function get_plugin_directory($plugintype, $name) {
|
||||
*/
|
||||
#[\core\attribute\deprecated('core_component::normalize_component', since: '4.5', mdl: 'MDL-82287')]
|
||||
function normalize_component($component) {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
return core_component::normalize_component($component);
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ function normalize_component($component) {
|
||||
*/
|
||||
#[\core\attribute\deprecated('core_component::get_component_directory', since: '4.5', mdl: 'MDL-82287')]
|
||||
function get_component_directory($component) {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
return core_component::get_component_directory($component);
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ function get_component_directory($component) {
|
||||
*/
|
||||
#[\core\attribute\deprecated('\core\context::instance', since: '2.2', mdl: 'MDL-34472', final: true)]
|
||||
function get_context_instance() {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -199,7 +199,7 @@ function get_context_instance() {
|
||||
*/
|
||||
#[\core\attribute\deprecated('Not replaced', since: '2.0', mdl: 'MDL-19756', final: true)]
|
||||
function can_use_rotated_text() {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -207,7 +207,7 @@ function can_use_rotated_text() {
|
||||
*/
|
||||
#[\core\attribute\deprecated('\core\context\system::instance', since: '2.2', mdl: 'MDL-34472', final: true)]
|
||||
function get_system_context() {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,7 +218,7 @@ function get_system_context() {
|
||||
*/
|
||||
#[\core\attribute\deprecated('OUTPUT->[l|r]arrow', since: '2.0', mdl: 'MDL-19756', final: true)]
|
||||
function print_arrow() {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -226,7 +226,7 @@ function print_arrow() {
|
||||
*/
|
||||
#[\core\attribute\deprecated('category_action_bar tertiary navigation', since: '4.0', mdl: 'MDL-73462', final: true)]
|
||||
function print_course_request_buttons() {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -503,7 +503,7 @@ function rc4decrypt($data) {
|
||||
*/
|
||||
#[\core\attribute\deprecated(\core\encryption::class, since: '4.5', mdl: 'MDL-81940')]
|
||||
function endecrypt($pwd, $data, $case) {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
|
||||
if ($case == 'de') {
|
||||
$data = urldecode($data);
|
||||
@@ -648,7 +648,7 @@ function question_fix_top_names() {
|
||||
*/
|
||||
#[\core\attribute\deprecated('search_generate_SQL', since: '2.9', mdl: 'MDL-48939', final: true)]
|
||||
function search_generate_text_SQL() {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -656,7 +656,7 @@ function search_generate_text_SQL() {
|
||||
*/
|
||||
#[\core\attribute\deprecated('This method should not be used', since: '4.5', mdl: 'MDL-80275', final: true)]
|
||||
function disable_output_buffering(): void {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
}
|
||||
|
||||
|
||||
@@ -676,7 +676,7 @@ function disable_output_buffering(): void {
|
||||
*/
|
||||
#[\core\attribute\deprecated('This method should not be used', since: '4.5', mdl: 'MDL-82157')]
|
||||
function print_grade_menu($courseid, $name, $current, $includenograde=true, $return=false) {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
global $OUTPUT;
|
||||
|
||||
$output = '';
|
||||
@@ -723,7 +723,7 @@ function print_grade_menu($courseid, $name, $current, $includenograde=true, $ret
|
||||
reason: 'It is no longer used',
|
||||
)]
|
||||
function reset_password_and_mail($user) {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
global $CFG;
|
||||
|
||||
$site = get_site();
|
||||
@@ -770,7 +770,7 @@ function reset_password_and_mail($user) {
|
||||
final: true,
|
||||
)]
|
||||
function plagiarism_get_file_results(): void {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -783,5 +783,5 @@ function plagiarism_get_file_results(): void {
|
||||
final: true,
|
||||
)]
|
||||
function plagiarism_update_status(): void {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
}
|
||||
|
||||
+25
-25
@@ -101,7 +101,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function __construct($type='ul', $attributes='', $editable = false, $pageurl=null, $page = 0, $pageparamname = 'page', $itemsperpage = 20) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $PAGE;
|
||||
|
||||
$this->editable = $editable;
|
||||
@@ -126,7 +126,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function to_html($indent=0, $extraargs=array()) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
if (count($this->items)) {
|
||||
$tabs = str_repeat("\t", $indent);
|
||||
$first = true;
|
||||
@@ -171,7 +171,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function find_item($id, $suppresserror = false) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
if (isset($this->items)) {
|
||||
foreach ($this->items as $key => $child) {
|
||||
if ($child->id == $id) {
|
||||
@@ -202,7 +202,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function add_item($item) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$this->items[] = $item;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function set_parent($parent) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$this->parentitem = $parent;
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function list_from_records($paged = false, $offset = 0) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$this->paged = $paged;
|
||||
$this->offset = $offset;
|
||||
$this->get_records();
|
||||
@@ -296,7 +296,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function display_page_numbers() {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$html = '';
|
||||
$topcount = count($this->items);
|
||||
$this->pagecount = (integer) ceil(($topcount + $this->offset)/ QUESTION_PAGE_LENGTH );
|
||||
@@ -325,7 +325,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function get_items_peers($itemid) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$itemref = $this->find_item($itemid);
|
||||
$peerids = $itemref->parentlist->get_child_ids();
|
||||
return $peerids;
|
||||
@@ -339,7 +339,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function get_child_ids() {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$childids = array();
|
||||
foreach ($this->items as $child) {
|
||||
$childids[] = $child->id;
|
||||
@@ -357,7 +357,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function get_top_level_parent_id($item) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
return 0; // Top level items have no parent.
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function move_item_up_down($direction, $id) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$peers = $this->get_items_peers($id);
|
||||
$itemkey = array_search($id, $peers);
|
||||
switch ($direction) {
|
||||
@@ -407,7 +407,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function reorder_peers($peers) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $DB;
|
||||
foreach ($peers as $key => $peer) {
|
||||
$DB->set_field($this->table, "sortorder", $key, array("id"=>$peer));
|
||||
@@ -423,7 +423,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function move_item_left($id) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $DB;
|
||||
|
||||
$item = $this->find_item($id);
|
||||
@@ -452,7 +452,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function move_item_right($id) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $DB;
|
||||
|
||||
$peers = $this->get_items_peers($id);
|
||||
@@ -484,7 +484,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function process_actions($left, $right, $moveup, $movedown) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
//should this action be processed by this list object?
|
||||
if (!(array_key_exists($left, $this->records) || array_key_exists($right, $this->records) || array_key_exists($moveup, $this->records) || array_key_exists($movedown, $this->records))) {
|
||||
return false;
|
||||
@@ -532,7 +532,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function item_is_first_on_page($itemid) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
return $this->page && isset($this->items[$this->firstitem]) &&
|
||||
$itemid == $this->items[$this->firstitem]->id;
|
||||
}
|
||||
@@ -545,7 +545,7 @@ abstract class moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function item_is_last_on_page($itemid) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
return $this->page && isset($this->items[$this->lastitem]) &&
|
||||
$itemid == $this->items[$this->lastitem]->id;
|
||||
}
|
||||
@@ -592,7 +592,7 @@ abstract class list_item {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function __construct($item, $parent, $attributes = '', $display = true) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$this->item = $item;
|
||||
if (is_object($this->item)) {
|
||||
$this->id = $this->item->id;
|
||||
@@ -613,7 +613,7 @@ abstract class list_item {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function item_html($extraargs = array()) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
if (is_string($this->item)) {
|
||||
$html = $this->item;
|
||||
} elseif (is_object($this->item)) {
|
||||
@@ -635,7 +635,7 @@ abstract class list_item {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function to_html($indent = 0, $extraargs = array()) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
if (!$this->display) {
|
||||
return '';
|
||||
}
|
||||
@@ -660,7 +660,7 @@ abstract class list_item {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function set_icon_html($first, $last, $lastitem) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $CFG;
|
||||
$strmoveup = get_string('moveup');
|
||||
$strmovedown = get_string('movedown');
|
||||
@@ -721,7 +721,7 @@ abstract class list_item {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function image_icon($action, $url, $icon) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $OUTPUT;
|
||||
return '<a title="' . s($action) .'" href="'.$url.'">' .
|
||||
$OUTPUT->pix_icon('t/' . $icon, $action) . '</a> ';
|
||||
@@ -735,7 +735,7 @@ abstract class list_item {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function image_spacer() {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $OUTPUT;
|
||||
return $OUTPUT->spacer();
|
||||
}
|
||||
@@ -750,7 +750,7 @@ abstract class list_item {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function create_children(&$records, &$children, $thisrecordid) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
//keys where value is $thisrecordid
|
||||
$thischildren = moodle_array_keys_filter($children, $thisrecordid);
|
||||
foreach ($thischildren as $child) {
|
||||
@@ -770,7 +770,7 @@ abstract class list_item {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804.
|
||||
*/
|
||||
public function set_parent($parent) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$this->parentlist = $parent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2536,7 +2536,7 @@ class global_navigation extends navigation_node {
|
||||
mdl: 'MDL-82845',
|
||||
)]
|
||||
protected function load_section_activities(navigation_node $sectionnode, $sectionnumber, array $activities, $course = null) {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
if (!is_object($course)) {
|
||||
$activity = reset($activities);
|
||||
$courseid = $activity->course;
|
||||
|
||||
@@ -182,7 +182,7 @@ abstract class assign_feedback_plugin extends assign_plugin {
|
||||
*/
|
||||
#[\core\attribute\deprecated('get_grading_batch_operation_details', since: '4.5', mdl: 'MDL-80750')]
|
||||
public function get_grading_batch_operations() {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
|
||||
return array_column(static::get_grading_batch_operation_details(), 'confirmationtitle', 'key');
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class mod_assign_grading_batch_operations_form extends moodleform {
|
||||
mdl: 'MDL-80750'
|
||||
)]
|
||||
public function definition() {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
|
||||
global $CFG;
|
||||
$mform = $this->_form;
|
||||
|
||||
@@ -881,7 +881,7 @@ class assign_grading_table extends table_sql implements renderable {
|
||||
reason: 'Picture column is merged with fullname column'
|
||||
)]
|
||||
public function col_picture(stdClass $row) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
return $this->output->user_picture($row);
|
||||
}
|
||||
|
||||
@@ -1359,7 +1359,7 @@ class assign_grading_table extends table_sql implements renderable {
|
||||
public function col_userid(stdClass $row) {
|
||||
global $USER;
|
||||
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$edit = '';
|
||||
|
||||
$actions = array();
|
||||
|
||||
@@ -7368,7 +7368,7 @@ class assign {
|
||||
mdl: 'MDL-82681',
|
||||
)]
|
||||
protected function process_save_grading_options() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -172,7 +172,7 @@ class mod_data_renderer extends plugin_renderer_base {
|
||||
*/
|
||||
#[\core\attribute\deprecated(null, reason: 'It is no longer used', since: '4.5')]
|
||||
public function render_fields_footer(manager $manager): string {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
|
||||
$cm = $manager->get_coursemodule();
|
||||
$pageurl = new moodle_url('/mod/data/templates.php', ['id' => $cm->id]);
|
||||
|
||||
@@ -48,7 +48,7 @@ class renderer extends plugin_renderer_base {
|
||||
*/
|
||||
#[\core\attribute\deprecated(replacement: null, since: '4.5')]
|
||||
public function create_template_form(int $id) {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
|
||||
return $this->render_from_template('mod_feedback/create_template', ['id' => $id]);
|
||||
}
|
||||
|
||||
@@ -39,6 +39,6 @@ function feedback_get_completion_state() {
|
||||
#[\core\attribute\deprecated('is_role_switched', since: '4.5', mdl: 'MDL-72424')]
|
||||
function feedback_check_is_switchrole(): bool {
|
||||
global $USER;
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
return isset($USER->switchrole) && is_array($USER->switchrole) && count($USER->switchrole) > 0;
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ function forum_get_completion_state() {
|
||||
final: true
|
||||
)]
|
||||
function forum_update_subscriptions_button(): void {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -324,7 +324,7 @@ function quiz_calculate_best_attempt($quiz, $attempts) {
|
||||
*/
|
||||
#[\core\attribute\deprecated('override_manager::delete_override_by_id', since: '4.4')]
|
||||
function quiz_delete_override($quiz, $overrideid, $log = true) {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
$quizsettings = quiz_settings::create($quiz->id);
|
||||
$quizsettings->get_override_manager()->delete_overrides_by_id(
|
||||
ids: [$overrideid],
|
||||
@@ -344,7 +344,7 @@ function quiz_delete_override($quiz, $overrideid, $log = true) {
|
||||
*/
|
||||
#[\core\attribute\deprecated('override_manager::delete_all_overrides', since: '4.4')]
|
||||
function quiz_delete_all_overrides($quiz, $log = true) {
|
||||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
$quizsettings = quiz_settings::create($quiz->id);
|
||||
$quizsettings->get_override_manager()->delete_all_overrides(shouldlog: $log);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ class helper {
|
||||
mdl: 'MDL-72397'
|
||||
)]
|
||||
public static function question_is_only_child_of_top_category_in_context(int $categoryid): bool {
|
||||
\core\deprecation::emit_deprecation_if_present([__CLASS__, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([__CLASS__, __FUNCTION__]);
|
||||
$manager = new category_manager();
|
||||
return $manager->is_only_child_of_top_category_in_context($categoryid);
|
||||
}
|
||||
@@ -117,7 +117,7 @@ class helper {
|
||||
mdl: 'MDL-72397'
|
||||
)]
|
||||
public static function question_is_top_category(int $categoryid): bool {
|
||||
\core\deprecation::emit_deprecation_if_present([__CLASS__, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([__CLASS__, __FUNCTION__]);
|
||||
$manager = new category_manager();
|
||||
return $manager->is_top_category($categoryid);
|
||||
}
|
||||
@@ -138,7 +138,7 @@ class helper {
|
||||
mdl: 'MDL-72397'
|
||||
)]
|
||||
public static function question_can_delete_cat(int $todelete): void {
|
||||
\core\deprecation::emit_deprecation_if_present([__CLASS__, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([__CLASS__, __FUNCTION__]);
|
||||
$manager = new category_manager();
|
||||
$manager->require_can_delete_category($todelete);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ class question_category_list extends moodle_list {
|
||||
public function __construct($type='ul', $attributes='', $editable = false, $pageurl=null,
|
||||
$page = 0, $pageparamname = 'page',
|
||||
$itemsperpage = DEFAULT_QUESTIONS_PER_PAGE, $context = null) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
parent::__construct('ul', '', $editable, $pageurl, $page, 'cpage', $itemsperpage);
|
||||
$this->context = $context;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ class question_category_list extends moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804
|
||||
*/
|
||||
public function get_records(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$this->records = helper::get_categories_for_contexts($this->context->id, $this->sortby);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ class question_category_list extends moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804
|
||||
*/
|
||||
public function get_top_level_parent_id($item): int {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
// Put the item at the highest level it can go.
|
||||
$topcategory = question_get_top_category($item->item->contextid, true);
|
||||
return $topcategory->id;
|
||||
@@ -133,7 +133,7 @@ class question_category_list extends moodle_list {
|
||||
* @todo Final removal in Moodle 6.0 MDL-80804
|
||||
*/
|
||||
public function process_actions($left, $right, $moveup, $movedown): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$category = new stdClass();
|
||||
if (!empty($left)) {
|
||||
// Moved Left (In to another category).
|
||||
|
||||
@@ -39,7 +39,7 @@ class question_category_list_item extends \list_item {
|
||||
* @deprecated MDL-72397 Since Moodle 4.5
|
||||
*/
|
||||
public function set_icon_html($first, $last, $lastitem): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $CFG;
|
||||
$category = $this->item;
|
||||
$url = new moodle_url('/question/bank/managecategories/category.php',
|
||||
@@ -82,7 +82,7 @@ class question_category_list_item extends \list_item {
|
||||
* @deprecated MDL-72397 Since Moodle 4.5
|
||||
*/
|
||||
public function item_html($extraargs = []): string {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $PAGE, $OUTPUT;
|
||||
$str = $extraargs['str'];
|
||||
$category = $this->item;
|
||||
|
||||
@@ -92,7 +92,7 @@ class question_category_object {
|
||||
mdl: 'MDL-72397',
|
||||
)]
|
||||
public function __construct($page, $pageurl, $contexts, $currentcat, $defaultcategory, $todelete, $addcontexts) {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$this->tab = str_repeat(' ', $this->tabsize);
|
||||
|
||||
$this->str = new stdClass();
|
||||
@@ -139,7 +139,7 @@ class question_category_object {
|
||||
mdl: 'MDL-72397',
|
||||
)]
|
||||
public function initialize($page, $contexts, $currentcat, $defaultcategory, $todelete, $addcontexts): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$lastlist = null;
|
||||
foreach ($contexts as $context) {
|
||||
$this->editlists[$context->id] =
|
||||
@@ -176,7 +176,7 @@ class question_category_object {
|
||||
mdl: 'MDL-72397',
|
||||
)]
|
||||
public function display_user_interface(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
// Interface for editing existing categories.
|
||||
$this->output_edit_lists();
|
||||
}
|
||||
@@ -194,7 +194,7 @@ class question_category_object {
|
||||
mdl: 'MDL-72397',
|
||||
)]
|
||||
public function output_new_table(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$this->catform->display();
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ class question_category_object {
|
||||
mdl: 'MDL-72397',
|
||||
)]
|
||||
public function output_edit_lists(): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $OUTPUT;
|
||||
|
||||
echo $OUTPUT->heading_with_help(get_string('questioncategories', 'question'), 'editcategories', 'question');
|
||||
@@ -247,7 +247,7 @@ class question_category_object {
|
||||
mdl: 'MDL-72397',
|
||||
)]
|
||||
public function get_course_ids(array $categories): array {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$courseids = [];
|
||||
foreach ($categories as $key => $cat) {
|
||||
$courseids[$key] = $cat->course;
|
||||
@@ -272,7 +272,7 @@ class question_category_object {
|
||||
mdl: 'MDL-72397',
|
||||
)]
|
||||
public function edit_single_category(int $categoryid): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
// Interface for adding a new category.
|
||||
global $DB;
|
||||
|
||||
@@ -311,7 +311,7 @@ class question_category_object {
|
||||
mdl: 'MDL-72397',
|
||||
)]
|
||||
public function set_viable_parents(array &$parentstrings, object $category): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
unset($parentstrings[$category->id]);
|
||||
if (isset($category->children)) {
|
||||
foreach ($category->children as $child) {
|
||||
@@ -336,7 +336,7 @@ class question_category_object {
|
||||
mdl: 'MDL-72397',
|
||||
)]
|
||||
public function get_question_categories(?int $parent = null, string $sort = "sortorder ASC"): array {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $COURSE, $DB;
|
||||
if (is_null($parent)) {
|
||||
$categories = $DB->get_records('question_categories', ['course' => $COURSE->id], $sort);
|
||||
@@ -361,7 +361,7 @@ class question_category_object {
|
||||
mdl: 'MDL-72397',
|
||||
)]
|
||||
public function delete_category(int $categoryid): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $CFG, $DB;
|
||||
helper::question_can_delete_cat($categoryid);
|
||||
if (!$category = $DB->get_record("question_categories", ["id" => $categoryid])) { // Security.
|
||||
@@ -395,7 +395,7 @@ class question_category_object {
|
||||
mdl: 'MDL-72397',
|
||||
)]
|
||||
public function move_questions_and_delete_category(int $oldcat, int $newcat): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
helper::question_can_delete_cat($oldcat);
|
||||
$this->move_questions($oldcat, $newcat);
|
||||
$this->delete_category($oldcat);
|
||||
@@ -411,7 +411,7 @@ class question_category_object {
|
||||
* @deprecated No longer used by internal code and not recommended since Moodle 4.2 MDL-77299.
|
||||
*/
|
||||
public function display_move_form($questionsincategory, $category): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
debugging(
|
||||
'display_move_form() is deprecated and no longer used by internal code.',
|
||||
DEBUG_DEVELOPER
|
||||
@@ -440,7 +440,7 @@ class question_category_object {
|
||||
mdl: 'MDL-72397',
|
||||
)]
|
||||
public function move_questions(int $oldcat, int $newcat): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
$questionids = $this->get_real_question_ids_in_category($oldcat);
|
||||
question_move_questions_to_category($questionids, $newcat);
|
||||
}
|
||||
@@ -470,7 +470,7 @@ class question_category_object {
|
||||
)]
|
||||
public function add_category($newparent, $newcategory, $newinfo, $return = false, $newinfoformat = FORMAT_HTML,
|
||||
$idnumber = null): int {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $DB;
|
||||
if (empty($newcategory)) {
|
||||
throw new moodle_exception('categorynamecantbeblank', 'question');
|
||||
@@ -545,7 +545,7 @@ class question_category_object {
|
||||
)]
|
||||
public function update_category($updateid, $newparent, $newname, $newinfo, $newinfoformat = FORMAT_HTML,
|
||||
$idnumber = null, $redirect = true): void {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $CFG, $DB;
|
||||
if (empty($newname)) {
|
||||
throw new moodle_exception('categorynamecantbeblank', 'question');
|
||||
@@ -640,7 +640,7 @@ class question_category_object {
|
||||
mdl: 'MDL-72397',
|
||||
)]
|
||||
public function get_real_question_ids_in_category(int $categoryid): array {
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
global $DB;
|
||||
|
||||
$sql = "SELECT q.id
|
||||
|
||||
@@ -77,7 +77,7 @@ class report_eventlist_list_generator {
|
||||
*/
|
||||
#[\core\attribute\deprecated('::get_all_events_list', since: '4.0', mdl: 'MDL-72498', final: true)]
|
||||
public static function get_core_events_list() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -135,7 +135,7 @@ class report_eventlist_list_generator {
|
||||
*/
|
||||
#[\core\attribute\deprecated('::get_all_events_list', since: '4.0', mdl: 'MDL-72498', final: true)]
|
||||
public static function get_non_core_event_list() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -284,6 +284,6 @@ class audience {
|
||||
*/
|
||||
#[\core\attribute\deprecated('custom_report_audience_cards_exporter', since: '4.1', final: true)]
|
||||
public static function get_all_audiences_menu_types() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ class report {
|
||||
*/
|
||||
#[\core\attribute\deprecated('custom_report_column_cards_exporter', since: '4.1', final: true)]
|
||||
public static function get_available_columns() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1020,7 +1020,7 @@ class repository_onedrive extends repository {
|
||||
*/
|
||||
#[\core\attribute\deprecated(null, reason: 'It is no longer used', since: '4.0', final: true)]
|
||||
public static function can_import_skydrive_files() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1028,7 +1028,7 @@ class repository_onedrive extends repository {
|
||||
*/
|
||||
#[\core\attribute\deprecated(null, reason: 'It is no longer used', since: '4.0', final: true)]
|
||||
public static function import_skydrive_files() {
|
||||
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([self::class, __FUNCTION__]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -140,7 +140,7 @@ class participants_search {
|
||||
)]
|
||||
public function get_total_participants_count(string $additionalwhere = '', array $additionalparams = []): int {
|
||||
|
||||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
|
||||
\core\deprecation::emit_deprecation([$this, __FUNCTION__]);
|
||||
|
||||
global $DB;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user