Merge branch 'MDL-39422-master' of git://github.com/danpoltawski/moodle

Conflicts:
	mod/wiki/mod_form.php
This commit is contained in:
Sam Hemelryk 2013-05-01 11:15:24 +12:00
commit d25103c4ef
19 changed files with 21 additions and 2 deletions

View File

@ -517,7 +517,8 @@ YUI.add('moodle-course-toolboxes', function(Y) {
'name' : 'title',
'value' : titletext,
'autocomplete' : 'off',
'aria-describedby' : 'id_editinstructions'
'aria-describedby' : 'id_editinstructions',
'maxLength' : '255'
})
.addClass('titleeditor');
var editform = Y.Node.create('<form />')

View File

@ -54,6 +54,7 @@ class mod_assign_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor(true, get_string('description', 'assign'));

View File

@ -45,6 +45,7 @@ class mod_assignment_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor(true, get_string('description', 'assignment'));

View File

@ -45,6 +45,7 @@ class mod_book_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor($config->requiremodintro, get_string('moduleintro'));
// Appearance.

View File

@ -22,6 +22,7 @@ class mod_chat_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor(true, get_string('chatintro', 'chat'));

View File

@ -22,6 +22,7 @@ class mod_choice_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor(true, get_string('chatintro', 'chat'));

View File

@ -22,6 +22,7 @@ class mod_data_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor(true, get_string('intro', 'data'));

View File

@ -44,6 +44,7 @@ class mod_feedback_mod_form extends moodleform_mod {
$mform->addElement('text', 'name', get_string('name', 'feedback'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor(true, get_string('description', 'feedback'));

View File

@ -44,6 +44,7 @@ class mod_folder_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor($config->requiremodintro);
//-------------------------------------------------------

View File

@ -22,6 +22,7 @@ class mod_glossary_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor(true);

View File

@ -45,6 +45,7 @@ class mod_imscp_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor($config->requiremodintro);
//-------------------------------------------------------

View File

@ -89,6 +89,7 @@ class mod_lesson_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
// Appearance.
$mform->addElement('header', 'appearancehdr', get_string('appearance'));

View File

@ -67,6 +67,7 @@ class mod_lti_mod_form extends moodleform_mod {
$mform->addElement('text', 'name', get_string('basicltiname', 'lti'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
// Adding the optional "intro" and "introformat" pair of fields
$this->add_intro_editor(false, get_string('basicltiintro', 'lti'));
$mform->setAdvanced('introeditor');

View File

@ -47,6 +47,7 @@ class mod_page_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor($config->requiremodintro);
//-------------------------------------------------------

View File

@ -69,6 +69,7 @@ class mod_quiz_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
// Introduction.
$this->add_intro_editor(false, get_string('introduction', 'quiz'));

View File

@ -55,6 +55,7 @@ class mod_resource_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor($config->requiremodintro);
//-------------------------------------------------------

View File

@ -43,6 +43,7 @@ class mod_scorm_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
// Summary
$this->add_intro_editor(true);

View File

@ -45,6 +45,7 @@ class mod_url_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor($config->requiremodintro);
//-------------------------------------------------------

View File

@ -53,7 +53,8 @@ class mod_wiki_mod_form extends moodleform_mod {
$mform->addElement('text', 'name', get_string('wikiname', 'wiki'), array('size' => '64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', $required, 'required', null, 'client');
// Adding the optional "intro" and "introformat" pair of fields.
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
// Adding the optional "intro" and "introformat" pair of fields
$this->add_intro_editor(true, get_string('wikiintro', 'wiki'));
$wikimodeoptions = array ('collaborative' => get_string('wikimodecollaborative', 'wiki'), 'individual' => get_string('wikimodeindividual', 'wiki'));