function regcode_errormsg in Registration codes 7
Same name and namespace in other branches
- 8 regcode.module \regcode_errormsg()
- 6.2 regcode.module \regcode_errormsg()
- 7.2 regcode.module \regcode_errormsg()
Return text message requested by given identifier/constant.
Parameters
int $err: The error message code.
Return value
string The text of the message.
2 calls to regcode_errormsg()
- regcode_code_element_validate in ./regcode.module 
- Validate the content of the code-field on user registration.
- regcode_voucher_profiletab_form_validate in regcode_voucher/regcode_voucher.module 
- Validate handler for regcode_voucher_admin_form().
File
- ./regcode.module, line 335 
- Main functionality and hooks of regcode module.
Code
function regcode_errormsg($err) {
  $messages = array(
    REGCODE_VALIDITY_NOTEXISTING => t('Registration code does not exist'),
    REGCODE_VALIDITY_NOTAVAILABLE => t('Registration code is not available'),
    REGCODE_VALIDITY_TAKEN => t('Registration code has already been used'),
    REGCODE_VALIDITY_EXPIRED => t('Registration code has expired'),
  );
  $msg = FALSE;
  if (isset($messages[$err])) {
    $msg = $messages[$err];
  }
  return $msg;
}