Commit 6985b48e authored by Richard Mansfield's avatar Richard Mansfield
Browse files
parents 201e2d01 53950f03
...@@ -31,6 +31,7 @@ $string['internal'] = 'Internal'; ...@@ -31,6 +31,7 @@ $string['internal'] = 'Internal';
$string['completeregistration'] = 'Complete Registration'; $string['completeregistration'] = 'Complete Registration';
$string['emailalreadytaken'] = 'This e-mail address has already registered here'; $string['emailalreadytaken'] = 'This e-mail address has already registered here';
$string['iagreetothetermsandconditions'] = 'I agree to the Terms and Conditions'; $string['iagreetothetermsandconditions'] = 'I agree to the Terms and Conditions';
$string['passwordformdescription'] = 'Your password must be at least six characters long and contain at least one digit and two letters';
$string['passwordinvalidform'] = 'Your password must be at least six characters long and contain at least one digit and two letters'; $string['passwordinvalidform'] = 'Your password must be at least six characters long and contain at least one digit and two letters';
$string['registeredemailsubject'] = 'You have registered at %s'; $string['registeredemailsubject'] = 'You have registered at %s';
$string['registeredemailmessagetext'] = 'Hi %s, $string['registeredemailmessagetext'] = 'Hi %s,
...@@ -56,7 +57,7 @@ $string['registrationnosuchkey'] = 'Sorry, there does not seem to be a registrat ...@@ -56,7 +57,7 @@ $string['registrationnosuchkey'] = 'Sorry, there does not seem to be a registrat
$string['registrationunsuccessful'] = 'Sorry, your registration attempt was unsuccessful. This is our fault, not yours. Please try again later.'; $string['registrationunsuccessful'] = 'Sorry, your registration attempt was unsuccessful. This is our fault, not yours. Please try again later.';
$string['usernamealreadytaken'] = 'Sorry, this username is already taken'; $string['usernamealreadytaken'] = 'Sorry, this username is already taken';
$string['usernameinvalidform'] = 'Your username may only include alphanumeric characters, full stops, underscores and @ symbols. Also, it must be between 3 and 30 characters long.'; $string['usernameinvalidform'] = 'Your username may only include alphanumeric characters, full stops, underscores and @ symbols. Also, it must be between 3 and 30 characters long.';
$string['youmaynotregisterwithouttandc'] = 'You may not register unless you agree to abide by the Terms and Conditions'; $string['youmaynotregisterwithouttandc'] = 'You may not register unless you agree to abide by the <a href="terms.php">Terms and Conditions</a>';
$string['youmustagreetothetermsandconditions'] = 'You must agree to the <a href="terms.php">Terms and Conditions</a>'; $string['youmustagreetothetermsandconditions'] = 'You must agree to the <a href="terms.php">Terms and Conditions</a>';
?> ?>
...@@ -102,7 +102,7 @@ $form = array( ...@@ -102,7 +102,7 @@ $form = array(
), ),
'submit' => array( 'submit' => array(
'type' => 'submit', 'type' => 'submit',
'value' => get_string('change') 'value' => get_string('send')
) )
) )
); );
......
...@@ -36,6 +36,7 @@ $string['save'] = 'Save'; ...@@ -36,6 +36,7 @@ $string['save'] = 'Save';
$string['submit'] = 'Submit'; $string['submit'] = 'Submit';
$string['update'] = 'Update'; $string['update'] = 'Update';
$string['change'] = 'Change'; $string['change'] = 'Change';
$string['send'] = 'Send';
$string['go'] = 'Go'; $string['go'] = 'Go';
$string['default'] = 'Default'; $string['default'] = 'Default';
$string['upload'] = 'Upload'; $string['upload'] = 'Upload';
......
...@@ -111,7 +111,7 @@ function pieform_renderer_maharatable(Pieform $form, $builtelement, $rawelement) ...@@ -111,7 +111,7 @@ function pieform_renderer_maharatable(Pieform $form, $builtelement, $rawelement)
// Description - optional description of the element, or other note that should be visible // Description - optional description of the element, or other note that should be visible
// on the form itself (without the user having to hover over contextual help // on the form itself (without the user having to hover over contextual help
if (!empty($rawelement['description'])) { if ((!$form->has_errors() || $form->get_property('showdescriptiononerror')) && !empty($rawelement['description'])) {
$result .= "\t<tr>\n\t\t<td class=\"description\">"; $result .= "\t<tr>\n\t\t<td class=\"description\">";
$result .= $rawelement['description']; $result .= $rawelement['description'];
$result .= "</td>\n\t</tr>\n"; $result .= "</td>\n\t</tr>\n";
......
...@@ -292,6 +292,10 @@ class Pieform { ...@@ -292,6 +292,10 @@ class Pieform {
// Whether to add * markers after each required field // Whether to add * markers after each required field
'requiredmarker' => false, 'requiredmarker' => false,
// Whether to show the description as well as the error message
// when displaying errors
'showdescriptiononerror' => true,
); );
$data = array_merge($formdefaults, $formconfig, $data); $data = array_merge($formdefaults, $formconfig, $data);
$this->data = $data; $this->data = $data;
......
...@@ -74,7 +74,7 @@ function pieform_renderer_div(Pieform $form, $builtelement, $rawelement) { ...@@ -74,7 +74,7 @@ function pieform_renderer_div(Pieform $form, $builtelement, $rawelement) {
// Description - optional description of the element, or other note that should be visible // Description - optional description of the element, or other note that should be visible
// on the form itself (without the user having to hover over contextual help // on the form itself (without the user having to hover over contextual help
if (!empty($rawelement['description'])) { if ((!$form->has_errors() || $form->get_property('showdescriptiononerror')) && !empty($rawelement['description'])) {
$result .= '<div class="description"> ' . Pieform::hsc($rawelement['description']) . "</div>"; $result .= '<div class="description"> ' . Pieform::hsc($rawelement['description']) . "</div>";
} }
......
...@@ -99,7 +99,7 @@ function pieform_renderer_table(Pieform $form, $builtelement, $rawelement) { ...@@ -99,7 +99,7 @@ function pieform_renderer_table(Pieform $form, $builtelement, $rawelement) {
// Description - optional description of the element, or other note that should be visible // Description - optional description of the element, or other note that should be visible
// on the form itself (without the user having to hover over contextual help // on the form itself (without the user having to hover over contextual help
if (!empty($rawelement['description'])) { if ((!$form->has_errors() || $form->get_property('showdescriptiononerror')) && !empty($rawelement['description'])) {
$result .= "\t<tr>\n\t\t<td colspan=\"2\" class=\"description\">"; $result .= "\t<tr>\n\t\t<td colspan=\"2\" class=\"description\">";
$result .= $rawelement['description']; $result .= $rawelement['description'];
$result .= "</td>\n\t</tr>\n"; $result .= "</td>\n\t</tr>\n";
......
...@@ -272,6 +272,7 @@ $elements = array( ...@@ -272,6 +272,7 @@ $elements = array(
'password1' => array( 'password1' => array(
'type' => 'password', 'type' => 'password',
'title' => get_string('password'), 'title' => get_string('password'),
'description' => get_string('passwordformdescription', 'auth.internal'),
'rules' => array( 'rules' => array(
'required' => true 'required' => true
), ),
...@@ -376,6 +377,7 @@ $form = array( ...@@ -376,6 +377,7 @@ $form = array(
'plugintype' => 'core', 'plugintype' => 'core',
'pluginname' => 'register', 'pluginname' => 'register',
'action' => '', 'action' => '',
'showdescriptiononerror' => false,
'renderer' => 'table', 'renderer' => 'table',
'elements' => $elements 'elements' => $elements
); );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment