diff options
-rw-r--r-- | includes/form.inc | 16 | ||||
-rw-r--r-- | modules/profile.module | 10 | ||||
-rw-r--r-- | modules/profile/profile.module | 10 |
3 files changed, 13 insertions, 23 deletions
diff --git a/includes/form.inc b/includes/form.inc index 72a6463cf..e5bfd61d9 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -493,13 +493,13 @@ function theme_radios($element) { } /** - * Format a set of radio buttons. + * Format a date selection element. * * @param $element * An associative array containing the properties of the element. * Properties used : title, value, options, description, required and attributes. * @return - * A themed HTML string representing the radio button set. + * A themed HTML string representing the date selection boxes. */ function theme_date($element) { $output = '<div class="container-inline">' . $element['#children'] . '</div>'; @@ -507,7 +507,7 @@ function theme_date($element) { } /** - * Roll out a single checkbox element to a list of checkboxes, using the options array as index. + * Roll out a single date element. */ function expand_date($element) { // Default to current date @@ -533,7 +533,7 @@ function expand_date($element) { $options = drupal_map_assoc(range(1, 31)); break; case 'month': - $options = drupal_map_assoc(range(1, 12), '_profile_map_month'); + $options = drupal_map_assoc(range(1, 12), 'map_month'); break; case 'year': $options = drupal_map_assoc(range(1900, 2050)); @@ -545,9 +545,15 @@ function expand_date($element) { return $element; } +/** + * Helper function for usage with drupal_map_assoc to display month names. + */ +function map_month($month) { + return format_date(gmmktime(0, 0, 0, $month, 2, 1970), 'custom', 'M', 0); +} /** - * Roll out a single adios element + * Roll out a single radios element * to a list of radios, using the options array as index. */ function expand_radios($element) { diff --git a/modules/profile.module b/modules/profile.module index dc626b8d0..43adbe58d 100644 --- a/modules/profile.module +++ b/modules/profile.module @@ -286,7 +286,7 @@ function profile_view_field($user, $field) { $replace = array('d' => sprintf('%02d', $value['day']), 'j' => $value['day'], 'm' => sprintf('%02d', $value['month']), - 'M' => _profile_map_month($value['month']), + 'M' => map_month($value['month']), 'Y' => $value['year']); return strtr($format, $replace); case 'list': @@ -398,14 +398,6 @@ function _profile_update_user_fields(&$fields, $account) { } } - -/** - * Helper function for usage with drupal_map_assoc - */ -function _profile_map_month($month) { - return format_date(gmmktime(0, 0, 0, $month, 2, 1970), 'custom', 'M', 0); -} - function profile_validate_profile($edit, $category) { if ($_GET['q'] == 'user/register' || $_GET['q'] == 'admin/user/create') { diff --git a/modules/profile/profile.module b/modules/profile/profile.module index dc626b8d0..43adbe58d 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -286,7 +286,7 @@ function profile_view_field($user, $field) { $replace = array('d' => sprintf('%02d', $value['day']), 'j' => $value['day'], 'm' => sprintf('%02d', $value['month']), - 'M' => _profile_map_month($value['month']), + 'M' => map_month($value['month']), 'Y' => $value['year']); return strtr($format, $replace); case 'list': @@ -398,14 +398,6 @@ function _profile_update_user_fields(&$fields, $account) { } } - -/** - * Helper function for usage with drupal_map_assoc - */ -function _profile_map_month($month) { - return format_date(gmmktime(0, 0, 0, $month, 2, 1970), 'custom', 'M', 0); -} - function profile_validate_profile($edit, $category) { if ($_GET['q'] == 'user/register' || $_GET['q'] == 'admin/user/create') { |