Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #226 from gburton/UpdateForms
Browse files Browse the repository at this point in the history
Update Forms
  • Loading branch information
gburton committed Oct 14, 2015
2 parents f44fb02 + c92f916 commit a1653ca
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 92 deletions.
13 changes: 6 additions & 7 deletions account_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@
<div class="form-group has-feedback">
<label for="inputFirstName" class="control-label col-sm-3"><?php echo ENTRY_FIRST_NAME; ?></label>
<div class="col-sm-9">
<?php echo tep_draw_input_field('firstname', $account['customers_firstname'], 'required aria-required="true" id="inputFirstName" placeholder="' . ENTRY_FIRST_NAME . '"'); ?>
<?php echo tep_draw_input_field('firstname', $account['customers_firstname'], 'required aria-required="true" id="inputFirstName" placeholder="' . ENTRY_FIRST_NAME_TEXT . '"'); ?>
<?php echo FORM_REQUIRED_INPUT; ?>
</div>
</div>
<div class="form-group has-feedback">
<label for="inputLastName" class="control-label col-sm-3"><?php echo ENTRY_LAST_NAME; ?></label>
<div class="col-sm-9">
<?php echo tep_draw_input_field('lastname', $account['customers_lastname'], 'required aria-required="true" id="inputLastName" placeholder="' . ENTRY_LAST_NAME . '"'); ?>
<?php echo tep_draw_input_field('lastname', $account['customers_lastname'], 'required aria-required="true" id="inputLastName" placeholder="' . ENTRY_LAST_NAME_TEXT . '"'); ?>
<?php echo FORM_REQUIRED_INPUT; ?>
</div>
</div>
Expand All @@ -183,8 +183,7 @@
<div class="form-group has-feedback">
<label for="inputName" class="control-label col-sm-3"><?php echo ENTRY_DATE_OF_BIRTH; ?></label>
<div class="col-sm-9">
<?php echo tep_draw_input_field('dob', tep_date_short($account['customers_dob']), 'required aria-required="true" aria-describedby="atDob" id="dob" placeholder="' . ENTRY_DATE_OF_BIRTH_TEXT . '"'); ?>
<?php if (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT)) echo '<span id="atDob" class="help-block">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>'; ?>
<?php echo tep_draw_input_field('dob', tep_date_short($account['customers_dob']), 'required aria-required="true" id="dob" placeholder="' . ENTRY_DATE_OF_BIRTH_TEXT . '"'); ?>
<?php echo FORM_REQUIRED_INPUT; ?>
</div>
</div>
Expand All @@ -195,21 +194,21 @@
<div class="form-group has-feedback">
<label for="inputEmail" class="control-label col-sm-3"><?php echo ENTRY_EMAIL_ADDRESS; ?></label>
<div class="col-sm-9">
<?php echo tep_draw_input_field('email_address', $account['customers_email_address'], 'required aria-required="true" id="inputEmail" placeholder="' . ENTRY_EMAIL_ADDRESS . '"', 'email'); ?>
<?php echo tep_draw_input_field('email_address', $account['customers_email_address'], 'required aria-required="true" id="inputEmail" placeholder="' . ENTRY_EMAIL_ADDRESS_TEXT . '"', 'email'); ?>
<?php echo FORM_REQUIRED_INPUT; ?>
</div>
</div>
<div class="form-group has-feedback">
<label for="inputTelephone" class="control-label col-sm-3"><?php echo ENTRY_TELEPHONE_NUMBER; ?></label>
<div class="col-sm-9">
<?php echo tep_draw_input_field('telephone', $account['customers_telephone'], 'required aria-required="true" id="inputTelephone" placeholder="' . ENTRY_TELEPHONE_NUMBER . '"', 'tel'); ?>
<?php echo tep_draw_input_field('telephone', $account['customers_telephone'], 'required aria-required="true" id="inputTelephone" placeholder="' . ENTRY_TELEPHONE_NUMBER_TEXT . '"', 'tel'); ?>
<?php echo FORM_REQUIRED_INPUT; ?>
</div>
</div>
<div class="form-group">
<label for="inputFax" class="control-label col-sm-3"><?php echo ENTRY_FAX_NUMBER; ?></label>
<div class="col-sm-9">
<?php echo tep_draw_input_field('fax', $account['customers_fax'], 'id="inputFax" placeholder="' . ENTRY_FAX_NUMBER . '"'); ?>
<?php echo tep_draw_input_field('fax', $account['customers_fax'], 'id="inputFax" placeholder="' . ENTRY_FAX_NUMBER_TEXT . '"'); ?>
</div>
</div>

Expand Down
9 changes: 3 additions & 6 deletions account_password.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,25 +82,22 @@
<div class="form-group has-feedback">
<label for="inputCurrent" class="control-label col-sm-3"><?php echo ENTRY_PASSWORD_CURRENT; ?></label>
<div class="col-sm-9">
<?php echo tep_draw_input_field('password_current', NULL, 'required aria-required="true" aria-describedby="atPassword" autofocus="autofocus" id="inputCurrent" placeholder="' . ENTRY_PASSWORD_CURRENT . '"', 'password'); ?>
<?php echo tep_draw_input_field('password_current', NULL, 'required aria-required="true" autofocus="autofocus" id="inputCurrent" placeholder="' . ENTRY_PASSWORD_CURRENT_TEXT . '"', 'password'); ?>
<?php echo FORM_REQUIRED_INPUT; ?>
<?php if (tep_not_null(ENTRY_PASSWORD_CURRENT_TEXT)) echo '<span id="atPassword" class="help-block">' . ENTRY_PASSWORD_CURRENT_TEXT . '</span>'; ?>
</div>
</div>
<div class="form-group has-feedback">
<label for="inputNew" class="control-label col-sm-3"><?php echo ENTRY_PASSWORD_NEW; ?></label>
<div class="col-sm-9">
<?php echo tep_draw_input_field('password_new', NULL, 'required aria-required="true" aria-describedby="atNewPassword" id="inputNew" placeholder="' . ENTRY_PASSWORD_NEW . '"', 'password'); ?>
<?php echo tep_draw_input_field('password_new', NULL, 'required aria-required="true" id="inputNew" placeholder="' . ENTRY_PASSWORD_NEW_TEXT . '"', 'password'); ?>
<?php echo FORM_REQUIRED_INPUT; ?>
<?php if (tep_not_null(ENTRY_PASSWORD_NEW_TEXT)) echo '<span id="atNewPassword" class="help-block">' . ENTRY_PASSWORD_NEW_TEXT . '</span>'; ?>
</div>
</div>
<div class="form-group has-feedback">
<label for="inputConfirmation" class="control-label col-sm-3"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></label>
<div class="col-sm-9">
<?php echo tep_draw_input_field('password_confirmation', NULL, 'required aria-required="true" aria-describedby="atNewPasswordConfirmation" id="inputConfirmation" placeholder="' . ENTRY_PASSWORD_CONFIRMATION . '"', 'password'); ?>
<?php echo tep_draw_input_field('password_confirmation', NULL, 'required aria-required="true" id="inputConfirmation" placeholder="' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '"', 'password'); ?>
<?php echo FORM_REQUIRED_INPUT; ?>
<?php if (tep_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT)) echo '<span id="atNewPasswordConfirmation" class="help-block">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>'; ?>
</div>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions advanced_search.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,31 +180,31 @@ function check_form() {
<label for="PriceFrom" class="control-label col-sm-3"><?php echo ENTRY_PRICE_FROM; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('pfrom', '', 'id="PriceFrom" placeholder="' . ENTRY_PRICE_FROM . '"');
echo tep_draw_input_field('pfrom', '', 'id="PriceFrom" placeholder="' . ENTRY_PRICE_FROM_TEXT . '"');
?>
</div>
</div>
<div class="form-group">
<label for="PriceTo" class="control-label col-sm-3"><?php echo ENTRY_PRICE_TO; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('pto', '', 'id="PriceTo" placeholder="' . ENTRY_PRICE_TO . '"');
echo tep_draw_input_field('pto', '', 'id="PriceTo" placeholder="' . ENTRY_PRICE_TO_TEXT . '"');
?>
</div>
</div>
<div class="form-group">
<label for="dfrom" class="control-label col-sm-3"><?php echo ENTRY_DATE_FROM; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('dfrom', '', 'id="dfrom" placeholder="' . ENTRY_DATE_FROM . '"');
echo tep_draw_input_field('dfrom', '', 'id="dfrom" placeholder="' . ENTRY_DATE_FROM_TEXT . '"');
?>
</div>
</div>
<div class="form-group">
<label for="dto" class="control-label col-sm-3"><?php echo ENTRY_DATE_TO; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('dto', '', 'id="dto" placeholder="' . ENTRY_DATE_TO . '"');
echo tep_draw_input_field('dto', '', 'id="dto" placeholder="' . ENTRY_DATE_TO_TEXT . '"');
?>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions contact_us.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<label for="inputFromName" class="control-label col-sm-3"><?php echo ENTRY_NAME; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('name', NULL, 'required autofocus="autofocus" aria-required="true" id="inputFromName" placeholder="' . ENTRY_NAME . '"');
echo tep_draw_input_field('name', NULL, 'required autofocus="autofocus" aria-required="true" id="inputFromName" placeholder="' . ENTRY_NAME_TEXT . '"');
echo FORM_REQUIRED_INPUT;
?>
</div>
Expand All @@ -97,7 +97,7 @@
<label for="inputFromEmail" class="control-label col-sm-3"><?php echo ENTRY_EMAIL; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('email', NULL, 'required aria-required="true" id="inputFromEmail" placeholder="' . ENTRY_EMAIL . '"', 'email');
echo tep_draw_input_field('email', NULL, 'required aria-required="true" id="inputFromEmail" placeholder="' . ENTRY_EMAIL_ADDRESS_TEXT . '"', 'email');
echo FORM_REQUIRED_INPUT;
?>
</div>
Expand All @@ -106,7 +106,7 @@
<label for="inputEnquiry" class="control-label col-sm-3"><?php echo ENTRY_ENQUIRY; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, NULL, 'required aria-required="true" id="inputEnquiry" placeholder="' . ENTRY_ENQUIRY . '"');
echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, NULL, 'required aria-required="true" id="inputEnquiry" placeholder="' . ENTRY_ENQUIRY_TEXT . '"');
echo FORM_REQUIRED_INPUT;
?>
</div>
Expand Down
45 changes: 16 additions & 29 deletions create_account.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,19 +301,17 @@
<label for="inputFirstName" class="control-label col-sm-3"><?php echo ENTRY_FIRST_NAME; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('firstname', NULL, 'required aria-required="true" aria-describedby="atFirstname" id="inputFirstName" placeholder="' . ENTRY_FIRST_NAME . '"');
echo tep_draw_input_field('firstname', NULL, 'required aria-required="true" id="inputFirstName" placeholder="' . ENTRY_FIRST_NAME_TEXT . '"');
echo FORM_REQUIRED_INPUT;
if (tep_not_null(ENTRY_FIRST_NAME_TEXT)) echo '<span id="atFirstName" class="help-block">' . ENTRY_FIRST_NAME_TEXT . '</span>';
?>
</div>
</div>
<div class="form-group has-feedback">
<label for="inputLastName" class="control-label col-sm-3"><?php echo ENTRY_LAST_NAME; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('lastname', NULL, 'required aria-required="true" aria-describedby="atLastname" id="inputLastName" placeholder="' . ENTRY_LAST_NAME . '"');
echo tep_draw_input_field('lastname', NULL, 'required aria-required="true" id="inputLastName" placeholder="' . ENTRY_LAST_NAME_TEXT . '"');
echo FORM_REQUIRED_INPUT;
if (tep_not_null(ENTRY_LAST_NAME_TEXT)) echo '<span id="atLastname" class="help-block">' . ENTRY_LAST_NAME_TEXT . '</span>';
?>
</div>
</div>
Expand All @@ -324,9 +322,8 @@
<label for="dob" class="control-label col-sm-3"><?php echo ENTRY_DATE_OF_BIRTH; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('dob', '', 'required aria-required="true" aria-describedby="atDob" id="dob" placeholder="' . ENTRY_DATE_OF_BIRTH . '"');
echo tep_draw_input_field('dob', '', 'required aria-required="true" id="dob" placeholder="' . ENTRY_DATE_OF_BIRTH_TEXT . '"');
echo FORM_REQUIRED_INPUT;
if (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT)) echo '<span id="atDob" class="help-block">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>';
?>
</div>
</div>
Expand All @@ -337,9 +334,8 @@
<label for="inputEmail" class="control-label col-sm-3"><?php echo ENTRY_EMAIL_ADDRESS; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('email_address', NULL, 'required aria-required="true" aria-describedby="atEmail" id="inputEmail" placeholder="' . ENTRY_EMAIL_ADDRESS . '"', 'email');
echo tep_draw_input_field('email_address', NULL, 'required aria-required="true" id="inputEmail" placeholder="' . ENTRY_EMAIL_ADDRESS_TEXT . '"', 'email');
echo FORM_REQUIRED_INPUT;
if (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT)) echo '<span id="atEmail" class="help-block">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>';
?>
</div>
</div>
Expand All @@ -355,8 +351,7 @@
<label for="inputCompany" class="control-label col-sm-3"><?php echo ENTRY_COMPANY; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('company', NULL, 'id="inputCompany" aria-describedby="atCompany" placeholder="' . ENTRY_COMPANY . '"');
if (tep_not_null(ENTRY_COMPANY_TEXT)) echo '<span id="atCompany" class="help-block">' . ENTRY_COMPANY_TEXT . '</span>';
echo tep_draw_input_field('company', NULL, 'id="inputCompany" placeholder="' . ENTRY_COMPANY_TEXT . '"');
?>
</div>
</div>
Expand All @@ -372,9 +367,8 @@
<label for="inputStreet" class="control-label col-sm-3"><?php echo ENTRY_STREET_ADDRESS; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('street_address', NULL, 'required aria-required="true" aria-describedby="atStreetAddress" id="inputStreet" placeholder="' . ENTRY_STREET_ADDRESS . '"');
echo tep_draw_input_field('street_address', NULL, 'required aria-required="true" id="inputStreet" placeholder="' . ENTRY_STREET_ADDRESS_TEXT . '"');
echo FORM_REQUIRED_INPUT;
if (tep_not_null(ENTRY_STREET_ADDRESS_TEXT)) echo '<span id="atStreetAddress" class="help-block">' . ENTRY_STREET_ADDRESS_TEXT . '</span>';
?>
</div>
</div>
Expand All @@ -386,8 +380,7 @@
<label for="inputSuburb" class="control-label col-sm-3"><?php echo ENTRY_SUBURB; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('suburb', NULL, 'id="inputSuburb" aria-describedby="atSuburb" placeholder="' . ENTRY_SUBURB . '"');
if (tep_not_null(ENTRY_SUBURB_TEXT)) echo '<span id="atSuburb" class="help-block">' . ENTRY_SUBURB_TEXT . '</span>';
echo tep_draw_input_field('suburb', NULL, 'id="inputSuburb" placeholder="' . ENTRY_SUBURB_TEXT . '"');
?>
</div>
</div>
Expand All @@ -398,19 +391,17 @@
<label for="inputCity" class="control-label col-sm-3"><?php echo ENTRY_CITY; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('city', NULL, 'required aria-required="true" aria-describedby="atCity" id="inputCity" placeholder="' . ENTRY_CITY. '"');
echo tep_draw_input_field('city', NULL, 'required aria-required="true" id="inputCity" placeholder="' . ENTRY_CITY_TEXT. '"');
echo FORM_REQUIRED_INPUT;
if (tep_not_null(ENTRY_CITY_TEXT)) echo '<span id="atCity" class="help-block">' . ENTRY_CITY_TEXT . '</span>';
?>
</div>
</div>
<div class="form-group has-feedback">
<label for="inputZip" class="control-label col-sm-3"><?php echo ENTRY_POST_CODE; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('postcode', NULL, 'required aria-required="true" aria-describedby="atZip" id="inputZip" placeholder="' . ENTRY_POST_CODE . '"');
echo tep_draw_input_field('postcode', NULL, 'required aria-required="true" id="inputZip" placeholder="' . ENTRY_POST_CODE_TEXT . '"');
echo FORM_REQUIRED_INPUT;
if (tep_not_null(ENTRY_POST_CODE_TEXT)) echo '<span id="atZip" class="help-block">' . ENTRY_POST_CODE_TEXT . '</span>';
?>
</div>
</div>
Expand All @@ -430,15 +421,15 @@
}
echo tep_draw_pull_down_menu('state', $zones_array, 0, 'id="inputState" aria-describedby="atState"');
echo FORM_REQUIRED_INPUT;
if (tep_not_null(ENTRY_STATE_TEXT)) echo '<span id="atState" class="help-block">' . ENTRY_STATE_TEXT . '</span>';
} else {
echo tep_draw_input_field('state', NULL, 'id="inputState" aria-describedby="atState" placeholder="' . ENTRY_STATE . '"');
echo tep_draw_input_field('state', NULL, 'id="inputState" placeholder="' . ENTRY_STATE_TEXT . '"');
echo FORM_REQUIRED_INPUT;
}
} else {
echo tep_draw_input_field('state', NULL, 'id="inputState" aria-describedby="atState" placeholder="' . ENTRY_STATE . '"');
echo tep_draw_input_field('state', NULL, 'id="inputState" placeholder="' . ENTRY_STATE_TEXT . '"');
echo FORM_REQUIRED_INPUT;
}
if (tep_not_null(ENTRY_STATE_TEXT)) echo '<span id="atState" class="help-block">' . ENTRY_STATE_TEXT . '</span>';
?>
</div>
</div>
Expand All @@ -464,18 +455,16 @@
<label for="inputTelephone" class="control-label col-sm-3"><?php echo ENTRY_TELEPHONE_NUMBER; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('telephone', NULL, 'required aria-required="true" aria-describedby="atTelephone" id="inputTelephone" placeholder="' . ENTRY_TELEPHONE_NUMBER . '"', 'tel');
echo tep_draw_input_field('telephone', NULL, 'required aria-required="true" id="inputTelephone" placeholder="' . ENTRY_TELEPHONE_NUMBER_TEXT . '"', 'tel');
echo FORM_REQUIRED_INPUT;
if (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT)) echo '<span id="atTelephone" class="help-block">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>';
?>
</div>
</div>
<div class="form-group">
<label for="inputFax" class="control-label col-sm-3"><?php echo ENTRY_FAX_NUMBER; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('fax', '', 'id="inputFax" aria-describedby="atFax" placeholder="' . ENTRY_FAX_NUMBER . '"', 'tel');
if (tep_not_null(ENTRY_FAX_NUMBER_TEXT)) echo '<span id="atFax" class="help-block">' . ENTRY_FAX_NUMBER_TEXT . '</span>';
echo tep_draw_input_field('fax', '', 'id="inputFax" placeholder="' . ENTRY_FAX_NUMBER_TEXT . '"', 'tel');
?>
</div>
</div>
Expand All @@ -500,19 +489,17 @@
<label for="inputPassword" class="control-label col-sm-3"><?php echo ENTRY_PASSWORD; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('password', NULL, 'required aria-required="true" aria-describedby="atPassword" id="inputPassword" placeholder="' . ENTRY_PASSWORD . '"', 'password');
echo tep_draw_input_field('password', NULL, 'required aria-required="true" id="inputPassword" placeholder="' . ENTRY_PASSWORD_TEXT . '"', 'password');
echo FORM_REQUIRED_INPUT;
if (tep_not_null(ENTRY_PASSWORD_TEXT)) echo '<span id="atPassword" class="help-block">' . ENTRY_PASSWORD_TEXT . '</span>';
?>
</div>
</div>
<div class="form-group has-feedback">
<label for="inputConfirmation" class="control-label col-sm-3"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></label>
<div class="col-sm-9">
<?php
echo tep_draw_input_field('confirmation', NULL, 'required aria-required="true" aria-describedby="atPasswordNew" id="inputConfirmation" placeholder="' . ENTRY_PASSWORD_CONFIRMATION . '"', 'password');
echo tep_draw_input_field('confirmation', NULL, 'required aria-required="true" id="inputConfirmation" placeholder="' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '"', 'password');
echo FORM_REQUIRED_INPUT;
if (tep_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT)) echo '<span id="atPasswordNew" class="help-block">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>';
?>
</div>
</div>
Expand Down
Loading

1 comment on commit a1653ca

@skleiner
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gburton I've updated to this commit and all's good but I wanted to comment on the file change for:/includes/modules/content/login/templates/login_form.php
Have no info in the english.php for ENTRY_EMAIL_ADDRESS_TEXT and ENTRY_PASSWORD_TEXT defines could be be a bit confusing for the new user for example at the login page where it wants a repeat customer to sign in with email and password. With no helper text there, the user could be a bit lost on what to do.
So I put text in the english.php file for those definitions to help a customer out. By doing that the helper text shows up elsewhere, such as create_account.php.
I'm going to leave it that way, but perhaps a better way would be to create new defines for just the template/login_form,php that would not affect other forms.

Please sign in to comment.