public static function getErrors($type = null)
{
$errors['required'] = FL::getError('FieldIsRequired');
$errors['email'] = FL::getError('EmailIsInvalid');
$errors['numeric'] = FL::getError('NumericCharactersOnly');
$errors['time'] = FL::getError('TimeIsInvalid');
// specific type
if ($type !== null) {
$type = (string) $type;
return $errors[$type];
} else {
// all errors
$return = array();
// loop errors
foreach ($errors as $key => $error) {
$return[] = array('type' => $key, 'message' => $error);
}
return $return;
}
}
/** * Parse the default error messages */ private function parseErrorMessages() { // set frontend locale FL::setLocale(BL::getWorkingLanguage(), true); // assign error messages $this->tpl->assign('errors', BackendFormBuilderModel::getErrors()); }