Skip to content

Commit

Permalink
MDL-32945 libraries: Replaced deprecated PARAM_MULTILANG with PARAM_TEXT
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajesh Taneja committed Jul 19, 2012
1 parent 3294034 commit 071e68f
Show file tree
Hide file tree
Showing 29 changed files with 43 additions and 42 deletions.
2 changes: 1 addition & 1 deletion admin/roles/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ public function read_submitted_permissions() {
}

// Role name.
$name = optional_param('name', null, PARAM_MULTILANG);
$name = optional_param('name', null, PARAM_TEXT);
if (!is_null($name)) {
$this->role->name = $name;
// Hack: short names of standard roles are equal to archetypes, empty name means localised via lang packs.
Expand Down
8 changes: 4 additions & 4 deletions admin/tool/uploaduser/user_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ function definition () {
}

$mform->addElement('text', 'city', get_string('city'), 'maxlength="100" size="25"');
$mform->setType('city', PARAM_MULTILANG);
$mform->setType('city', PARAM_TEXT);
if (empty($CFG->defaultcity)) {
$mform->setDefault('city', $templateuser->city);
} else {
Expand Down Expand Up @@ -288,11 +288,11 @@ function definition () {
$mform->setType('idnumber', PARAM_NOTAGS);

$mform->addElement('text', 'institution', get_string('institution'), 'maxlength="40" size="25"');
$mform->setType('institution', PARAM_MULTILANG);
$mform->setType('institution', PARAM_TEXT);
$mform->setDefault('institution', $templateuser->institution);

$mform->addElement('text', 'department', get_string('department'), 'maxlength="30" size="25"');
$mform->setType('department', PARAM_MULTILANG);
$mform->setType('department', PARAM_TEXT);
$mform->setDefault('department', $templateuser->department);

$mform->addElement('text', 'phone1', get_string('phone'), 'maxlength="20" size="25"');
Expand All @@ -304,7 +304,7 @@ function definition () {
$mform->setAdvanced('phone2');

$mform->addElement('text', 'address', get_string('address'), 'maxlength="70" size="25"');
$mform->setType('address', PARAM_MULTILANG);
$mform->setType('address', PARAM_TEXT);
$mform->setAdvanced('address');

// Next the profile defaults
Expand Down
2 changes: 1 addition & 1 deletion blocks/blog_tags/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function specific_definition($mform) {

$mform->addElement('text', 'config_title', get_string('blocktitle', 'blog'));
$mform->setDefault('config_title', get_string('blogtags', 'blog'));
$mform->setType('config_title', PARAM_MULTILANG);
$mform->setType('config_title', PARAM_TEXT);

$numberoftags = array();
for($i = 1; $i <= 50; $i++) {
Expand Down
2 changes: 1 addition & 1 deletion blocks/glossary_random/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function specific_definition($mform) {

$mform->addElement('text', 'config_title', get_string('title', 'block_glossary_random'));
$mform->setDefault('config_title', get_string('pluginname','block_glossary_random'));
$mform->setType('config_title', PARAM_MULTILANG);
$mform->setType('config_title', PARAM_TEXT);

// Select glossaries to put in dropdown box ...
$glossaries = $DB->get_records_menu('glossary', array('course' => $this->block->course->id), 'name', 'id,name');
Expand Down
2 changes: 1 addition & 1 deletion blocks/html/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function specific_definition($mform) {
$mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));

$mform->addElement('text', 'config_title', get_string('configtitle', 'block_html'));
$mform->setType('config_title', PARAM_MULTILANG);
$mform->setType('config_title', PARAM_TEXT);

$editoroptions = array('maxfiles' => EDITOR_UNLIMITED_FILES, 'noclean'=>true, 'context'=>$this->block->context);
$mform->addElement('editor', 'config_text', get_string('configcontent', 'block_html'), null, $editoroptions);
Expand Down
2 changes: 1 addition & 1 deletion blocks/mentees/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ protected function specific_definition($mform) {
$mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));

$mform->addElement('text', 'config_title', get_string('configtitleblankhides', 'block_mentees'));
$mform->setType('config_title', PARAM_MULTILANG);
$mform->setType('config_title', PARAM_TEXT);
}
}
2 changes: 1 addition & 1 deletion blocks/tag_flickr/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function specific_definition($mform) {
$mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));

$mform->addElement('text', 'config_title', get_string('configtitle', 'block_tag_flickr'));
$mform->setType('config_title', PARAM_MULTILANG);
$mform->setType('config_title', PARAM_TEXT);

$mform->addElement('text', 'config_numberofphotos', get_string('numberofphotos', 'block_tag_flickr'), array('size' => 5));
$mform->setType('config_numberofvideos', PARAM_INTEGER);
Expand Down
2 changes: 1 addition & 1 deletion blocks/tag_youtube/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function specific_definition($mform) {
$mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));

$mform->addElement('text', 'config_title', get_string('configtitle', 'block_tag_youtube'));
$mform->setType('config_title', PARAM_MULTILANG);
$mform->setType('config_title', PARAM_TEXT);

$mform->addElement('text', 'config_numberofvideos', get_string('numberofvideos', 'block_tag_youtube'), array('size' => 5));
$mform->setType('config_numberofvideos', PARAM_INTEGER);
Expand Down
2 changes: 1 addition & 1 deletion blocks/tags/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function specific_definition($mform) {
$mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));

