From 81938a3cdc7b9bd13d58e355c59d9835e830fea4 Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Fri, 18 Aug 2006 12:17:00 +0000 Subject: #76802: Introduce placeholder magic into t() See: http://drupal.org/node/64279#t-placeholders --- includes/form.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'includes/form.inc') diff --git a/includes/form.inc b/includes/form.inc index 3fe498406..291933d1f 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -283,7 +283,7 @@ function _form_validate($elements, $form_id = NULL) { // and a textfield could return '0' and empty('0') returns TRUE so we // need a special check for the '0' string. if ($elements['#required'] && empty($elements['#value']) && $elements['#value'] !== '0') { - form_error($elements, t('%name field is required.', array('%name' => $elements['#title']))); + form_error($elements, t('!name field is required.', array('!name' => $elements['#title']))); } // Add legal choice check if element has #options. Can be skipped, but then you must validate your own element. @@ -299,7 +299,7 @@ function _form_validate($elements, $form_id = NULL) { foreach ($value as $v) { if (!isset($options[$v])) { form_error($elements, t('An illegal choice has been detected. Please contact the site administrator.')); - watchdog('form', t('Illegal choice %choice in %name element.', array('%choice' => theme('placeholder', check_plain($v)), '%name' => theme_placeholder(empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']))), WATCHDOG_ERROR); + watchdog('form', t('Illegal choice %choice in !name element.', array('%choice' => $v, '!name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title'])), WATCHDOG_ERROR); } } } @@ -1147,10 +1147,10 @@ function theme_form_element($element, $value) { if (!empty($element['#title'])) { $title = $element['#title']; if (!empty($element['#id'])) { - $output .= ' \n"; + $output .= ' \n"; } else { - $output .= ' \n"; + $output .= ' \n"; } } -- cgit v1.2.3