From b0cbc018ec0ab568a6c9bff712a331417a3ccd8d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 20 Oct 2010 01:31:07 +0000 Subject: - Patch #882694 by mgifford, sun, ksenzee, bleen18, yched: add missing form element titles for accessibility. --- includes/form.inc | 14 +++++++++++- modules/book/book.admin.inc | 5 +++-- modules/comment/comment.admin.inc | 2 ++ modules/comment/comment.module | 2 ++ modules/field/field.form.inc | 2 ++ modules/field_ui/field_ui.admin.inc | 40 ++++++++++++++++++++++++++++++++- modules/file/file.field.inc | 24 ++++++++++++++++++++ modules/file/file.module | 2 ++ modules/filter/filter.admin.inc | 9 +++++++- modules/image/image.admin.inc | 6 +++++ modules/image/image.field.inc | 8 +++++++ modules/locale/locale.admin.inc | 21 ++++++++++++++--- modules/menu/menu.admin.inc | 4 +++- modules/node/node.admin.inc | 2 ++ modules/poll/poll.module | 8 +++++++ modules/profile/profile.admin.inc | 15 +++++++++++-- modules/search/search.admin.inc | 2 ++ modules/search/search.module | 2 ++ modules/shortcut/shortcut.admin.inc | 2 ++ modules/simpletest/simpletest.pages.inc | 2 +- modules/system/system.admin.inc | 4 ++++ modules/taxonomy/taxonomy.admin.inc | 11 ++++++--- modules/trigger/trigger.admin.inc | 2 ++ modules/user/user.admin.inc | 6 +++++ 24 files changed, 180 insertions(+), 15 deletions(-) diff --git a/includes/form.inc b/includes/form.inc index c2c179026..89f6d5ab9 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -2658,19 +2658,24 @@ function form_process_date($element) { switch ($type) { case 'day': $options = drupal_map_assoc(range(1, 31)); + $title = t('Day'); break; case 'month': $options = drupal_map_assoc(range(1, 12), 'map_month'); + $title = t('Month'); break; case 'year': $options = drupal_map_assoc(range(1900, 2050)); + $title = t('Year'); break; } $element[$type] = array( '#type' => 'select', + '#title' => $title, + '#title_display' => 'invisible', '#value' => $element['#value'][$type], '#attributes' => $element['#attributes'], '#options' => $options, @@ -3000,9 +3005,16 @@ function form_process_tableselect($element) { // Do not overwrite manually created children. if (!isset($element[$key])) { if ($element['#multiple']) { + $title = ''; + if (!empty($element['#options'][$key]['title']['data']['#title'])) { + $title = t('Update @title', array( + '@title' => $element['#options'][$key]['title']['data']['#title'], + )); + } $element[$key] = array( '#type' => 'checkbox', - '#title' => '', + '#title' => $title, + '#title_display' => 'invisible', '#return_value' => $key, '#default_value' => isset($value[$key]) ? $key : NULL, '#attributes' => $element['#attributes'], diff --git a/modules/book/book.admin.inc b/modules/book/book.admin.inc index b3c3eaff7..53f4b40e8 100644 --- a/modules/book/book.admin.inc +++ b/modules/book/book.admin.inc @@ -191,11 +191,12 @@ function _book_admin_table_tree($tree, &$form) { '#type' => 'weight', '#default_value' => $data['link']['weight'], '#delta' => 15, + '#title' => t('Weight for @title', array('@title' => $data['link']['title'])), + '#title_display' => 'invisible', ), 'plid' => array( - '#type' => 'textfield', + '#type' => 'hidden', '#default_value' => $data['link']['plid'], - '#size' => 6, ), 'mlid' => array( '#type' => 'hidden', diff --git a/modules/comment/comment.admin.inc b/modules/comment/comment.admin.inc index 76d5aa3dc..1d868b9f0 100644 --- a/modules/comment/comment.admin.inc +++ b/modules/comment/comment.admin.inc @@ -50,6 +50,8 @@ function comment_admin_overview($form, &$form_state, $arg) { $form['options']['operation'] = array( '#type' => 'select', + '#title' => t('Operation'), + '#title_display' => 'invisible', '#options' => $options, '#default_value' => 'publish', ); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index cef42dbfc..70789b794 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1171,6 +1171,8 @@ function comment_form_node_form_alter(&$form, $form_state) { $comment_settings = ($node->comment == COMMENT_NODE_HIDDEN && empty($comment_count)) ? COMMENT_NODE_CLOSED : $node->comment; $form['comment_settings']['comment'] = array( '#type' => 'radios', + '#title' => t('Comments'), + '#title_display' => 'invisible', '#parents' => array('comment'), '#default_value' => $comment_settings, '#options' => array( diff --git a/modules/field/field.form.inc b/modules/field/field.form.inc index e042fd728..d5778dfc5 100644 --- a/modules/field/field.form.inc +++ b/modules/field/field.form.inc @@ -172,6 +172,8 @@ function field_multiple_value_form($field, $instance, $langcode, $items, &$form, // defined by widget. $element['_weight'] = array( '#type' => 'weight', + '#title' => t('Weight for row @number', array('@number' => $delta + 1)), + '#title_display' => 'invisible', // Note: this 'delta' is the FAPI 'weight' element's property. '#delta' => $max, '#default_value' => isset($items[$delta]['_weight']) ? $items[$delta]['_weight'] : $delta, diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc index 39c5e2716..8db42d697 100644 --- a/modules/field_ui/field_ui.admin.inc +++ b/modules/field_ui/field_ui.admin.inc @@ -326,6 +326,8 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle ), 'weight' => array( '#type' => 'textfield', + '#title' => t('Weight for @title', array('@title' => $instance['label'])), + '#title_display' => 'invisible', '#default_value' => $instance['widget']['weight'], '#size' => 3, '#attributes' => array('class' => array('field-weight')), @@ -333,6 +335,8 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle 'parent_wrapper' => array( 'parent' => array( '#type' => 'select', + '#title' => t('Parent for @title', array('@title' => $instance['label'])), + '#title_display' => 'invisible', '#options' => $table['#parent_options'], '#attributes' => array('class' => array('field-parent')), '#parents' => array('fields', $name, 'parent'), @@ -394,11 +398,13 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle '#size' => 3, '#attributes' => array('class' => array('field-weight')), '#title_display' => 'invisible', - '#title' => t('Weight for @row', array('@row' => $extra_field['label'])), + '#title' => t('Weight for @title', array('@title' => $extra_field['label'])), ), 'parent_wrapper' => array( 'parent' => array( '#type' => 'select', + '#title' => t('Parent for @title', array('@title' => $extra_field['label'])), + '#title_display' => 'invisible', '#options' => $table['#parent_options'], '#attributes' => array('class' => array('field-parent')), '#parents' => array('fields', $name, 'parent'), @@ -437,6 +443,8 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle '#region_callback' => 'field_ui_field_overview_row_region', 'label' => array( '#type' => 'textfield', + '#title' => t('New field label'), + '#title_display' => 'invisible', '#size' => 15, '#description' => t('Label'), '#prefix' => '
' . t('Add new field') .'
', @@ -454,6 +462,8 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle 'parent_wrapper' => array( 'parent' => array( '#type' => 'select', + '#title' => t('Parent for new field'), + '#title_display' => 'invisible', '#options' => $table['#parent_options'], '#attributes' => array('class' => array('field-parent')), '#prefix' => '
 
', @@ -467,6 +477,8 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle ), 'field_name' => array( '#type' => 'textfield', + '#title' => t('New field name'), + '#title_display' => 'invisible', // This field should stay LTR even for RTL languages. '#field_prefix' => 'field_', '#field_suffix' => '‎', @@ -477,6 +489,8 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle ), 'type' => array( '#type' => 'select', + '#title' => t('Type of new field'), + '#title_display' => 'invisible', '#options' => $field_type_options, '#empty_option' => t('- Select a field type -'), '#description' => t('Type of data to store.'), @@ -485,6 +499,8 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle ), 'widget_type' => array( '#type' => 'select', + '#title' => t('Widget for new field'), + '#title_display' => 'invisible', '#options' => $widget_type_options, '#empty_option' => t('- Select a widget -'), '#description' => t('Form element to edit the data.'), @@ -505,6 +521,8 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle '#region_callback' => 'field_ui_field_overview_row_region', 'label' => array( '#type' => 'textfield', + '#title' => t('Existing field label'), + '#title_display' => 'invisible', '#size' => 15, '#description' => t('Label'), '#attributes' => array('class' => array('label-textfield')), @@ -523,6 +541,8 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle 'parent_wrapper' => array( 'parent' => array( '#type' => 'select', + '#title' => t('Parent for existing field'), + '#title_display' => 'invisible', '#options' => $table['#parent_options'], '#attributes' => array('class' => array('field-parent')), '#prefix' => '
 
', @@ -536,6 +556,8 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle ), 'field_name' => array( '#type' => 'select', + '#title' => t('Existing field to share'), + '#title_display' => 'invisible', '#options' => $existing_field_options, '#empty_option' => t('- Select an existing field -'), '#description' => t('Field to share'), @@ -545,6 +567,8 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle ), 'widget_type' => array( '#type' => 'select', + '#title' => t('Widget for existing field'), + '#title_display' => 'invisible', '#options' => $widget_type_options, '#empty_option' => t('- Select a widget -'), '#description' => t('Form element to edit the data.'), @@ -880,6 +904,8 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund ), 'weight' => array( '#type' => 'textfield', + '#title' => t('Weight for @title', array('@title' => $instance['label'])), + '#title_display' => 'invisible', '#default_value' => $display['weight'], '#size' => 3, '#attributes' => array('class' => array('field-weight')), @@ -887,6 +913,8 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund 'parent_wrapper' => array( 'parent' => array( '#type' => 'select', + '#title' => t('Label display for @title', array('@title' => $instance['label'])), + '#title_display' => 'invisible', '#options' => $table['#parent_options'], '#attributes' => array('class' => array('field-parent')), '#parents' => array('fields', $name, 'parent'), @@ -899,6 +927,8 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund ), 'label' => array( '#type' => 'select', + '#title' => t('Label display for @title', array('@title' => $instance['label'])), + '#title_display' => 'invisible', '#options' => $field_label_options, '#default_value' => $display['label'], ), @@ -909,6 +939,8 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund $table[$name]['format'] = array( 'type' => array( '#type' => 'select', + '#title' => t('Formatter for @title', array('@title' => $instance['label'])), + '#title_display' => 'invisible', '#options' => $formatter_options, '#default_value' => $display['type'], '#parents' => array('fields', $name, 'type'), @@ -1033,6 +1065,8 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund ), 'weight' => array( '#type' => 'textfield', + '#title' => t('Weight for @title', array('@title' => $extra_field['label'])), + '#title_display' => 'invisible', '#default_value' => $display['weight'], '#size' => 3, '#attributes' => array('class' => array('field-weight')), @@ -1040,6 +1074,8 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund 'parent_wrapper' => array( 'parent' => array( '#type' => 'select', + '#title' => t('Parents for @title', array('@title' => $extra_field['label'])), + '#title_display' => 'invisible', '#options' => $table['#parent_options'], '#attributes' => array('class' => array('field-parent')), '#parents' => array('fields', $name, 'parent'), @@ -1056,6 +1092,8 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund 'format' => array( 'type' => array( '#type' => 'select', + '#title' => t('Visibility for @title', array('@title' => $extra_field['label'])), + '#title_display' => 'invisible', '#options' => $extra_visibility_options, '#default_value' => $display['visible'] ? 'visible' : 'hidden', '#parents' => array('fields', $name, 'type'), diff --git a/modules/file/file.field.inc b/modules/file/file.field.inc index 286e2e0b7..faa661ea0 100644 --- a/modules/file/file.field.inc +++ b/modules/file/file.field.inc @@ -674,8 +674,11 @@ function file_field_widget_process_multiple($element, &$form_state, $form) { foreach ($element_children as $delta => $key) { if ($key != $element['#file_upload_delta']) { + $description = _file_field_get_description_from_element($element[$key]); $element[$key]['_weight'] = array( '#type' => 'weight', + '#title' => $description ? t('Weight for @title', array('@title' => $description)) : t('Weight for new file'), + '#title_display' => 'invisible', '#delta' => $count, '#default_value' => $delta, ); @@ -698,6 +701,27 @@ function file_field_widget_process_multiple($element, &$form_state, $form) { return $element; } +/** + * Helper function for file_field_widget_process_multiple(). + * + * @param $element + * The element being processed. + * @return + * A description of the file suitable for use in the administrative interface. + */ +function _file_field_get_description_from_element($element) { + // Use the actual file description, if it's available. + if (!empty($element['#default_value']['description'])) { + return $element['#default_value']['description']; + } + // Otherwise, fall back to the filename. + if (!empty($element['#default_value']['filename'])) { + return $element['#default_value']['filename']; + } + // This is probably a newly uploaded file; no description is available. + return FALSE; +} + /** * Returns HTML for an individual file upload widget. * diff --git a/modules/file/file.module b/modules/file/file.module index 08b383555..2249b0b81 100644 --- a/modules/file/file.module +++ b/modules/file/file.module @@ -431,6 +431,8 @@ function file_managed_file_process($element, &$form_state, $form) { $element['upload'] = array( '#name' => 'files[' . implode('_', $element['#parents']) . ']', '#type' => 'file', + '#title' => t('Choose a file'), + '#title_display' => 'invisible', '#size' => 22, '#theme_wrappers' => array(), '#weight' => -10, diff --git a/modules/filter/filter.admin.inc b/modules/filter/filter.admin.inc index 2c40e287a..e2a6fde4a 100644 --- a/modules/filter/filter.admin.inc +++ b/modules/filter/filter.admin.inc @@ -34,7 +34,12 @@ function filter_admin_overview($form) { $form['formats'][$id]['roles'] = array('#markup' => $roles_markup); $form['formats'][$id]['configure'] = array('#type' => 'link', '#title' => t('configure'), '#href' => 'admin/config/content/formats/' . $id); $form['formats'][$id]['disable'] = array('#type' => 'link', '#title' => t('disable'), '#href' => 'admin/config/content/formats/' . $id . '/disable', '#access' => !$form['formats'][$id]['#is_fallback']); - $form['formats'][$id]['weight'] = array('#type' => 'weight', '#default_value' => $format->weight); + $form['formats'][$id]['weight'] = array( + '#type' => 'weight', + '#title' => t('Weight for @title', array('@title' => $format->name)), + '#title_display' => 'invisible', + '#default_value' => $format->weight, + ); } $form['actions'] = array('#type' => 'actions'); $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save changes')); @@ -204,6 +209,8 @@ function filter_admin_format_form($form, &$form_state, $format) { ); $form['filters']['order'][$name]['weight'] = array( '#type' => 'weight', + '#title' => t('Weight for @title', array('@title' => $filter['title'])), + '#title_display' => 'invisible', '#delta' => 50, '#default_value' => $filters[$name]->weight, '#parents' => array('filters', $name, 'weight'), diff --git a/modules/image/image.admin.inc b/modules/image/image.admin.inc index 5a40e6782..613118ad9 100644 --- a/modules/image/image.admin.inc +++ b/modules/image/image.admin.inc @@ -93,6 +93,8 @@ function image_style_form($form, &$form_state, $style) { ); $form['effects'][$key]['weight'] = array( '#type' => 'weight', + '#title' => t('Weight for @title', array('@title' => $effect['label'])), + '#title_display' => 'invisible', '#default_value' => $effect['weight'], '#access' => $editable, ); @@ -127,11 +129,15 @@ function image_style_form($form, &$form_state, $style) { ); $form['effects']['new']['new'] = array( '#type' => 'select', + '#title' => t('Effect'), + '#title_display' => 'invisible', '#options' => $new_effect_options, '#empty_option' => t('Select a new effect'), ); $form['effects']['new']['weight'] = array( '#type' => 'weight', + '#title' => t('Weight for new effect'), + '#title_display' => 'invisible', '#default_value' => count($form['effects']) - 1, ); $form['effects']['new']['add'] = array( diff --git a/modules/image/image.field.inc b/modules/image/image.field.inc index 11b49aa63..ce8217bab 100644 --- a/modules/image/image.field.inc +++ b/modules/image/image.field.inc @@ -86,6 +86,8 @@ function image_field_instance_settings_form($field, $instance) { ); $form['max_resolution']['x'] = array( '#type' => 'textfield', + '#title' => t('Maximum width'), + '#title_display' => 'invisible', '#default_value' => $max_resolution[0], '#size' => 5, '#maxlength' => 5, @@ -93,6 +95,8 @@ function image_field_instance_settings_form($field, $instance) { ); $form['max_resolution']['y'] = array( '#type' => 'textfield', + '#title' => t('Maximum height'), + '#title_display' => 'invisible', '#default_value' => $max_resolution[1], '#size' => 5, '#maxlength' => 5, @@ -111,6 +115,8 @@ function image_field_instance_settings_form($field, $instance) { ); $form['min_resolution']['x'] = array( '#type' => 'textfield', + '#title' => t('Minimum width'), + '#title_display' => 'invisible', '#default_value' => $min_resolution[0], '#size' => 5, '#maxlength' => 5, @@ -118,6 +124,8 @@ function image_field_instance_settings_form($field, $instance) { ); $form['min_resolution']['y'] = array( '#type' => 'textfield', + '#title' => t('Minimum height'), + '#title_display' => 'invisible', '#default_value' => $min_resolution[1], '#size' => 5, '#maxlength' => 5, diff --git a/modules/locale/locale.admin.inc b/modules/locale/locale.admin.inc index c748164a0..e643f84c1 100644 --- a/modules/locale/locale.admin.inc +++ b/modules/locale/locale.admin.inc @@ -28,6 +28,8 @@ function locale_languages_overview_form() { } $form['weight'][$langcode] = array( '#type' => 'weight', + '#title' => t('Weight for @title', array('@title' => $language->name)), + '#title_display' => 'invisible', '#default_value' => $language->weight, '#attributes' => array('class' => array('language-order-weight')), ); @@ -35,11 +37,17 @@ function locale_languages_overview_form() { $form['native'][$langcode] = array('#markup' => check_plain($language->native)); $form['direction'][$langcode] = array('#markup' => ($language->direction == LANGUAGE_RTL ? t('Right to left') : t('Left to right'))); } - $form['enabled'] = array('#type' => 'checkboxes', + $form['enabled'] = array( + '#type' => 'checkboxes', + '#title' => t('Enabled languages'), + '#title_display' => 'invisible', '#options' => $options, '#default_value' => $enabled, ); - $form['site_default'] = array('#type' => 'radios', + $form['site_default'] = array( + '#type' => 'radios', + '#title' => t('Default language'), + '#title_display' => 'invisible', '#options' => $options, '#default_value' => language_default('language'), ); @@ -545,13 +553,20 @@ function _locale_languages_configure_form_language_table(&$form, $type) { $table_form['weight'][$id] = array( '#type' => 'weight', + '#title' => t('Weight for @title', array('@title' => $provider['name'])), + '#title_display' => 'invisible', '#default_value' => $weight, '#attributes' => array('class' => array("language-provider-weight-$type")), ); $table_form['title'][$id] = array('#markup' => check_plain($provider['name'])); - $table_form['enabled'][$id] = array('#type' => 'checkbox', '#default_value' => $enabled); + $table_form['enabled'][$id] = array( + '#type' => 'checkbox', + '#title' => t('@title language provider', array('@title' => $provider['name'])), + '#title_display' => 'invisible', + '#default_value' => $enabled, + ); if ($id === LANGUAGE_NEGOTIATION_DEFAULT) { $table_form['enabled'][$id]['#default_value'] = TRUE; $table_form['enabled'][$id]['#attributes'] = array('disabled' => 'disabled'); diff --git a/modules/menu/menu.admin.inc b/modules/menu/menu.admin.inc index e4dc02951..d2a81da6a 100644 --- a/modules/menu/menu.admin.inc +++ b/modules/menu/menu.admin.inc @@ -103,6 +103,8 @@ function _menu_overview_tree_form($tree) { $form[$mlid]['title']['#markup'] = l($item['title'], $item['href'], $item['localized_options']) . ($item['hidden'] ? ' (' . t('disabled') . ')' : ''); $form[$mlid]['hidden'] = array( '#type' => 'checkbox', + '#title' => t('Enable @title menu link', array('@title' => $item['title'])), + '#title_display' => 'invisible', '#default_value' => !$item['hidden'], ); $form[$mlid]['weight'] = array( @@ -110,7 +112,7 @@ function _menu_overview_tree_form($tree) { '#delta' => 50, '#default_value' => $item['weight'], '#title_display' => 'invisible', - '#title' => t('Weight for @row', array('@row' => $item['title'])), + '#title' => t('Weight for @title', array('@title' => $item['title'])), ); $form[$mlid]['mlid'] = array( '#type' => 'hidden', diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc index 1c75fa828..02891de93 100644 --- a/modules/node/node.admin.inc +++ b/modules/node/node.admin.inc @@ -374,6 +374,8 @@ function node_admin_nodes() { } $form['options']['operation'] = array( '#type' => 'select', + '#title' => t('Operation'), + '#title_display' => 'invisible', '#options' => $options, '#default_value' => 'approve', ); diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 9e314f11d..4b2bee71a 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -390,12 +390,16 @@ function _poll_choice_form($key, $chid = NULL, $value = '', $votes = 0, $weight $form['chtext'] = array( '#type' => 'textfield', + '#title' => $value !== '' ? t('Choice label') : t('New choice label'), + '#title_display' => 'invisible', '#default_value' => $value, '#parents' => array('choice', $key, 'chtext'), ); $form['chvotes'] = array( '#type' => 'textfield', + '#title' => $value !== '' ? t('Vote count for choice @label', array('@label' => $value)) : t('Vote count for new choice'), + '#title_display' => 'invisible', '#default_value' => $votes, '#size' => 5, '#maxlength' => 7, @@ -405,6 +409,8 @@ function _poll_choice_form($key, $chid = NULL, $value = '', $votes = 0, $weight $form['weight'] = array( '#type' => 'weight', + '#title' => $value !== '' ? t('Weight for choice @label', array('@label' => $value)) : t('Weight for new choice'), + '#title_display' => 'invisible', '#default_value' => $weight, '#delta' => $size, '#parents' => array('choice', $key, 'weight'), @@ -688,6 +694,8 @@ function poll_view_voting($form, &$form_state, $node, $block = FALSE) { } $form['choice'] = array( '#type' => 'radios', + '#title' => t('Choices'), + '#title_display' => 'invisible', '#default_value' => -1, '#options' => $list, ); diff --git a/modules/profile/profile.admin.inc b/modules/profile/profile.admin.inc index 0bb13278a..864e847e0 100644 --- a/modules/profile/profile.admin.inc +++ b/modules/profile/profile.admin.inc @@ -24,8 +24,19 @@ function profile_admin_overview($form) { $form[$field->fid]['name'] = array('#markup' => check_plain($field->name)); $form[$field->fid]['title'] = array('#markup' => check_plain($field->title)); $form[$field->fid]['type'] = array('#markup' => $field->type); - $form[$field->fid]['category'] = array('#type' => 'select', '#default_value' => $field->category, '#options' => array()); - $form[$field->fid]['weight'] = array('#type' => 'weight', '#default_value' => $field->weight); + $form[$field->fid]['category'] = array( + '#type' => 'select', + '#title' => t('Category for @title', array('@title' => $field->title)), + '#title_display' => 'invisible', + '#default_value' => $field->category, + '#options' => array(), + ); + $form[$field->fid]['weight'] = array( + '#type' => 'weight', + '#title' => t('Weight for @title', array('@title' => $field->title)), + '#title_display' => 'invisible', + '#default_value' => $field->weight, + ); $form[$field->fid]['edit'] = array('#type' => 'link', '#title' => t('edit'), '#href' => "admin/config/people/profile/edit/$field->fid"); $form[$field->fid]['delete'] = array('#type' => 'link', '#title' => t('delete'), '#href' => "admin/config/people/profile/delete/$field->fid"); } diff --git a/modules/search/search.admin.inc b/modules/search/search.admin.inc index 76382f662..d4058097e 100644 --- a/modules/search/search.admin.inc +++ b/modules/search/search.admin.inc @@ -117,6 +117,8 @@ function search_admin_settings($form) { ); $form['active']['search_active_modules'] = array( '#type' => 'checkboxes', + '#title' => t('Active modules'), + '#title_display' => 'invisible', '#default_value' => variable_get('search_active_modules', array('node', 'user')), '#options' => _search_get_module_names(), '#description' => t('Choose which search modules are active from the available modules.') diff --git a/modules/search/search.module b/modules/search/search.module index 27a6d8548..65c3a7122 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -995,6 +995,8 @@ function search_form($form, &$form_state, $action = '', $keys = '', $type = NULL function search_box($form, &$form_state, $form_id) { $form[$form_id] = array( '#type' => 'textfield', + '#title' => t('Search'), + '#title_display' => 'invisible', '#size' => 15, '#default_value' => '', '#attributes' => array('title' => t('Enter the terms you wish to search for.')), diff --git a/modules/shortcut/shortcut.admin.inc b/modules/shortcut/shortcut.admin.inc index 92492be7c..dc9632d13 100644 --- a/modules/shortcut/shortcut.admin.inc +++ b/modules/shortcut/shortcut.admin.inc @@ -72,6 +72,8 @@ function shortcut_set_switch($form, &$form_state, $account = NULL) { $form['new'] = array( '#type' => 'textfield', + '#title' => t('Name'), + '#title_display' => 'invisible', '#description' => t('The new set is created by copying items from your default shortcut set.'), '#access' => $add_access, ); diff --git a/modules/simpletest/simpletest.pages.inc b/modules/simpletest/simpletest.pages.inc index f02304eeb..983a12d68 100644 --- a/modules/simpletest/simpletest.pages.inc +++ b/modules/simpletest/simpletest.pages.inc @@ -142,7 +142,7 @@ function theme_simpletest_test_table($variables) { $title = $test['#title']; $description = $test['#description']; - unset($test['#title']); + $test['#title_display'] = 'invisible'; unset($test['#description']); // Test name is used to determine what tests to run. diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index c8a4f738a..814579199 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -1246,6 +1246,8 @@ function system_modules_uninstall($form, $form_state = NULL) { if (!empty($options)) { $form['uninstall'] = array( '#type' => 'checkboxes', + '#title' => t('Modules'), + '#title_display' => 'invisible', '#options' => $options, ); $form['actions'] = array('#type' => 'actions'); @@ -2926,6 +2928,8 @@ function system_actions_manage_form($form, &$form_state, $options = array()) { ); $form['parent']['action'] = array( '#type' => 'select', + '#title' => t('Action'), + '#title_display' => 'invisible', '#options' => $options, ); $form['parent']['actions'] = array('#type' => 'actions'); diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc index 7d314634a..84ac05bb3 100644 --- a/modules/taxonomy/taxonomy.admin.inc +++ b/modules/taxonomy/taxonomy.admin.inc @@ -19,7 +19,13 @@ function taxonomy_overview_vocabularies($form) { foreach ($vocabularies as $vocabulary) { $form[$vocabulary->vid]['#vocabulary'] = $vocabulary; $form[$vocabulary->vid]['name'] = array('#markup' => check_plain($vocabulary->name)); - $form[$vocabulary->vid]['weight'] = array('#type' => 'weight', '#delta' => 10, '#default_value' => $vocabulary->weight); + $form[$vocabulary->vid]['weight'] = array( + '#type' => 'weight', + '#title' => t('Weight for @title', array('@title' => $vocabulary->name)), + '#title_display' => 'invisible', + '#delta' => 10, + '#default_value' => $vocabulary->weight, + ); $form[$vocabulary->vid]['edit'] = array('#type' => 'link', '#title' => t('edit vocabulary'), '#href' => "admin/structure/taxonomy/$vocabulary->machine_name/edit"); $form[$vocabulary->vid]['list'] = array('#type' => 'link', '#title' => t('list terms'), '#href' => "admin/structure/taxonomy/$vocabulary->machine_name"); $form[$vocabulary->vid]['add'] = array('#type' => 'link', '#title' => t('add terms'), '#href' => "admin/structure/taxonomy/$vocabulary->machine_name/add"); @@ -663,8 +669,7 @@ function taxonomy_form_term($form, &$form_state, $edit = array(), $vocabulary = ); $form['vocabulary_machine_name'] = array( - '#type' => 'textfield', - '#access' => FALSE, + '#type' => 'value', '#value' => isset($term->vocabulary_machine_name) ? $term->vocabulary_machine_name : $vocabulary->name, ); diff --git a/modules/trigger/trigger.admin.inc b/modules/trigger/trigger.admin.inc index 36e7cc715..6bccdbb08 100644 --- a/modules/trigger/trigger.admin.inc +++ b/modules/trigger/trigger.admin.inc @@ -179,6 +179,8 @@ function trigger_assign_form($form, $form_state, $module, $hook, $label) { if (count($options) != 0) { $form[$hook]['parent']['aid'] = array( '#type' => 'select', + '#title' => t('List of trigger actions when !description', array('!description' => $label)), + '#title_display' => 'invisible', '#options' => $options, ); $form[$hook]['parent']['submit'] = array( diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc index 197090489..fc4911352 100644 --- a/modules/user/user.admin.inc +++ b/modules/user/user.admin.inc @@ -183,6 +183,8 @@ function user_admin_account() { } $form['options']['operation'] = array( '#type' => 'select', + '#title' => t('Operation'), + '#title_display' => 'invisible', '#options' => $options, '#default_value' => 'unblock', ); @@ -835,6 +837,8 @@ function user_admin_roles($form, $form_state) { $form['roles'][$rid]['#weight'] = $order; $form['roles'][$rid]['weight'] = array( '#type' => 'textfield', + '#title' => t('Weight for @title', array('@title' => $name['label'])), + '#title_display' => 'invisible', '#size' => 4, '#default_value' => $order, '#attributes' => array('class' => array('role-weight')), @@ -844,6 +848,8 @@ function user_admin_roles($form, $form_state) { $form['name'] = array( '#type' => 'textfield', + '#title' => t('Name'), + '#title_display' => 'invisible', '#size' => 32, '#maxlength' => 64, ); -- cgit v1.2.3