Skip to content

Commit

Permalink
Language string changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ikawhero committed Jan 12, 2007
1 parent d052a81 commit 8c33bc7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
12 changes: 6 additions & 6 deletions user/profile/field/menu/field.class.php
Expand Up @@ -34,7 +34,7 @@ function set_data_type() {

function validate_data($data) {
if ($data >= count($this->options)) {
return get_string('invaliddata');
return get_string('profileinvaliddata', 'admin');
} else {
return '';
}
Expand All @@ -50,11 +50,11 @@ function save_data_preprocess($data) {

function edit_field_specific(&$form) {
/// Param 1 for menu type contains the options
$form->addElement('textarea', 'param1', get_string('profilemenuoptions'));
$form->addElement('textarea', 'param1', get_string('profilemenuoptions', 'admin'));
$form->setType('param1', PARAM_MULTILANG);

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

Expand All @@ -63,13 +63,13 @@ function edit_validate_specific($data) {

/// Check that we have at least 2 options
if (($options = explode("\n", $data->param1)) === false) {
$err['param1'] = get_string('profilemenunooptions');
$err['param1'] = get_string('profilemenunooptions', 'admin');
} elseif (count($options) < 2) {
$err['param1'] = get_string('profilemenuoptions');
$err['param1'] = get_string('profilemenutoofewoptions', 'admin');

/// Check the default data exists in the options
} elseif (!empty($data->defaultdata) and !in_array($data->defaultdata, $options)) {
$err['defaultdata'] = get_string('profilemenudefaultnotinoptions');
$err['defaultdata'] = get_string('profilemenudefaultnotinoptions', 'admin');
}
return $err;
}
Expand Down
6 changes: 3 additions & 3 deletions user/profile/field/text/field.class.php
Expand Up @@ -20,15 +20,15 @@ function set_data_type() {

function edit_field_specific(&$form) {
/// Default data
$form->addElement('text', 'defaultdata', get_string('profiledefaultdata'), 'size="30"');
$form->addElement('text', 'defaultdata', get_string('profiledefaultdata', 'admin'), 'size="30"');
$form->setType('defaultdata', PARAM_MULTILANG);

/// Param 1 for text type is the size of the field
$form->addElement('text', 'param1', get_string('profilefieldsize'), 'size="6"');
$form->addElement('text', 'param1', get_string('profilefieldsize', 'admin'), 'size="6"');
$form->setType('param1', PARAM_INT);

/// Param 2 for text type is the maxlength of the field
$form->addElement('text', 'param2', get_string('profilefieldmaxlength'), 'size="6"');
$form->addElement('text', 'param2', get_string('profilefieldmaxlength', 'admin'), 'size="6"');
$form->setType('param2', PARAM_INT);
}

Expand Down
28 changes: 14 additions & 14 deletions user/profile/lib.php
Expand Up @@ -138,7 +138,7 @@ function display_field (&$form) {
*/
function display_field_lock (&$form) {
if ($this->_is_locked()) {
$form->freeze($this->fieldname);
$form->freeze($this->fieldname, false);
}
}

Expand Down Expand Up @@ -178,10 +178,10 @@ function init() {
* @param object instance of the moodleform class
*/
function edit_field (&$form) {
$form->addElement('header', '_commonsettings', get_string('profilecommonsettings'));
$form->addElement('header', '_commonsettings', get_string('profilecommonsettings', 'admin'));
$this->edit_field_common($form);

$form->addElement('header', '_specificsettings', get_string('profilespecificsettings'));
$form->addElement('header', '_specificsettings', get_string('profilespecificsettings', 'admin'));
$this->edit_field_specific($form);
}

Expand All @@ -194,34 +194,34 @@ function edit_field_common (&$form) {

$strrequired = get_string('required');

$form->addElement('text', 'shortname', get_string('profileshortname'), 'maxlength="100" size="30"');
$form->addElement('text', 'shortname', get_string('profileshortname', 'admin'), 'maxlength="100" size="30"');
$form->setType('shortname', PARAM_ALPHANUM);
$form->addRule('shortname', $strrequired, 'required', null, 'client');

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

$form->addElement('htmleditor', 'description', get_string('profiledescription'));
$form->addElement('htmleditor', 'description', get_string('profiledescription', 'admin'));
$form->setType('description', PARAM_MULTILANG);
$form->setHelpButton('description', array('text', get_string('helptext')));

$form->addElement('selectyesno', 'required', get_string('profilerequired'));
$form->addElement('selectyesno', 'required', get_string('profilerequired', 'admin'));
$form->setType('required', PARAM_BOOL);

$form->addElement('selectyesno', 'locked', get_string('profilelocked'));
$form->addElement('selectyesno', 'locked', get_string('profilelocked', 'admin'));
$form->setType('locked', PARAM_BOOL);

unset($choices);
$choices[0] = get_string('profilevisiblenone');
$choices[1] = get_string('profilevisibleprivate');
$choices[2] = get_string('profilevisibleall');
$form->addElement('select', 'visible', get_string('profilevisible'), $choices);
$choices[0] = get_string('profilevisiblenone', 'admin');
$choices[1] = get_string('profilevisibleprivate', 'admin');
$choices[2] = get_string('profilevisibleall', 'admin');
$form->addElement('select', 'visible', get_string('profilevisible', 'admin'), $choices);
$form->setType('visible', PARAM_INT);

unset($choices);
$choices = profile_list_categories();
$form->addElement('select', 'categoryid', get_string('profilecategory'), $choices);
$form->addElement('select', 'categoryid', get_string('profilecategory', 'admin'), $choices);
$form->setType('categoryid', PARAM_INT);
}

Expand Down Expand Up @@ -265,7 +265,7 @@ function edit_validate_common ($data) {
/// Check the shortname is unique
if (($field = get_record('user_info_field', 'shortname', $data->shortname)) and ($field->id <> $data->id)) {
//if (record_exists_select('user_info_field', 'shortname='.$data->shortname.' AND id<>'.$data->id)) {
$err['shortname'] = get_string('profileshortnamenotunique');
$err['shortname'] = get_string('profileshortnamenotunique', 'admin');
}

/// No further checks necessary as the form class will take care of it
Expand Down

0 comments on commit 8c33bc7

Please sign in to comment.