diff -u includes/form.inc includes/form.inc --- includes/form.inc 1 Dec 2009 17:12:02 -0000 +++ includes/form.inc 2 Dec 2009 01:55:53 -0000 @@ -2832,38 +2832,37 @@ /** * Theme a form element. * - * Each form element is wrapped in a div with #type and #name classes. In + * Each form element is wrapped in a DIV with #type and #name classes. In * addition to the element itself, the div contains a label before or after * the element based on the optional #title_display property. After the label * and fields this function outputs the optional element #description. * * The optional #title_display property can have these values: * - before: The label is output before the element. This is the default. - * The label includes the #title and the required marker, if #required. + * The label includes the #title and the required marker, if #required. * - after: The label is output after the element. For example, this is used - * for radio and checkbox #type elements as set in system_element_info(). - * If the #title is empty but the field is #required, the label will - * contain only the required marker. + * for radio and checkbox #type elements as set in system_element_info(). + * If the #title is empty but the field is #required, the label will + * contain only the required marker. * - attribute: Set the title attribute on the element to create a tooltip - * but output no label element. This is supported only for checkboxes - * and radios in form_pre_render_conditional_form_element(). It is used - * where a visual label is not needed, such as a table of checkboxes where - * the row and column provide the context. The tooltip will include the - * title and required marker. - * The label or attribute includes a required marker for required fields. - * - * If the #title property is not set the label and any required marker will - * not be displayed. This is used by the password_confirm element #type. - * The password_confirm field creates children elements that have their own - * labels and required markers, but the parent element should have neither. - * Use this carefully because a field with no label and no surrounding context - * causes challenges for accessibility. + * but output no label element. This is supported only for checkboxes + * and radios in form_pre_render_conditional_form_element(). It is used + * where a visual label is not needed, such as a table of checkboxes where + * the row and column provide the context. The tooltip will include the + * title and required marker. + * + * If the #title property is not set, then the label and any required marker + * will not be output, regardless of the #title_display or #required values. + * This can be useful in cases such as the password_confirm element, which + * creates children elements that have their own labels and required markers, + * but the parent element should have neither. Use this carefully because a + * field without an associated label can cause accessibility challenges. * * @param $variables * An associative array containing: * - element: An associative array containing the properties of the element. - * Properties used: #title, #description, #id, #required, #children, #type, - * #name, #title_display. + * Properties used: #title, #title_display, #description, #id, #required, + * #children, #type, #name. * * @return * A string representing the form element. @@ -2884,9 +2883,9 @@ $class[] = 'form-item-' . strtr($element['#name'], array(' ' => '-', '_' => '-', '[' => '-', ']' => '')); } - - // If #title is not present, we don't display any label or required marker + + // If #title is not set, we don't display any label or required marker. if (!isset($element['#title'])) { - $element['#title_display'] = 'none'; + $element['#title_display'] = 'none'; } $output = '