| Línea 23... |
Línea 23... |
| 23 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
23 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 24 |
*/
|
24 |
*/
|
| Línea 25... |
Línea 25... |
| 25 |
|
25 |
|
| Línea -... |
Línea 26... |
| - |
|
26 |
namespace core_backup\output;
|
| - |
|
27 |
|
| - |
|
28 |
use core\di;
|
| - |
|
29 |
use core\hook\manager;
|
| 26 |
namespace core_backup\output;
|
30 |
use core_backup\hook\after_copy_form_definition;
|
| Línea 27... |
Línea 31... |
| 27 |
|
31 |
|
| Línea 28... |
Línea 32... |
| 28 |
defined('MOODLE_INTERNAL') || die();
|
32 |
defined('MOODLE_INTERNAL') || die();
|
| Línea 84... |
Línea 88... |
| 84 |
$mform->addElement('hidden', 'returnurl', null);
|
88 |
$mform->addElement('hidden', 'returnurl', null);
|
| 85 |
$mform->setType('returnurl', PARAM_LOCALURL);
|
89 |
$mform->setType('returnurl', PARAM_LOCALURL);
|
| 86 |
$mform->setConstant('returnurl', $returnurl);
|
90 |
$mform->setConstant('returnurl', $returnurl);
|
| Línea 87... |
Línea 91... |
| 87 |
|
91 |
|
| 88 |
// Form heading.
|
92 |
// Form heading.
|
| Línea 89... |
Línea 93... |
| 89 |
$mform->addElement('html', \html_writer::div(get_string('copycoursedesc', 'backup'), 'form-description mb-6'));
|
93 |
$mform->addElement('html', \html_writer::div(get_string('copycoursedesc', 'backup'), 'form-text mb-6'));
|
| 90 |
|
94 |
|
| - |
|
95 |
// Course fullname.
|
| 91 |
// Course fullname.
|
96 |
$mform->addElement('text', 'fullname', get_string('fullnamecourse'),
|
| 92 |
$mform->addElement('text', 'fullname', get_string('fullnamecourse'), 'maxlength="254" size="50"');
|
97 |
['maxlength' => \core_course\constants::FULLNAME_MAXIMUM_LENGTH, 'size' => 50]);
|
| 93 |
$mform->addHelpButton('fullname', 'fullnamecourse');
|
98 |
$mform->addHelpButton('fullname', 'fullnamecourse');
|
| Línea 94... |
Línea 99... |
| 94 |
$mform->addRule('fullname', get_string('missingfullname'), 'required', null, 'client');
|
99 |
$mform->addRule('fullname', get_string('missingfullname'), 'required', null, 'client');
|
| 95 |
$mform->setType('fullname', PARAM_TEXT);
|
100 |
$mform->setType('fullname', PARAM_TEXT);
|
| - |
|
101 |
|
| 96 |
|
102 |
// Course shortname.
|
| 97 |
// Course shortname.
|
103 |
$mform->addElement('text', 'shortname', get_string('shortnamecourse'),
|
| 98 |
$mform->addElement('text', 'shortname', get_string('shortnamecourse'), 'maxlength="100" size="20"');
|
104 |
['maxlength' => \core_course\constants::SHORTNAME_MAXIMUM_LENGTH, 'size' => 20]);
|
| Línea 99... |
Línea 105... |
| 99 |
$mform->addHelpButton('shortname', 'shortnamecourse');
|
105 |
$mform->addHelpButton('shortname', 'shortnamecourse');
|
| Línea 193... |
Línea 199... |
| 193 |
$mform->addGroup($rolearray, 'rolearray', get_string('keptroles', 'backup'), ' ', false);
|
199 |
$mform->addGroup($rolearray, 'rolearray', get_string('keptroles', 'backup'), ' ', false);
|
| 194 |
$mform->addHelpButton('rolearray', 'keptroles', 'backup');
|
200 |
$mform->addHelpButton('rolearray', 'keptroles', 'backup');
|
| 195 |
$this->add_checkbox_controller(2);
|
201 |
$this->add_checkbox_controller(2);
|
| 196 |
}
|
202 |
}
|
| Línea -... |
Línea 203... |
| - |
|
203 |
|
| - |
|
204 |
// Dispatch hook to allow more elements to be added to the form.
|
| - |
|
205 |
$hook = new after_copy_form_definition($mform);
|
| - |
|
206 |
di::get(manager::class)->dispatch($hook);
|
| 197 |
|
207 |
|
| 198 |
$buttonarray = array();
|
208 |
$buttonarray = array();
|
| 199 |
$buttonarray[] = $mform->createElement('submit', 'submitreturn', get_string('copyreturn', 'backup'));
|
209 |
$buttonarray[] = $mform->createElement('submit', 'submitreturn', get_string('copyreturn', 'backup'));
|
| 200 |
$buttonarray[] = $mform->createElement('submit', 'submitdisplay', get_string('copyview', 'backup'));
|
210 |
$buttonarray[] = $mform->createElement('submit', 'submitdisplay', get_string('copyview', 'backup'));
|
| 201 |
$buttonarray[] = $mform->createElement('cancel');
|
211 |
$buttonarray[] = $mform->createElement('cancel');
|