This commit is contained in:
Sara Arjona 2024-03-21 17:30:40 +01:00
commit f3f514ace1
No known key found for this signature in database
5 changed files with 11 additions and 6 deletions

View File

@ -1355,8 +1355,9 @@ abstract class lesson_add_page_form_base extends moodleform {
$mform->addElement('hidden', 'qtype');
$mform->setType('qtype', PARAM_INT);
$mform->addElement('text', 'title', get_string('pagetitle', 'lesson'), array('size'=>70));
$mform->addElement('text', 'title', get_string('pagetitle', 'lesson'), ['size' => 70, 'maxlength' => 255]);
$mform->addRule('title', get_string('required'), 'required', null, 'client');
$mform->addRule('title', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('title', PARAM_TEXT);
} else {

View File

@ -339,8 +339,9 @@ class lesson_add_page_form_branchtable extends lesson_add_page_form_base {
$mform->addElement('hidden', 'qtype');
$mform->setType('qtype', PARAM_INT);
$mform->addElement('text', 'title', get_string("pagetitle", "lesson"), array('size'=>70));
$mform->addRule('title', null, 'required', null, 'server');
$mform->addElement('text', 'title', get_string("pagetitle", "lesson"), ['size' => 70, 'maxlength' => 255]);
$mform->addRule('title', null, 'required', null, 'client');
$mform->addRule('title', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('title', PARAM_TEXT);
} else {

View File

@ -131,7 +131,8 @@ class lesson_add_page_form_cluster extends lesson_add_page_form_base {
$mform->addElement('hidden', 'qtype');
$mform->setType('qtype', PARAM_TEXT);
$mform->addElement('text', 'title', get_string("pagetitle", "lesson"), array('size'=>70));
$mform->addElement('text', 'title', get_string("pagetitle", "lesson"), ['size' => 70, 'maxlength' => 255]);
$mform->addRule('title', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('title', PARAM_TEXT);
} else {

View File

@ -159,7 +159,8 @@ class lesson_add_page_form_endofbranch extends lesson_add_page_form_base {
$mform->addElement('hidden', 'qtype');
$mform->setType('qtype', PARAM_TEXT);
$mform->addElement('text', 'title', get_string("pagetitle", "lesson"), array('size'=>70));
$mform->addElement('text', 'title', get_string("pagetitle", "lesson"), ['size' => 70, 'maxlength' => 255]);
$mform->addRule('title', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('title', PARAM_TEXT);
} else {

View File

@ -139,7 +139,8 @@ class lesson_add_page_form_endofcluster extends lesson_add_page_form_base {
$mform->addElement('hidden', 'qtype');
$mform->setType('qtype', PARAM_TEXT);
$mform->addElement('text', 'title', get_string("pagetitle", "lesson"), array('size'=>70));
$mform->addElement('text', 'title', get_string("pagetitle", "lesson"), ['size' => 70, 'maxlength' => 255]);
$mform->addRule('title', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('title', PARAM_TEXT);
} else {