. namespace core\output\actions; /** * Confirm action * * @copyright 2009 Nicolas Connault * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since Moodle 2.0 * @package core * @category output */ class confirm_action extends component_action { /** * Constructs the confirm action object * * @param string $message The message to display to the user when they are shown * the confirm dialogue. * @param string $callback Deprecated since 2.7 * @param string $continuelabel The string to use for he continue button * @param string $cancellabel The string to use for the cancel button */ public function __construct($message, $callback = null, $continuelabel = null, $cancellabel = null) { if ($callback !== null) { debugging( 'The callback argument to new confirm_action() has been deprecated.' . ' If you need to use a callback, please write Javascript to use moodle-core-notification-confirmation ' . 'and attach to the provided events.', DEBUG_DEVELOPER, ); } parent::__construct('click', 'M.util.show_confirm_dialog', [ 'message' => $message, 'continuelabel' => $continuelabel, 'cancellabel' => $cancellabel, ]); } } // Alias this class to the old name. // This file will be autoloaded by the legacyclasses autoload system. // In future all uses of this class will be corrected and the legacy references will be removed. class_alias(confirm_action::class, \confirm_action::class);