diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 0a2cb29decbd78e2a8dae908f20a84a8963194bb..86fe8c6d22f4ca7976bfee59d1568ed49c27ea66 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -2470,6 +2470,7 @@ function _install_configure_form($form, &$form_state, &$install_state) { ); $form['update_notifications']['update_status_module'] = array( '#type' => 'checkboxes', + '#title' => t('Update notifications'), '#options' => array( 1 => t('Check for updates automatically'), 2 => t('Receive e-mail notifications'), diff --git a/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php b/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php index 021ec93214e3eed2356437721e45ef02939f440b..2bd8573f14b138089ffe0ed881bfd4089becab74 100644 --- a/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php +++ b/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php @@ -72,7 +72,6 @@ public function form(array $form, array &$form_state) { $form['id'] = array( '#type' => 'machine_name', - '#title' => $this->t('Machine name'), '#default_value' => $this->entity->id(), '#disabled' => !$this->entity->isNew(), '#maxlength' => 64, diff --git a/core/modules/block/lib/Drupal/block/BlockFormController.php b/core/modules/block/lib/Drupal/block/BlockFormController.php index ed8f28bf2134d3a70ea87fc8ccb9c0392ebb4208..bd5c4ba0a3a5b8f9e8f891fb01915380165db45a 100644 --- a/core/modules/block/lib/Drupal/block/BlockFormController.php +++ b/core/modules/block/lib/Drupal/block/BlockFormController.php @@ -102,7 +102,6 @@ public function form(array $form, array &$form_state) { // If creating a new block, calculate a safe default machine name. $form['machine_name'] = array( '#type' => 'machine_name', - '#title' => $this->t('Machine name'), '#maxlength' => 64, '#description' => $this->t('A unique name for this block instance. Must be alpha-numeric and underscore separated.'), '#default_value' => !$entity->isNew() ? $entity->id() : $this->getUniqueMachineName($entity), diff --git a/core/modules/block/lib/Drupal/block/BlockListController.php b/core/modules/block/lib/Drupal/block/BlockListController.php index f4e2a5e1decac86ea1c484ac6412f2d53ee9dbd5..1e90c2b58935d6d069b876edbadd8764a1e6c3fc 100644 --- a/core/modules/block/lib/Drupal/block/BlockListController.php +++ b/core/modules/block/lib/Drupal/block/BlockListController.php @@ -262,8 +262,8 @@ public function buildForm(array $form, array &$form_state) { '#type' => 'select', '#default_value' => $region, '#empty_value' => BLOCK_REGION_NONE, - '#title_display' => 'invisible', '#title' => t('Region for @block block', array('@block' => $info['admin_label'])), + '#title_display' => 'invisible', '#options' => $this->regions, '#attributes' => array( 'class' => array('block-region-select', 'block-region-' . $region), @@ -279,8 +279,8 @@ public function buildForm(array $form, array &$form_state) { '#type' => 'weight', '#default_value' => $info['weight'], '#delta' => $weight_delta, - '#title_display' => 'invisible', '#title' => t('Weight for @block block', array('@block' => $info['admin_label'])), + '#title_display' => 'invisible', '#attributes' => array( 'class' => array('block-weight', 'block-weight-' . $region), ), diff --git a/core/modules/book/book.admin.inc b/core/modules/book/book.admin.inc index 40dc0bfff5c9f65bf2a149cbb14c892c879127c1..89e132ebd06aa5b9a17eefba22187969dec6745f 100644 --- a/core/modules/book/book.admin.inc +++ b/core/modules/book/book.admin.inc @@ -160,6 +160,8 @@ function _book_admin_table_tree($tree, &$form) { 'depth' => array('#type' => 'value', '#value' => $data['link']['depth']), 'href' => array('#type' => 'value', '#value' => $data['link']['href']), 'title' => array( + '#title' => t('Title'), + '#title_display' => 'invisible', '#type' => 'textfield', '#default_value' => $data['link']['link_title'], '#maxlength' => 255, diff --git a/core/modules/comment/comment.admin.inc b/core/modules/comment/comment.admin.inc index 4bbff560ec29a4aaa022887039f8330425ff86d0..741ad5ce706808f1decadb840115a4bad0e9af58 100644 --- a/core/modules/comment/comment.admin.inc +++ b/core/modules/comment/comment.admin.inc @@ -118,6 +118,7 @@ function comment_admin_overview($form, &$form_state, $arg) { '#account' => comment_prepare_author($comment), ); $options[$comment->id()] = array( + 'title' => array('data' => array('#title' => $comment->subject->value ?: $comment->id())), 'subject' => array( 'data' => array( '#type' => 'link', diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/wizard/Comment.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/wizard/Comment.php index 8bfb7cbcd9fbf186038d1467f189a630b7a91ef4..422e656c31734cc13ee47307bf52e24ccf1b6486 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/wizard/Comment.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/wizard/Comment.php @@ -88,8 +88,8 @@ protected function buildFormStyle(array &$form, array &$form_state, $type) { case 'comment': $style_form['row_options']['links'] = array( '#type' => 'select', - '#title_display' => 'invisible', '#title' => t('Should links be displayed below each comment'), + '#title_display' => 'invisible', '#options' => array( 1 => t('with links (allow users to reply to the comment, etc.)'), 0 => t('without links'), diff --git a/core/modules/config/lib/Drupal/config/Form/ConfigImportForm.php b/core/modules/config/lib/Drupal/config/Form/ConfigImportForm.php index 40429c70a13586d5d6349da093022db64abe8b37..ebdeb498fc86a9ee7c0e8ea29d630b2fc291f726 100644 --- a/core/modules/config/lib/Drupal/config/Form/ConfigImportForm.php +++ b/core/modules/config/lib/Drupal/config/Form/ConfigImportForm.php @@ -59,9 +59,10 @@ public function buildForm(array $form, array &$form_state) { ); $form['import_tarball'] = array( '#type' => 'file', - '#value' => $this->t('Select your configuration export file'), + '#title' => $this->t('Select your configuration export file'), '#description' => $this->t('This form will redirect you to the import configuration screen.'), ); + $form['submit'] = array( '#type' => 'submit', '#value' => $this->t('Upload'), diff --git a/core/modules/content_translation/content_translation.admin.inc b/core/modules/content_translation/content_translation.admin.inc index c5b8cfefd740350b9aaee37728eb4fabffbe1e27..da4558a374e87d0281606aee947d8131b69941b9 100644 --- a/core/modules/content_translation/content_translation.admin.inc +++ b/core/modules/content_translation/content_translation.admin.inc @@ -89,6 +89,7 @@ function _content_translation_form_language_content_settings_form_alter(array &$ if ($fields) { $form['settings'][$entity_type][$bundle]['translatable'] = array( '#type' => 'checkbox', + '#title' => $bundle, '#default_value' => content_translation_enabled($entity_type, $bundle), ); @@ -99,6 +100,7 @@ function _content_translation_form_language_content_settings_form_alter(array &$ $form['settings'][$entity_type][$bundle]['fields'][$field_name] = array( '#label' => $instance['label'], '#type' => 'checkbox', + '#title' => $instance['label'], '#default_value' => $field['translatable'], ); $column_element = content_translation_field_sync_widget($field, $instance); diff --git a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php index 503bd3b17c5ea7de5414f6de1a20fdf34aefbaaf..7e0b20e0cb84aa3ac8dbd1e800a5115b4cbd7a99 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php @@ -155,6 +155,8 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac '#weight' => -100, '#multilingual' => TRUE, 'source' => array( + '#title' => t('Select source language'), + '#title_display' => 'invisible', '#type' => 'select', '#default_value' => $source_langcode, '#options' => array(), diff --git a/core/modules/editor/tests/modules/lib/Drupal/editor_test/Plugin/Editor/UnicornEditor.php b/core/modules/editor/tests/modules/lib/Drupal/editor_test/Plugin/Editor/UnicornEditor.php index ba260f205ea1b51c6dbc555ae350c6732cc938e2..b6791394c4c8c3dd51bd7e7dfa2cea3b107e162c 100644 --- a/core/modules/editor/tests/modules/lib/Drupal/editor_test/Plugin/Editor/UnicornEditor.php +++ b/core/modules/editor/tests/modules/lib/Drupal/editor_test/Plugin/Editor/UnicornEditor.php @@ -34,7 +34,11 @@ function getDefaultSettings() { * Implements \Drupal\editor\Plugin\EditPluginInterface::settingsForm(). */ function settingsForm(array $form, array &$form_state, EditorEntity $editor) { - $form['foo'] = array('#type' => 'textfield', '#default_value' => 'bar'); + $form['foo'] = array( + '#title' => t('Foo'), + '#type' => 'textfield', + '#default_value' => 'bar', + ); return $form; } diff --git a/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeFormBase.php b/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeFormBase.php index 1536071d1dee373ea2bcd033f0c8b7dbdea11362..93f595c278df71f57084d6ad62b9bc1cace413e1 100644 --- a/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeFormBase.php +++ b/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeFormBase.php @@ -82,7 +82,6 @@ public function form(array $form, array &$form_state) { $form['id'] = array( '#type' => 'machine_name', - '#title' => t('Machine-readable name'), '#description' => t('A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'), '#disabled' => !$this->entity->isNew(), '#default_value' => $this->entity->id(), diff --git a/core/modules/language/tests/language_elements_test/language_elements_test.module b/core/modules/language/tests/language_elements_test/language_elements_test.module index 6030e4cbcc8be3ba24a1e0d80c397cd538e093a9..14d8927ab3cdbbadb453b75a5eb3c4df9c71e6f6 100644 --- a/core/modules/language/tests/language_elements_test/language_elements_test.module +++ b/core/modules/language/tests/language_elements_test/language_elements_test.module @@ -54,6 +54,7 @@ function language_elements_configuration_element() { */ function language_elements_configuration_element_test() { $form['langcode'] = array( + '#title' => t('Language select'), '#type' => 'language_select', '#default_value' => language_get_default_langcode('custom_type', 'some_bundle'), ); diff --git a/core/modules/locale/css/locale.admin.css b/core/modules/locale/css/locale.admin.css index c1e05e9f55dea21c7e88141ea2c3dce5c4ce7209..5d7b0327794be7e8c7126e6483b82b0dabfa07e2 100644 --- a/core/modules/locale/css/locale.admin.css +++ b/core/modules/locale/css/locale.admin.css @@ -85,9 +85,10 @@ background: transparent url(../../../misc/menu-expanded.png) left .6em no-repeat; } -#locale-translation-status-form label { +#locale-translation-status-form .label { color: #1d1d1d; font-size: 1.15em; + font-weight: bold; } #locale-translation-status-form .description { cursor: pointer; diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php index 9f55abccaac72c8c69746e1afe05b6bd0a78edf0..d6fb45fbf8e6fccc1585653b191c14fc81286ec7 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php @@ -167,7 +167,7 @@ function testUpdateImportSourceRemote() { $this->drupalGet('admin/reports/translations/check'); // Check the status on the Available translation status page. - $this->assertRaw('', 'German language found'); + $this->assertRaw('', 'German language found'); $this->assertText('Updates for: Contributed module one, Contributed module two, Custom module one, Locale test', 'Updates found'); $this->assertText('Contributed module one (' . format_date($this->timestamp_now, 'html_date') . ')', 'Updates for Contrib module one'); $this->assertText('Contributed module two (' . format_date($this->timestamp_new, 'html_date') . ')', 'Updates for Contrib module two'); diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index 15fefb6d91fbd1086f533a71ad8c0ee69204291d..3d366a5a04e8fbe32e5824dd8d96c2d781835bd0 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -5,6 +5,7 @@ * Interface translation summary, editing and deletion user interfaces. */ +use Drupal\Component\Utility\String; use Drupal\Core\Language\Language; use Drupal\locale\SourceString; use Drupal\locale\TranslationString; @@ -520,6 +521,7 @@ function locale_translation_status_form($form, &$form_state) { // Build data options for the select table. foreach($updates as $langcode => $update) { + $title = String::checkPlain($languages[$langcode]->name); $locale_translation_update_info = array('#theme' => 'locale_translation_update_info'); foreach (array('updates', 'not_found') as $update_status) { if (isset($update[$update_status])) { @@ -527,12 +529,20 @@ function locale_translation_status_form($form, &$form_state) { } } $options[$langcode] = array( - 'title' => check_plain($languages[$langcode]->name), + 'title' => array( + 'class' => array('label'), + 'data' => array( + '#title' => $title, + '#markup' => $title + ), + ), 'status' => array('class' => array('description', 'expand', 'priority-low'), 'data' => drupal_render($locale_translation_update_info)), ); } // Sort the table data on language name. - uasort($options, 'drupal_sort_title'); + uasort($options, function ($a, $b) { + return strcasecmp($a['title']['data']['#title'], $b['title']['data']['#title']); + }); } $last_checked = Drupal::state()->get('locale.translation_last_checked'); @@ -639,13 +649,6 @@ function locale_translation_status_form_submit($form, &$form_state) { * translation files could not be found. */ function locale_translation_language_table($form_element) { - // Add labels to Language names. - foreach ($form_element['#options'] as $langcode => $option) { - $id = $form_element[$langcode]['#id']; - $title = $option['title']; - $form_element['#options'][$langcode]['title'] = ''; - } - // Remove checkboxes of languages without updates. if ($form_element['#not_found']) { foreach ($form_element['#not_found'] as $langcode) { diff --git a/core/modules/menu/lib/Drupal/menu/MenuFormController.php b/core/modules/menu/lib/Drupal/menu/MenuFormController.php index e57dfb3d4fcae014cf273c9a63c07b84fbd30ae6..68bc6a48d58fa744ca052ccaf6d0b86540641936 100644 --- a/core/modules/menu/lib/Drupal/menu/MenuFormController.php +++ b/core/modules/menu/lib/Drupal/menu/MenuFormController.php @@ -315,8 +315,8 @@ protected function buildOverviewTreeForm($tree, $delta) { '#type' => 'weight', '#delta' => $delta, '#default_value' => $item['weight'], - '#title_display' => 'invisible', '#title' => t('Weight for @title', array('@title' => $item['title'])), + '#title_display' => 'invisible', ); $form[$mlid]['mlid'] = array( '#type' => 'hidden', diff --git a/core/modules/node/lib/Drupal/node/Plugin/Condition/NodeType.php b/core/modules/node/lib/Drupal/node/Plugin/Condition/NodeType.php index bf71eb28c191366781760309a5d52ae0c7e3911c..b9d2a9c8ca9ec6e49b2d59e075eb9c131bbff5b3 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/Condition/NodeType.php +++ b/core/modules/node/lib/Drupal/node/Plugin/Condition/NodeType.php @@ -39,6 +39,7 @@ public function buildForm(array $form, array &$form_state) { $options[$type->type] = $type->name; } $form['bundles'] = array( + '#title' => t('Node types'), '#type' => 'checkboxes', '#options' => $options, '#required' => TRUE, diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/wizard/Node.php b/core/modules/node/lib/Drupal/node/Plugin/views/wizard/Node.php index c4f4d577b05f324e0376e0eb217aeb4d5a7e131b..e17158d24454f45896efcd86484c96a1e199576b 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/wizard/Node.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/wizard/Node.php @@ -107,8 +107,8 @@ protected function buildFormStyle(array &$form, array &$form_state, $type) { case 'teasers': $style_form['row_options']['links'] = array( '#type' => 'select', - '#title_display' => 'invisible', '#title' => t('Should links be displayed below each node'), + '#title_display' => 'invisible', '#options' => array( 1 => t('with links (allow users to add comments, etc.)'), 0 => t('without links'), @@ -117,8 +117,8 @@ protected function buildFormStyle(array &$form, array &$form_state, $type) { ); $style_form['row_options']['comments'] = array( '#type' => 'select', - '#title_display' => 'invisible', '#title' => t('Should comments be displayed below each node'), + '#title_display' => 'invisible', '#options' => array( 1 => t('with comments'), 0 => t('without comments'), diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/views/row/DataFieldRow.php b/core/modules/rest/lib/Drupal/rest/Plugin/views/row/DataFieldRow.php index 9622d8406cd43c1b817d4d177c8e531dc89be891..60b244c3ae62a2584ec1105e7bd14b35f37d8247 100644 --- a/core/modules/rest/lib/Drupal/rest/Plugin/views/row/DataFieldRow.php +++ b/core/modules/rest/lib/Drupal/rest/Plugin/views/row/DataFieldRow.php @@ -94,11 +94,15 @@ public function buildOptionsForm(&$form, &$form_state) { '#markup' => $id, ); $form['field_options'][$id]['alias'] = array( + '#title' => t('Alias for @id', array('@id' => $id)), + '#title_display' => 'invisible', '#type' => 'textfield', '#default_value' => isset($options[$id]['alias']) ? $options[$id]['alias'] : '', '#element_validate' => array(array($this, 'validateAliasName')), ); $form['field_options'][$id]['raw_output'] = array( + '#title' => t('Raw output for @id', array('@id' => $id)), + '#title_display' => 'invisible', '#type' => 'checkbox', '#default_value' => isset($options[$id]['raw_output']) ? $options[$id]['raw_output'] : '', ); diff --git a/core/modules/system/lib/Drupal/system/Form/CronForm.php b/core/modules/system/lib/Drupal/system/Form/CronForm.php index 31c599b9c1e50284acf8d7951c840ca249e62b61..e805ec9b266bb24f44602a8cb2d43e0f73602ef6 100644 --- a/core/modules/system/lib/Drupal/system/Form/CronForm.php +++ b/core/modules/system/lib/Drupal/system/Form/CronForm.php @@ -84,6 +84,7 @@ public function buildForm(array $form, array &$form_state) { ); $form['cron'] = array( + '#title' => t('Cron settings'), '#type' => 'details', ); $form['cron']['cron_safe_threshold'] = array( diff --git a/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php b/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php index e04a6101cfbaa8918d2caf1fe15bae64371048d4..220594248ec772f6fc4f4d3260c1f0fd9816a03b 100644 --- a/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php +++ b/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php @@ -125,7 +125,6 @@ public function form(array $form, array &$form_state) { $form['id'] = array( '#type' => 'machine_name', - '#title' => t('Machine-readable name'), '#description' => t('A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'), '#disabled' => !$this->entity->isNew(), '#default_value' => $this->entity->id(), diff --git a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module index 291f7bbf03d9daba00aa0bd3eb7a4f1eb646003b..175d593534df2fe2ce02f1659831ced8bc83fb0b 100644 --- a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module +++ b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module @@ -49,6 +49,7 @@ function ajax_forms_test_simple_form($form, &$form_state) { $form = array(); $form['select'] = array( + '#title' => t('Color'), '#type' => 'select', '#options' => array( 'red' => 'red', @@ -83,6 +84,7 @@ function ajax_forms_test_simple_form($form, &$form_state) { foreach ($invalid_callbacks as $key => $value) { $form['select_' . $key . '_callback'] = array( '#type' => 'select', + '#title' => t('Test %key callbacks', array('%key' => $key)), '#options' => array('red' => 'red'), '#ajax' => array('callback' => $value), ); @@ -542,6 +544,7 @@ function ajax_forms_test_lazy_load_form($form, &$form_state) { 'data' => array('test' => 'currentPathUpdate'), ); $form['add_files'] = array( + '#title' => t('Add files'), '#type' => 'checkbox', '#default_value' => FALSE, ); diff --git a/core/modules/system/tests/modules/batch_test/batch_test.module b/core/modules/system/tests/modules/batch_test/batch_test.module index 2c1bee2cfe1d88c9c5062d07587cf11d80f66bc7..7660c73d175fdf185fb9306fffca4e7329789568 100644 --- a/core/modules/system/tests/modules/batch_test/batch_test.module +++ b/core/modules/system/tests/modules/batch_test/batch_test.module @@ -312,6 +312,7 @@ function _batch_test_nested_drupal_form_submit_callback($value) { */ function batch_test_mock_form($form, $form_state) { $form['test_value'] = array( + '#title' => t('Test value'), '#type' => 'textfield', ); $form['submit'] = array( diff --git a/core/modules/system/tests/modules/database_test/database_test.module b/core/modules/system/tests/modules/database_test/database_test.module index b39000498d8c454c866bcc6a9e21c87865fd6a9c..518e3aaed0252e04edf862e311070fda527ba194 100644 --- a/core/modules/system/tests/modules/database_test/database_test.module +++ b/core/modules/system/tests/modules/database_test/database_test.module @@ -1,5 +1,6 @@ id()] = array( + 'title' => array('data' => array('#title' => String::checkPlain($account->getUsername()))), 'username' => check_plain($account->getUsername()), 'status' => $account->isActive() ? t('active') : t('blocked'), ); diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module index 3e7c089e080892dc6afde7291b7d4c16396c5f74..8b46c8353337c7970056baecb12171c8e12c1321 100644 --- a/core/modules/system/tests/modules/form_test/form_test.module +++ b/core/modules/system/tests/modules/form_test/form_test.module @@ -701,6 +701,7 @@ function _form_test_tableselect_get_data() { ); $options['row1'] = array( + 'title' => array('data' => array('#title' => t('row1'))), 'one' => 'row1col1', 'two' => t('row1col2'), 'three' => t('row1col3'), @@ -708,6 +709,7 @@ function _form_test_tableselect_get_data() { ); $options['row2'] = array( + 'title' => array('data' => array('#title' => t('row2'))), 'one' => 'row2col1', 'two' => t('row2col2'), 'three' => t('row2col3'), @@ -715,6 +717,7 @@ function _form_test_tableselect_get_data() { ); $options['row3'] = array( + 'title' => array('data' => array('#title' => t('row3'))), 'one' => 'row3col1', 'two' => t('row3col2'), 'three' => t('row3col3'), @@ -1044,21 +1047,21 @@ function form_label_test_form() { $form['form_checkboxes_title_attribute'] = array( '#type' => 'checkboxes', '#title' => 'Checkboxes test', + '#title_display' => 'attribute', '#options' => array( 'first-checkbox' => 'First checkbox', 'second-checkbox' => 'Second checkbox', ), - '#title_display' => 'attribute', '#required' => TRUE, ); $form['form_radios_title_attribute'] = array( '#type' => 'radios', '#title' => 'Radios test', + '#title_display' => 'attribute', '#options' => array( 'first-radio' => 'First radio', 'second-radio' => 'Second radio', ), - '#title_display' => 'attribute', '#required' => TRUE, ); @@ -1338,25 +1341,30 @@ function form_test_language_select() { $form['#submit'] = array('_form_test_submit_values_json'); $form['languages_all'] = array( + '#title' => t('Languages: All'), '#type' => 'language_select', '#languages' => Language::STATE_ALL, '#default_value' => 'xx', ); $form['languages_configurable'] = array( + '#title' => t('Languages: Configurable'), '#type' => 'language_select', '#languages' => Language::STATE_CONFIGURABLE, '#default_value' => 'en', ); $form['languages_locked'] = array( + '#title' => t('Languages: Locked'), '#type' => 'language_select', '#languages' => Language::STATE_LOCKED, ); $form['languages_config_and_locked'] = array( + '#title' => t('Languages: Configurable and locked'), '#type' => 'language_select', '#languages' => Language::STATE_CONFIGURABLE | Language::STATE_LOCKED, '#default_value' => 'dummy_value', ); $form['language_custom_options'] = array( + '#title' => t('Languages: Custom'), '#type' => 'language_select', '#languages' => Language::STATE_CONFIGURABLE | Language::STATE_LOCKED, '#options' => array('opt1' => 'First option', 'opt2' => 'Second option', 'opt3' => 'Third option'), @@ -1907,6 +1915,7 @@ function _form_test_input_forgery($form, &$form_state) { // For testing that a user can't submit a value not matching one of the // allowed options. $form['checkboxes'] = array( + '#title' => t('Checkboxes'), '#type' => 'checkboxes', '#options' => array( 'one' => 'One', @@ -2050,6 +2059,7 @@ function form_test_programmatic_form($form, &$form_state) { ); $form['checkboxes'] = array( + '#title' => t('Checkboxes'), '#type' => 'checkboxes', '#options' => array( 1 => 'First checkbox', @@ -2296,6 +2306,7 @@ function form_test_load_include_custom($form, &$form_state) { function form_test_checkbox_type_juggling($form, $form_state, $default_value, $return_value) { $form['checkbox'] = array( + '#title' => t('Checkbox'), '#type' => 'checkbox', '#return_value' => $return_value, '#default_value' => $default_value, @@ -2305,15 +2316,18 @@ function form_test_checkbox_type_juggling($form, $form_state, $default_value, $r function form_test_checkboxes_zero($form, &$form_state, $json = TRUE) { $form['checkbox_off'] = array( + '#title' => t('Checkbox off'), '#type' => 'checkboxes', '#options' => array('foo', 'bar', 'baz'), ); $form['checkbox_zero_default'] = array( + '#title' => t('Zero default'), '#type' => 'checkboxes', '#options' => array('foo', 'bar', 'baz'), '#default_value' => array(0), ); $form['checkbox_string_zero_default'] = array( + '#title' => t('Zero default (string)'), '#type' => 'checkboxes', '#options' => array('foo', 'bar', 'baz'), '#default_value' => array('0'), diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/OverviewTerms.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/OverviewTerms.php index d79af40fa02ec32228d5efa076967c4f1b559d11..fb682bcf8d0b72545a2b42704cb87cdab4d9f2af 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/OverviewTerms.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/OverviewTerms.php @@ -258,8 +258,8 @@ public function buildForm(array $form, array &$form_state, VocabularyInterface $ $form['terms'][$key]['weight'] = array( '#type' => 'weight', '#delta' => $delta, - '#title_display' => 'invisible', '#title' => $this->t('Weight for added term'), + '#title_display' => 'invisible', '#default_value' => $term->weight->value, '#attributes' => array( 'class' => array('term-weight'), diff --git a/core/modules/update/update.manager.inc b/core/modules/update/update.manager.inc index 9e9d73abf70bf2d37323c329bf54b128c12c5892..ea31026d28225ec96e4db746a9a3545a6f40ebc1 100644 --- a/core/modules/update/update.manager.inc +++ b/core/modules/update/update.manager.inc @@ -162,6 +162,11 @@ function update_manager_update_form($form, $form_state = array(), $context) { continue 2; } + // Use the project title for the tableselect checkboxes. + $entry['title'] = array('data' => array( + '#title' => $entry['title'], + '#markup' => $entry['title'], + )); $entry['#attributes'] = array('class' => array('update-' . $type)); // Drupal core needs to be upgraded manually. diff --git a/core/modules/user/lib/Drupal/user/Form/UserPermissionsForm.php b/core/modules/user/lib/Drupal/user/Form/UserPermissionsForm.php index abadd3088fa6cb9df36a0c390d3b836acbdc6d0f..0f0aa0f58356133de931f034f0fdbe606670fb90 100644 --- a/core/modules/user/lib/Drupal/user/Form/UserPermissionsForm.php +++ b/core/modules/user/lib/Drupal/user/Form/UserPermissionsForm.php @@ -139,7 +139,7 @@ public function buildForm(array $form, array &$form_state) { 'restrict access' => FALSE, 'warning' => !empty($perm_item['restrict access']) ? $this->t('Warning: Give to trusted roles only; this permission has security implications.') : '', ); - $options[$perm] = ''; + $options[$perm] = $perm_item['title']; $user_permission_description = array( '#theme' => 'user_permission_description', '#permission_item' => $perm_item, diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/area/Text.php b/core/modules/views/lib/Drupal/views/Plugin/views/area/Text.php index 71124a20323839d820d6346247f58b82f62e4782..a9dd6c57299eef60b2f0f09d0c30c66d052c6aa1 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/area/Text.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/area/Text.php @@ -35,6 +35,7 @@ public function buildOptionsForm(&$form, &$form_state) { parent::buildOptionsForm($form, $form_state); $form['content'] = array( + '#title' => t('Content'), '#type' => 'text_format', '#default_value' => $this->options['content'], '#rows' => 6, diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/area/TextCustom.php b/core/modules/views/lib/Drupal/views/Plugin/views/area/TextCustom.php index 2b07806c5b5bf7e1996a8ed36254ea58a49bb8e8..dac981518a17efb4e58c7a99379ccb8282b17db9 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/area/TextCustom.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/area/TextCustom.php @@ -34,6 +34,7 @@ public function buildOptionsForm(&$form, &$form_state) { parent::buildOptionsForm($form, $form_state); $form['content'] = array( + '#title' => t('Content'), '#type' => 'textarea', '#default_value' => $this->options['content'], '#rows' => 6, diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php index 862a847ca8dc04ecc8b55513733cac7f8faae35c..0b0f992a3f5efcb5d60404f91ea22d550250feac 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php @@ -184,6 +184,8 @@ public function buildOptionsForm(&$form, &$form_state) { '#markup' => '
', ); $form['default_action'] = array( + '#title' => t('Default actions'), + '#title_display' => 'invisible', '#type' => 'radios', '#process' => array(array($this, 'processContainerRadios')), '#default_value' => $this->options['default_action'], diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/Attachment.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/Attachment.php index 17df434cb4557f245d2b1aaea29e8df6bc380938..8f581117ccbd19b15346866a3b97daadca6891b2 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/Attachment.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/Attachment.php @@ -185,6 +185,7 @@ public function buildOptionsForm(&$form, &$form_state) { case 'attachment_position': $form['#title'] .= t('Position'); $form['attachment_position'] = array( + '#title' => t('Position'), '#type' => 'radios', '#description' => t('Attach before or after the parent display?'), '#options' => $this->attachmentPositions(), @@ -200,6 +201,7 @@ public function buildOptionsForm(&$form, &$form_state) { } } $form['displays'] = array( + '#title' => t('Displays'), '#type' => 'checkboxes', '#description' => t('Select which display or displays this should attach to.'), '#options' => $displays, diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php index b09320ce4879bfb77eabc4c430cffe0156775da5..424b068307d3ba2f7f7e7f0ba37836799dfaf62b 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php @@ -1411,6 +1411,7 @@ public function buildOptionsForm(&$form, &$form_state) { case 'title': $form['#title'] .= t('The title of this view'); $form['title'] = array( + '#title' => t('Title'), '#type' => 'textfield', '#description' => t('This title will be displayed with the view, wherever titles are normally displayed; i.e, as the page title, block title, etc.'), '#default_value' => $this->getOption('title'), @@ -1500,6 +1501,8 @@ public function buildOptionsForm(&$form, &$form_state) { $access = $this->getOption('access'); $form['access']['type'] = array( + '#title' => t('Access'), + '#title_display' => 'invisible', '#type' => 'radios', '#options' => views_fetch_plugin_names('access', $this->getType(), array($this->view->storage->get('base_table'))), '#default_value' => $access['type'], @@ -1535,6 +1538,8 @@ public function buildOptionsForm(&$form, &$form_state) { $cache = $this->getOption('cache'); $form['cache']['type'] = array( + '#title' => t('Caching'), + '#title_display' => 'invisible', '#type' => 'radios', '#options' => views_fetch_plugin_names('cache', $this->getType(), array($this->view->storage->get('base_table'))), '#default_value' => $cache['type'], @@ -1626,6 +1631,8 @@ public function buildOptionsForm(&$form, &$form_state) { $form['#title'] .= t('How should this view be styled'); $style_plugin = $this->getPlugin('style'); $form['style'] = array( + '#title' => t('Style'), + '#title_display' => 'invisible', '#type' => 'radios', '#options' => views_fetch_plugin_names('style', $this->getType(), array($this->view->storage->get('base_table'))), '#default_value' => $style_plugin->definition['id'], @@ -1668,6 +1675,8 @@ public function buildOptionsForm(&$form, &$form_state) { $form['#title'] .= t('How should each row in this view be styled'); $row_plugin_instance = $this->getPlugin('row'); $form['row'] = array( + '#title' => t('Row'), + '#title_display' => 'invisible', '#type' => 'radios', '#options' => views_fetch_plugin_names('row', $this->getType(), array($this->view->storage->get('base_table'))), '#default_value' => $row_plugin_instance->definition['id'], @@ -1692,6 +1701,7 @@ public function buildOptionsForm(&$form, &$form_state) { $options['custom_url'] = t('Custom URL'); if (count($options)) { $form['link_display'] = array( + '#title' => t('Custom URL'), '#type' => 'radios', '#options' => $options, '#description' => t("Which display to use to get this display's path for things like summary links, rss feed links, more links, etc."), @@ -1859,6 +1869,8 @@ public function buildOptionsForm(&$form, &$form_state) { '#suffix' => '', ); $form['box']['theme'] = array( + '#title' => t('Theme'), + '#title_display' => 'invisible', '#type' => 'select', '#options' => $options, '#default_value' => $this->theme, @@ -1987,6 +1999,8 @@ public function buildOptionsForm(&$form, &$form_state) { $exposed_form = $this->getOption('exposed_form'); $form['exposed_form']['type'] = array( + '#title' => t('Exposed form'), + '#title_display' => 'invisible', '#type' => 'radios', '#options' => views_fetch_plugin_names('exposed_form', $this->getType(), array($this->view->storage->get('base_table'))), '#default_value' => $exposed_form['type'], @@ -2021,6 +2035,8 @@ public function buildOptionsForm(&$form, &$form_state) { $pager = $this->getOption('pager'); $form['pager']['type'] = array( + '#title' => t('Pager'), + '#title_display' => 'invisible', '#type' => 'radios', '#options' => views_fetch_plugin_names('pager', !$this->usesPager() ? 'basic' : NULL, array($this->view->storage->get('base_table'))), '#default_value' => $pager['type'], diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/Feed.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/Feed.php index 8d614587ae7048d84badef7527f01b7651c18f5a..cba3810736094268ef2e4f09481e7eaa57cc75b5 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/Feed.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/Feed.php @@ -218,6 +218,7 @@ public function buildOptionsForm(&$form, &$form_state) { } } $form['displays'] = array( + '#title' => t('Displays'), '#type' => 'checkboxes', '#description' => t('The feed icon will be available only to the selected displays.'), '#options' => $displays, diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php index 57691f172df17e45c03f01296ef33dded1b12cb7..79795d217f86240a600370f301cac121aede08e2 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php @@ -305,6 +305,7 @@ public function buildOptionsForm(&$form, &$form_state) { $form['#title'] .= t('The menu path or URL of this view'); $form['path'] = array( '#type' => 'textfield', + '#title' => t('Path'), '#description' => t('This view will be displayed by visiting this path on your site. You may use "%" in your URL to represent values that will be used for contextual filters: For example, "node/%/feed".'), '#default_value' => $this->getOption('path'), '#field_prefix' => '' . url(NULL, array('absolute' => TRUE)), diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php index 316f9807a1156b931b944ccae6f1af439d48290a..943814acb07707c76c998101fa22ad395db8616d 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php @@ -8,6 +8,7 @@ namespace Drupal\views\Plugin\views\filter; use Drupal\views\Plugin\views\HandlerBase; +use Drupal\Component\Utility\String; use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\Component\Annotation\Plugin; use Drupal\views\ViewExecutable; @@ -745,6 +746,7 @@ public function groupForm(&$form, &$form_state) { $value = $this->options['group_info']['identifier']; $form[$value] = array( + '#title' => String::checkPlain($this->options['group_info']['label']), '#type' => $this->options['group_info']['widget'], '#default_value' => $this->group_info, '#options' => $groups, @@ -785,10 +787,6 @@ public function buildExposedForm(&$form, &$form_state) { $this->operatorForm($form, $form_state); $form[$operator] = $form['operator']; - if (isset($form[$operator]['#title'])) { - unset($form[$operator]['#title']); - } - $this->exposedTranslate($form[$operator], 'operator'); unset($form['operator']); @@ -954,7 +952,7 @@ protected function buildExposedFiltersGroupForm(&$form, &$form_state) { // In each row, we have to display the operator form and the value from // $row acts as a fake form to render each widget in a row. $row = array(); - $groups[$item_id] = ''; + $groups[$item_id] = t('Grouping @id', array('@id' => $item_id)); $this->operatorForm($row, $form_state); // Force the operator form to be a select box. Some handlers uses // radios and they occupy a lot of space in a table row. @@ -1012,12 +1010,16 @@ protected function buildExposedFiltersGroupForm(&$form, &$form_state) { // Per item group, we have a title that identifies it. $form['group_info']['group_items'][$item_id] = array( 'title' => array( + '#title' => t('Label'), + '#title_display' => 'invisible', '#type' => 'textfield', '#size' => 20, '#default_value' => $default_title, ), 'operator' => $row['operator'], 'value' => $row['value'], + // No title is given here, since this input is never displayed. It is + // only triggered by JavaScript. 'remove' => array( '#type' => 'checkbox', '#id' => 'views-removed-' . $item_id, @@ -1025,6 +1027,8 @@ protected function buildExposedFiltersGroupForm(&$form, &$form_state) { '#default_value' => 0, ), 'weight' => array( + '#title' => t('Weight'), + '#title_display' => 'invisible', '#type' => 'weight', '#delta' => 10, '#default_value' => $default_weight++, diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php index ddd022c92c91e15a2ac2844586f084ae730d6092..d9b6326120e255e097e3c6f24319a4d5c3713e05 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/sort/SortPluginBase.php @@ -164,6 +164,7 @@ protected function showSortForm(&$form, &$form_state) { $options = $this->sortOptions(); if (!empty($options)) { $form['order'] = array( + '#title' => t('Order'), '#type' => 'radios', '#options' => $options, '#default_value' => $this->options['order'], diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/style/Table.php b/core/modules/views/lib/Drupal/views/Plugin/views/style/Table.php index de5eef1a6986f57a90fc55400b013c642005d0a6..121047abf0994f7968797a709995f3ae2a7acc5b 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/style/Table.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/style/Table.php @@ -301,12 +301,16 @@ public function buildOptionsForm(&$form, &$form_state) { $column_selector = ':input[name="style_options[columns][' . $field . ']"]'; $form['columns'][$field] = array( + '#title' => t('Columns for @field', array('@field' => $field)), + '#title_display' => 'invisible', '#type' => 'select', '#options' => $field_names, '#default_value' => $column, ); if ($handlers[$field]->clickSortable()) { $form['info'][$field]['sortable'] = array( + '#title' => t('Sortable for @field', array('@field' => $field)), + '#title_display' => 'invisible', '#type' => 'checkbox', '#default_value' => !empty($this->options['info'][$field]['sortable']), '#states' => array( @@ -316,6 +320,8 @@ public function buildOptionsForm(&$form, &$form_state) { ), ); $form['info'][$field]['default_sort_order'] = array( + '#title' => t('Default sort order for @field', array('@field' => $field)), + '#title_display' => 'invisible', '#type' => 'select', '#options' => array('asc' => t('Ascending'), 'desc' => t('Descending')), '#default_value' => !empty($this->options['info'][$field]['default_sort_order']) ? $this->options['info'][$field]['default_sort_order'] : 'asc', @@ -329,6 +335,8 @@ public function buildOptionsForm(&$form, &$form_state) { // Provide an ID so we can have such things. $radio_id = drupal_html_id('edit-default-' . $field); $form['default'][$field] = array( + '#title' => t('Default sort for @field', array('@field' => $field)), + '#title_display' => 'invisible', '#type' => 'radio', '#return_value' => $field, '#parents' => array('style_options', 'default'), @@ -344,6 +352,8 @@ public function buildOptionsForm(&$form, &$form_state) { ); } $form['info'][$field]['align'] = array( + '#title' => t('Alignment for @field', array('@field' => $field)), + '#title_display' => 'invisible', '#type' => 'select', '#default_value' => !empty($this->options['info'][$field]['align']) ? $this->options['info'][$field]['align'] : '', '#options' => array( @@ -359,6 +369,8 @@ public function buildOptionsForm(&$form, &$form_state) { ), ); $form['info'][$field]['separator'] = array( + '#title' => t('Separator for @field', array('@field' => $field)), + '#title_display' => 'invisible', '#type' => 'textfield', '#size' => 10, '#default_value' => isset($this->options['info'][$field]['separator']) ? $this->options['info'][$field]['separator'] : '', @@ -369,6 +381,8 @@ public function buildOptionsForm(&$form, &$form_state) { ), ); $form['info'][$field]['empty_column'] = array( + '#title' => t('Hide empty column for @field', array('@field' => $field)), + '#title_display' => 'invisible', '#type' => 'checkbox', '#default_value' => isset($this->options['info'][$field]['empty_column']) ? $this->options['info'][$field]['empty_column'] : FALSE, '#states' => array( @@ -378,6 +392,8 @@ public function buildOptionsForm(&$form, &$form_state) { ), ); $form['info'][$field]['responsive'] = array( + '#title' => t('Responsive setting for @field', array('@field' => $field)), + '#title_display' => 'invisible', '#type' => 'select', '#default_value' => isset($this->options['info'][$field]['responsive']) ? $this->options['info'][$field]['responsive'] : '', '#options' => array('' => t('High'), RESPONSIVE_PRIORITY_MEDIUM => t('Medium'), RESPONSIVE_PRIORITY_LOW => t('Low')), @@ -396,6 +412,8 @@ public function buildOptionsForm(&$form, &$form_state) { // Provide a radio for no default sort $form['default'][-1] = array( + '#title' => t('No default sort'), + '#title_display' => 'invisible', '#type' => 'radio', '#return_value' => -1, '#parents' => array('style_options', 'default'), diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php index 7e3dea63882933428640bd85226ac431c5f77521..00fad4c67e90a84dc3745c5c826caad58d358107 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php @@ -211,6 +211,7 @@ public function buildForm(array $form, array &$form_state) { $form['displays']['page'] = array( '#type' => 'fieldset', + '#title' => t('Page settings'), '#attributes' => array('class' => array('views-attachment', 'fieldset-no-legend')), '#tree' => TRUE, ); @@ -248,6 +249,7 @@ public function buildForm(array $form, array &$form_state) { ); $form['displays']['page']['options']['style'] = array( '#type' => 'fieldset', + '#title' => t('Page display settings'), '#attributes' => array('class' => array('container-inline', 'fieldset-no-legend')), ); @@ -354,6 +356,7 @@ public function buildForm(array $form, array &$form_state) { $form['displays']['block'] = array( '#type' => 'fieldset', + '#title' => t('Block settings'), '#attributes' => array('class' => array('views-attachment', 'fieldset-no-legend')), '#tree' => TRUE, ); @@ -385,6 +388,7 @@ public function buildForm(array $form, array &$form_state) { ); $form['displays']['block']['options']['style'] = array( '#type' => 'fieldset', + '#title' => t('Block display settings'), '#attributes' => array('class' => array('container-inline', 'fieldset-no-legend')), ); diff --git a/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/display/DisplayTest.php b/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/display/DisplayTest.php index 162f77d8a2dd332e8a9f4cbcbfa34aeb8757e913..e8ffa64bd77bd399cdcd43e2fc22f3f3ef3a3ac0 100644 --- a/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/display/DisplayTest.php +++ b/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/display/DisplayTest.php @@ -82,6 +82,7 @@ public function buildOptionsForm(&$form, &$form_state) { case 'test_option': $form['#title'] .= t('Test option'); $form['test_option'] = array( + '#title' => t('Test option'), '#type' => 'textfield', '#description' => t('This is a textfield for test_option.'), '#default_value' => $this->getOption('test_option'), diff --git a/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/display_extender/DisplayExtenderTest.php b/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/display_extender/DisplayExtenderTest.php index 50e10da8937b240baed0793bdd6c72743efc358e..42519715eb1d323df6859e865e2b940d5a15e8ac 100644 --- a/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/display_extender/DisplayExtenderTest.php +++ b/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/display_extender/DisplayExtenderTest.php @@ -69,6 +69,7 @@ public function buildOptionsForm(&$form, &$form_state) { case 'test_extender_test_option': $form['#title'] .= t('Test option'); $form['test_extender_test_option'] = array( + '#title' => t('Test option'), '#type' => 'textfield', '#description' => t('This is a textfield for test_option.'), '#default_value' => $this->displayHandler->getOption('test_extender_test_option'), diff --git a/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/row/RowTest.php b/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/row/RowTest.php index 706fd6513df7649d1cce55fb4d78c1b66b3e9696..8dd4562242fd7dd1794e6f0e0f8579e9f07e322b 100644 --- a/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/row/RowTest.php +++ b/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/row/RowTest.php @@ -50,6 +50,7 @@ public function buildOptionsForm(&$form, &$form_state) { parent::buildOptionsForm($form, $form_state); $form['test_option'] = array( + '#title' => t('Test option'), '#type' => 'textfield', '#description' => t('This is a textfield for test_option.'), '#default_value' => $this->options['test_option'], diff --git a/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/style/StyleTest.php b/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/style/StyleTest.php index a4156c5006649c18707aca26f85f49fcd00cc33a..66162dc59baefa0594f7ce7572520491f5b13843 100644 --- a/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/style/StyleTest.php +++ b/core/modules/views/tests/modules/views_test_data/lib/Drupal/views_test_data/Plugin/views/style/StyleTest.php @@ -58,6 +58,7 @@ public function buildOptionsForm(&$form, &$form_state) { parent::buildOptionsForm($form, $form_state); $form['test_option'] = array( + '#title' => t('Test option'), '#type' => 'textfield', '#description' => t('This is a textfield for test_option.'), '#default_value' => $this->options['test_option'], diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php index 874867435f4fd1544ed74fe95c31dded945c7e42..b5364d087c54a6e9b8e48d8223e880d042b20bbc 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php @@ -95,23 +95,26 @@ public function buildForm(array $form, array &$form_state) { if (!empty($field['relationship']) && !empty($relationships[$field['relationship']])) { $name = '(' . $relationships[$field['relationship']] . ') ' . $name; } - - $form['fields'][$id]['name'] = array( - '#markup' => $name, - ); + $markup = $name; } else { - $form['fields'][$id]['name'] = array('#markup' => $this->t('Broken field @id', array('@id' => $id))); + $name = $id; + $markup = $this->t('Broken field @id', array('@id' => $id)); } + $form['fields'][$id]['name'] = array('#markup' => $markup); $form['fields'][$id]['weight'] = array( '#type' => 'textfield', '#default_value' => ++$count, '#attributes' => array('class' => array('weight')), + '#title' => t('Weight for @title', array('@title' => $name)), + '#title_display' => 'invisible', ); $form['fields'][$id]['removed'] = array( '#type' => 'checkbox', + '#title' => t('Remove @title', array('@title' => $name)), + '#title_display' => 'invisible', '#id' => 'views-removed-' . $id, '#attributes' => array('class' => array('views-remove-checkbox')), '#default_value' => 0, @@ -119,11 +122,6 @@ public function buildForm(array $form, array &$form_state) { ); } - $name = NULL; - if (isset($form_state['update_name'])) { - $name = $form_state['update_name']; - } - $view->getStandardButtons($form, $form_state, 'views_ui_rearrange_form'); return $form; diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php index a77840b7a8261d045142d2bda6ef82eb06dee86c..ebfbd489aea63dcf8f3d89031d898c2fa36cc2ce 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php @@ -158,11 +158,15 @@ public function buildForm(array $form, array &$form_state) { $form['#group_renders'][$field['group']][] = $id; $form['filters'][$id]['weight'] = array( + '#title' => t('Weight for @id', array('@id' => $id)), + '#title_display' => 'invisible', '#type' => 'textfield', '#default_value' => ++$count, '#size' => 8, ); $form['filters'][$id]['group'] = array( + '#title' => t('Group for @id', array('@id' => $id)), + '#title_display' => 'invisible', '#type' => 'select', '#options' => $group_options, '#default_value' => $field['group'], @@ -186,6 +190,8 @@ public function buildForm(array $form, array &$form_state) { $form['filters'][$id]['name'] = array('#markup' => $this->t('Broken field @id', array('@id' => $id))); } $form['filters'][$id]['removed'] = array( + '#title' => t('Remove @id', array('@id' => $id)), + '#title_display' => 'invisible', '#type' => 'checkbox', '#id' => 'views-removed-' . $id, '#attributes' => array('class' => array('views-remove-checkbox')), diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ReorderDisplays.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ReorderDisplays.php index 47d1fb6e469d91d642846db0ed1084e22fde0e3f..512ab2ae23e0f2cd55a7e4274b72053ce2a2c856 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ReorderDisplays.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ReorderDisplays.php @@ -98,6 +98,8 @@ public function buildForm(array $form, array &$form_state) { $form['displays'][$id]['removed'] = array( 'checkbox' => array( + '#title' => t('Remove @id', array('@id' => $id)), + '#title_display' => 'invisible', '#type' => 'checkbox', '#id' => 'display-removed-' . $id, '#attributes' => array( diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/BasicSettingsForm.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/BasicSettingsForm.php index 99cc8c5afa6fe7b0405d611295dafe7689f51e5d..707db987bab1be2f103c28cc7a8daf398e25b436 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/BasicSettingsForm.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/BasicSettingsForm.php @@ -95,6 +95,7 @@ public function buildForm(array $form, array &$form_state) { $form['live_preview']['options']['ui_show_sql_query_where'] = array( '#type' => 'radios', + '#title' => t('Show SQL query'), '#options' => array( 'above' => $this->t('Above the preview'), 'below' => $this->t('Below the preview'), diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php index f571d5f5a30baeb7097cc2a459450d210b7fe696..6bd5439530985a977f81c243a826af0577552e79 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php @@ -69,6 +69,7 @@ public function form(array $form, array &$form_state) { $form['name'] = array( '#type' => 'fieldset', + '#title' => t('View basic information'), '#attributes' => array('class' => array('fieldset-no-legend')), ); @@ -118,6 +119,7 @@ public function form(array $form, array &$form_state) { // properties of what the view will display. $form['displays']['show'] = array( '#type' => 'fieldset', + '#title' => t('View settings'), '#tree' => TRUE, '#attributes' => array('class' => array('container-inline')), );