$mform->addElement('text', 'config_title', get_string('pluginname', 'block_tags'));
$mform->setType('config_title', PARAM_MULTILANG);
$mform->setType('config_title', PARAM_TEXT);
$mform->setDefault('config_title', get_string('pluginname', 'block_tags'));

$numberoftags = array();
Expand Down
2 changes: 1 addition & 1 deletion cohort/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function definition() {

$mform->addElement('text', 'name', get_string('name', 'cohort'), 'maxlength="254" size="50"');
$mform->addRule('name', get_string('required'), 'required', null, 'client');
$mform->setType('name', PARAM_MULTILANG);
$mform->setType('name', PARAM_TEXT);

$options = $this->get_category_options($cohort->contextid);
$mform->addElement('select', 'contextid', get_string('context', 'role'), $options);
Expand Down
4 changes: 2 additions & 2 deletions course/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function definition() {
$mform->addElement('text','fullname', get_string('fullnamecourse'),'maxlength="254" size="50"');
$mform->addHelpButton('fullname', 'fullnamecourse');
$mform->addRule('fullname', get_string('missingfullname'), 'required', null, 'client');
$mform->setType('fullname', PARAM_MULTILANG);
$mform->setType('fullname', PARAM_TEXT);
if (!empty($course->id) and !has_capability('moodle/course:changefullname', $coursecontext)) {
$mform->hardFreeze('fullname');
$mform->setConstant('fullname', $course->fullname);
Expand All @@ -88,7 +88,7 @@ function definition() {
$mform->addElement('text', 'shortname', get_string('shortnamecourse'), 'maxlength="100" size="20"');
$mform->addHelpButton('shortname', 'shortnamecourse');
$mform->addRule('shortname', get_string('missingshortname'), 'required', null, 'client');
$mform->setType('shortname', PARAM_MULTILANG);
$mform->setType('shortname', PARAM_TEXT);
if (!empty($course->id) and !has_capability('moodle/course:changeshortname', $coursecontext)) {
$mform->hardFreeze('shortname');
$mform->setConstant('shortname', $course->shortname);
Expand Down
4 changes: 2 additions & 2 deletions course/request_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ function definition() {
$mform->addElement('text', 'fullname', get_string('fullnamecourse'), 'maxlength="254" size="50"');
$mform->addHelpButton('fullname', 'fullnamecourse');
$mform->addRule('fullname', get_string('missingfullname'), 'required', null, 'client');
$mform->setType('fullname', PARAM_MULTILANG);
$mform->setType('fullname', PARAM_TEXT);

$mform->addElement('text', 'shortname', get_string('shortnamecourse'), 'maxlength="100" size="20"');
$mform->addHelpButton('shortname', 'shortnamecourse');
$mform->addRule('shortname', get_string('missingshortname'), 'required', null, 'client');
$mform->setType('shortname', PARAM_MULTILANG);
$mform->setType('shortname', PARAM_TEXT);

$mform->addElement('editor', 'summary_editor', get_string('summary'), null, course_request::summary_editor_options());
$mform->addHelpButton('summary_editor', 'coursesummary');
Expand Down
2 changes: 1 addition & 1 deletion enrol/externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public static function get_enrolled_users_returns() {
'lastname' => new external_value(PARAM_NOTAGS, 'The family name of the user', VALUE_OPTIONAL),
'fullname' => new external_value(PARAM_NOTAGS, 'The fullname of the user'),
'email' => new external_value(PARAM_TEXT, 'An email address - allow email as root@localhost', VALUE_OPTIONAL),
'address' => new external_value(PARAM_MULTILANG, 'Postal address', VALUE_OPTIONAL),
'address' => new external_value(PARAM_TEXT, 'Postal address', VALUE_OPTIONAL),
'phone1' => new external_value(PARAM_NOTAGS, 'Phone 1', VALUE_OPTIONAL),
'phone2' => new external_value(PARAM_NOTAGS, 'Phone 2', VALUE_OPTIONAL),
'icq' => new external_value(PARAM_NOTAGS, 'icq number', VALUE_OPTIONAL),
Expand Down
2 changes: 1 addition & 1 deletion grade/report/grader/ajax_callbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
$itemid = optional_param('itemid', false, PARAM_INT);
$type = optional_param('type', false, PARAM_ALPHA);
$action = optional_param('action', false, PARAM_ALPHA);
$newvalue = optional_param('newvalue', false, PARAM_MULTILANG);
$newvalue = optional_param('newvalue', false, PARAM_TEXT);

/// basic access checks
if (!$course = $DB->get_record('course', array('id' => $courseid))) {
Expand Down
4 changes: 2 additions & 2 deletions group/autogroup_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function definition() {
$mform->addElement('text', 'namingscheme', get_string('namingscheme', 'group'));
$mform->addHelpButton('namingscheme', 'namingscheme', 'group');
$mform->addRule('namingscheme', get_string('required'), 'required', null, 'client');
$mform->setType('namingscheme', PARAM_MULTILANG);
$mform->setType('namingscheme', PARAM_TEXT);
// there must not be duplicate group names in course
$template = get_string('grouptemplate', 'group');
$gname = groups_parse_name($template, 0);
Expand All @@ -123,7 +123,7 @@ function definition() {
}

$mform->addElement('text', 'groupingname', get_string('groupingname', 'group'), $options);
$mform->setType('groupingname', PARAM_MULTILANG);
$mform->setType('groupingname', PARAM_TEXT);
$mform->disabledIf('groupingname', 'grouping', 'noteq', '-1');

$mform->addElement('hidden','courseid');
Expand Down
2 changes: 1 addition & 1 deletion group/group_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function definition () {

$mform->addElement('text','name', get_string('groupname', 'group'),'maxlength="254" size="50"');
$mform->addRule('name', get_string('required'), 'required', null, 'client');
$mform->setType('name', PARAM_MULTILANG);
$mform->setType('name', PARAM_TEXT);

$mform->addElement('text','idnumber', get_string('idnumbergroup'), 'maxlength="100" size="10"');
$mform->addHelpButton('idnumber', 'idnumbergroup');
Expand Down
2 changes: 1 addition & 1 deletion group/grouping_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function definition () {

$mform->addElement('text','name', get_string('groupingname', 'group'),'maxlength="254" size="50"');
$mform->addRule('name', get_string('required'), 'required', null, 'server');
$mform->setType('name', PARAM_MULTILANG);
$mform->setType('name', PARAM_TEXT);

$mform->addElement('text','idnumber', get_string('idnumbergrouping'), 'maxlength="100" size="10"');
$mform->addHelpButton('idnumber', 'idnumbergrouping');
Expand Down
2 changes: 1 addition & 1 deletion lib/adminlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3243,7 +3243,7 @@ public function get_setting() {
* @return mixed true or message string
*/
public function validate($data) {
$cleaned = clean_param($data, PARAM_MULTILANG);
$cleaned = clean_param($data, PARAM_TEXT);
if ($cleaned === '') {
return get_string('required');
}
Expand Down
1 change: 1 addition & 0 deletions lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@

/**
* PARAM_MULTILANG - deprecated alias of PARAM_TEXT.
* @deprecated since 2.0
*/
define('PARAM_MULTILANG', 'text');

Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/addrandomform.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function definition() {
get_string('randomquestionusinganewcategory', 'quiz'));

$mform->addElement('text', 'name', get_string('name'), 'maxlength="254" size="50"');
$mform->setType('name', PARAM_MULTILANG);
$mform->setType('name', PARAM_TEXT);

$mform->addElement('questioncategory', 'parent', get_string('parentcategory', 'question'),
array('contexts' => $usablecontexts, 'top' => true));
Expand Down
4 changes: 2 additions & 2 deletions question/category_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ protected function definition() {
$mform->addElement('text', 'name', get_string('name'),'maxlength="254" size="50"');
$mform->setDefault('name', '');
$mform->addRule('name', get_string('categorynamecantbeblank', 'question'), 'required', null, 'client');
$mform->setType('name', PARAM_MULTILANG);
$mform->setType('name', PARAM_TEXT);

$mform->addElement('textarea', 'info', get_string('categoryinfo', 'question'), array('rows'=> '10', 'cols'=>'45'));
$mform->setDefault('info', '');
$mform->setType('info', PARAM_MULTILANG);
$mform->setType('info', PARAM_TEXT);

$this->add_action_buttons(false, get_string('addcategory', 'question'));

Expand Down
4 changes: 2 additions & 2 deletions question/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ protected function assemble_category_path($names) {
* Convert a string, as returned by {@link assemble_category_path()},
* back into an array of category names.
*
* Each category name is cleaned by a call to clean_param(, PARAM_MULTILANG),
* Each category name is cleaned by a call to clean_param(, PARAM_TEXT),
* which matches the cleaning in question/category_form.php.
*
* @param string $path
Expand All @@ -859,7 +859,7 @@ protected function split_category_path($path) {
$rawnames = preg_split('~(?<!/)/(?!/)~', $path);
$names = array();
foreach ($rawnames as $rawname) {
$names[] = clean_param(trim(str_replace('//', '/', $rawname)), PARAM_MULTILANG);
$names[] = clean_param(trim(str_replace('//', '/', $rawname)), PARAM_TEXT);
}
return $names;
}
Expand Down
10 changes: 5 additions & 5 deletions user/editlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ function useredit_shared_definition(&$mform, $editoroptions = null, $filemanager
$mform->addHelpButton('screenreader', 'screenreaderuse');

$mform->addElement('text', 'city', get_string('city'), 'maxlength="120" size="21"');
$mform->setType('city', PARAM_MULTILANG);
$mform->setType('city', PARAM_TEXT);
$mform->addRule('city', $strrequired, 'required', null, 'client');
if (!empty($CFG->defaultcity)) {
$mform->setDefault('city', $CFG->defaultcity);
Expand Down Expand Up @@ -282,7 +282,7 @@ function useredit_shared_definition(&$mform, $editoroptions = null, $filemanager
$mform->addHelpButton('imagefile', 'newpicture');

$mform->addElement('text', 'imagealt', get_string('imagealt'), 'maxlength="100" size="30"');
$mform->setType('imagealt', PARAM_MULTILANG);
$mform->setType('imagealt', PARAM_TEXT);

}

Expand Down Expand Up @@ -317,10 +317,10 @@ function useredit_shared_definition(&$mform, $editoroptions = null, $filemanager
$mform->setType('idnumber', PARAM_NOTAGS);

$mform->addElement('text', 'institution', get_string('institution'), 'maxlength="40" size="25"');
$mform->setType('institution', PARAM_MULTILANG);
$mform->setType('institution', PARAM_TEXT);

$mform->addElement('text', 'department', get_string('department'), 'maxlength="30" size="25"');
$mform->setType('department', PARAM_MULTILANG);
$mform->setType('department', PARAM_TEXT);

$mform->addElement('text', 'phone1', get_string('phone'), 'maxlength="20" size="25"');
$mform->setType('phone1', PARAM_NOTAGS);
Expand All @@ -329,7 +329,7 @@ function useredit_shared_definition(&$mform, $editoroptions = null, $filemanager
$mform->setType('phone2', PARAM_NOTAGS);

$mform->addElement('text', 'address', get_string('address'), 'maxlength="70" size="25"');
$mform->setType('address', PARAM_MULTILANG);
$mform->setType('address', PARAM_TEXT);


}
Expand Down
4 changes: 2 additions & 2 deletions user/externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public static function get_users_by_id_returns() {
'lastname' => new external_value(PARAM_NOTAGS, 'The family name of the user', VALUE_OPTIONAL),
'fullname' => new external_value(PARAM_NOTAGS, 'The fullname of the user'),
'email' => new external_value(PARAM_TEXT, 'An email address - allow email as root@localhost', VALUE_OPTIONAL),
'address' => new external_value(PARAM_MULTILANG, 'Postal address', VALUE_OPTIONAL),
'address' => new external_value(PARAM_TEXT, 'Postal address', VALUE_OPTIONAL),
'phone1' => new external_value(PARAM_NOTAGS, 'Phone 1', VALUE_OPTIONAL),
'phone2' => new external_value(PARAM_NOTAGS, 'Phone 2', VALUE_OPTIONAL),
'icq' => new external_value(PARAM_NOTAGS, 'icq number', VALUE_OPTIONAL),
Expand Down Expand Up @@ -604,7 +604,7 @@ public static function get_course_user_profiles_returns() {
'lastname' => new external_value(PARAM_NOTAGS, 'The family name of the user', VALUE_OPTIONAL),
'fullname' => new external_value(PARAM_NOTAGS, 'The fullname of the user'),
'email' => new external_value(PARAM_TEXT, 'An email address - allow email as root@localhost', VALUE_OPTIONAL),
'address' => new external_value(PARAM_MULTILANG, 'Postal address', VALUE_OPTIONAL),
'address' => new external_value(PARAM_TEXT, 'Postal address', VALUE_OPTIONAL),
'phone1' => new external_value(PARAM_NOTAGS, 'Phone 1', VALUE_OPTIONAL),
'phone2' => new external_value(PARAM_NOTAGS, 'Phone 2', VALUE_OPTIONAL),
'icq' => new external_value(PARAM_NOTAGS, 'icq number', VALUE_OPTIONAL),
Expand Down
2 changes: 1 addition & 1 deletion user/profile/definelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function define_form_common(&$form) {

$form->addElement('text', 'name', get_string('profilename', 'admin'), 'size="50"');
$form->addRule('name', $strrequired, 'required', null, 'client');
$form->setType('name', PARAM_MULTILANG);
$form->setType('name', PARAM_TEXT);

$form->addElement('editor', 'description', get_string('profiledescription', 'admin'), null, null);

Expand Down
4 changes: 2 additions & 2 deletions user/profile/field/menu/define.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ class profile_define_menu extends profile_define_base {
function define_form_specific($form) {
/// Param 1 for menu type contains the options
$form->addElement('textarea', 'param1', get_string('profilemenuoptions', 'admin'), array('rows' => 6, 'cols' => 40));
$form->setType('param1', PARAM_MULTILANG);
$form->setType('param1', PARAM_TEXT);

/// Default data
$form->addElement('text', 'defaultdata', get_string('profiledefaultdata', 'admin'), 'size="50"');
$form->setType('defaultdata', PARAM_MULTILANG);
$form->setType('defaultdata', PARAM_TEXT);
}

function define_validate_specific($data, $files) {
Expand Down
2 changes: 1 addition & 1 deletion user/profile/field/text/define.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class profile_define_text extends profile_define_base {
function define_form_specific($form) {
/// Default data
$form->addElement('text', 'defaultdata', get_string('profiledefaultdata', 'admin'), 'size="50"');
$form->setType('defaultdata', PARAM_MULTILANG);
$form->setType('defaultdata', PARAM_TEXT);

/// Param 1 for text type is the size of the field
$form->addElement('text', 'param1', get_string('profilefieldsize', 'admin'), 'size="6"');
Expand Down
2 changes: 1 addition & 1 deletion user/profile/field/text/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function edit_field_add($mform) {

/// Create the form field
$mform->addElement($fieldtype, $this->inputname, format_string($this->field->name), 'maxlength="'.$maxlength.'" size="'.$size.'" ');
$mform->setType($this->inputname, PARAM_MULTILANG);
$mform->setType($this->inputname, PARAM_TEXT);
}

}
Expand Down
Loading

0 comments on commit 071e68f

Please sign in to comment.