MDL-69655 tool_licenses: Final deprecation admin_setting_managelicenses

Following MDL-45184 this now finally deprecates and removes the class
\admin_setting_managelicenses. Please use \tool_licensemanager\manager
instead.

Following MDL-45184 this now finally deprecates and removes the
function license_manager::add(). Please use license_manager::save()
instead.

Signed-off-by: Daniel Ziegenberg <[email protected]>
This commit is contained in:
Daniel Ziegenberg
2022-10-11 11:09:51 +02:00
parent cc4fec275f
commit 5e57b0322b
3 changed files with 5 additions and 104 deletions
-92
View File
@@ -7604,98 +7604,6 @@ class admin_setting_manageantiviruses extends admin_setting {
}
}
/**
* Special class for license administration.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @deprecated since Moodle 3.9 MDL-45184. Please use \tool_licensemanager\manager instead.
* @todo MDL-45184 This class will be deleted in Moodle 4.1.
*/
class admin_setting_managelicenses extends admin_setting {
/**
* @deprecated since Moodle 3.9 MDL-45184. Please use \tool_licensemanager\manager instead.
* @todo MDL-45184 This class will be deleted in Moodle 4.1
*/
public function __construct() {
global $ADMIN;
debugging('admin_setting_managelicenses class is deprecated. Please use \tool_licensemanager\manager instead.',
DEBUG_DEVELOPER);
// Replace admin setting load with new external page load for tool_licensemanager, if not loaded already.
if (!is_null($ADMIN->locate('licensemanager'))) {
$temp = new admin_externalpage('licensemanager',
get_string('licensemanager', 'tool_licensemanager'),
\tool_licensemanager\helper::get_licensemanager_url());
$ADMIN->add('license', $temp);
}
}
/**
* Always returns true, does nothing
*
* @deprecated since Moodle 3.9 MDL-45184.
* @todo MDL-45184 This method will be deleted in Moodle 4.1
*
* @return true
*/
public function get_setting() {
debugging('admin_setting_managelicenses class is deprecated. Please use \tool_licensemanager\manager instead.',
DEBUG_DEVELOPER);
return true;
}
/**
* Always returns true, does nothing
*
* @deprecated since Moodle 3.9 MDL-45184.
* @todo MDL-45184 This method will be deleted in Moodle 4.1
*
* @return true
*/
public function get_defaultsetting() {
debugging('admin_setting_managelicenses class is deprecated. Please use \tool_licensemanager\manager instead.',
DEBUG_DEVELOPER);
return true;
}
/**
* Always returns '', does not write anything
*
* @deprecated since Moodle 3.9 MDL-45184.
* @todo MDL-45184 This method will be deleted in Moodle 4.1
*
* @return string Always returns ''
*/
public function write_setting($data) {
debugging('admin_setting_managelicenses class is deprecated. Please use \tool_licensemanager\manager instead.',
DEBUG_DEVELOPER);
// do not write any setting
return '';
}
/**
* Builds the XHTML to display the control
*
* @deprecated since Moodle 3.9 MDL-45184. Please use \tool_licensemanager\manager instead.
* @todo MDL-45184 This method will be deleted in Moodle 4.1
*
* @param string $data Unused
* @param string $query
* @return string
*/
public function output_html($data, $query='') {
debugging('admin_setting_managelicenses class is deprecated. Please use \tool_licensemanager\manager instead.',
DEBUG_DEVELOPER);
redirect(\tool_licensemanager\helper::get_licensemanager_url());
}
}
/**
* Course formats manager. Allows to enable/disable formats and jump to settings
*/
+2 -12
View File
@@ -93,20 +93,10 @@ class license_manager {
}
/**
* Adding a new license type
*
* @deprecated Since Moodle 3.9, MDL-45184.
* @todo MDL-67344 This will be deleted in Moodle 4.1.
* @see license_manager::save()
*
* @param object $license the license record to add.
*
* @return bool true on success.
*/
public function add($license) : bool {
debugging('add() is deprecated. Please use license_manager::save() instead.', DEBUG_DEVELOPER);
return self::save($license);
public function add() {
throw new coding_exception('license_manager::add() is deprecated. Please use license_manager::save() instead.');
}
/**
+3
View File
@@ -2,6 +2,9 @@ This files describes API changes in core libraries and APIs,
information provided here is intended especially for developers.
=== 4.1 ===
* Final deprecation and removal of the class \admin_setting_managelicenses, please use \tool_licensemanager\manager instead.
* Final deprecation and removal of the function license_manager::add(). Please use license_manager::save() instead.
* Final deprecation of the following functions behat_field_manager::get_node_type() and behat_field_manager::get_field()
please call behat_field_manager::get_field_node_type() and behat_field_manager::get_form_field().
* Final deprecation and removal of the following class, please use \core\task\manager.