Commit f503d228 authored by webchick's avatar webchick

Issue #2074509 by tim.plunkett, falcon03, mgifford, Xano: Fixed Add missing...

Issue #2074509 by tim.plunkett, falcon03, mgifford, Xano: Fixed Add missing #title property to ensure form accessibility.
parent 11eeb98b
...@@ -2470,6 +2470,7 @@ function _install_configure_form($form, &$form_state, &$install_state) { ...@@ -2470,6 +2470,7 @@ function _install_configure_form($form, &$form_state, &$install_state) {
); );
$form['update_notifications']['update_status_module'] = array( $form['update_notifications']['update_status_module'] = array(
'#type' => 'checkboxes', '#type' => 'checkboxes',
'#title' => t('Update notifications'),
'#options' => array( '#options' => array(
1 => t('Check for updates automatically'), 1 => t('Check for updates automatically'),
2 => t('Receive e-mail notifications'), 2 => t('Receive e-mail notifications'),
......
...@@ -72,7 +72,6 @@ public function form(array $form, array &$form_state) { ...@@ -72,7 +72,6 @@ public function form(array $form, array &$form_state) {
$form['id'] = array( $form['id'] = array(
'#type' => 'machine_name', '#type' => 'machine_name',
'#title' => $this->t('Machine name'),
'#default_value' => $this->entity->id(), '#default_value' => $this->entity->id(),
'#disabled' => !$this->entity->isNew(), '#disabled' => !$this->entity->isNew(),
'#maxlength' => 64, '#maxlength' => 64,
......
...@@ -102,7 +102,6 @@ public function form(array $form, array &$form_state) { ...@@ -102,7 +102,6 @@ public function form(array $form, array &$form_state) {
// If creating a new block, calculate a safe default machine name. // If creating a new block, calculate a safe default machine name.
$form['machine_name'] = array( $form['machine_name'] = array(
'#type' => 'machine_name', '#type' => 'machine_name',
'#title' => $this->t('Machine name'),
'#maxlength' => 64, '#maxlength' => 64,
'#description' => $this->t('A unique name for this block instance. Must be alpha-numeric and underscore separated.'), '#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), '#default_value' => !$entity->isNew() ? $entity->id() : $this->getUniqueMachineName($entity),
......
...@@ -262,8 +262,8 @@ public function buildForm(array $form, array &$form_state) { ...@@ -262,8 +262,8 @@ public function buildForm(array $form, array &$form_state) {
'#type' => 'select', '#type' => 'select',
'#default_value' => $region, '#default_value' => $region,
'#empty_value' => BLOCK_REGION_NONE, '#empty_value' => BLOCK_REGION_NONE,
'#title_display' => 'invisible',
'#title' => t('Region for @block block', array('@block' => $info['admin_label'])), '#title' => t('Region for @block block', array('@block' => $info['admin_label'])),
'#title_display' => 'invisible',
'#options' => $this->regions, '#options' => $this->regions,
'#attributes' => array( '#attributes' => array(
'class' => array('block-region-select', 'block-region-' . $region), 'class' => array('block-region-select', 'block-region-' . $region),
...@@ -279,8 +279,8 @@ public function buildForm(array $form, array &$form_state) { ...@@ -279,8 +279,8 @@ public function buildForm(array $form, array &$form_state) {
'#type' => 'weight', '#type' => 'weight',
'#default_value' => $info['weight'], '#default_value' => $info['weight'],
'#delta' => $weight_delta, '#delta' => $weight_delta,
'#title_display' => 'invisible',
'#title' => t('Weight for @block block', array('@block' => $info['admin_label'])), '#title' => t('Weight for @block block', array('@block' => $info['admin_label'])),
'#title_display' => 'invisible',
'#attributes' => array( '#attributes' => array(
'class' => array('block-weight', 'block-weight-' . $region), 'class' => array('block-weight', 'block-weight-' . $region),
), ),
......
...@@ -160,6 +160,8 @@ function _book_admin_table_tree($tree, &$form) { ...@@ -160,6 +160,8 @@ function _book_admin_table_tree($tree, &$form) {
'depth' => array('#type' => 'value', '#value' => $data['link']['depth']), 'depth' => array('#type' => 'value', '#value' => $data['link']['depth']),
'href' => array('#type' => 'value', '#value' => $data['link']['href']), 'href' => array('#type' => 'value', '#value' => $data['link']['href']),
'title' => array( 'title' => array(
'#title' => t('Title'),
'#title_display' => 'invisible',
'#type' => 'textfield', '#type' => 'textfield',
'#default_value' => $data['link']['link_title'], '#default_value' => $data['link']['link_title'],
'#maxlength' => 255, '#maxlength' => 255,
......
...@@ -118,6 +118,7 @@ function comment_admin_overview($form, &$form_state, $arg) { ...@@ -118,6 +118,7 @@ function comment_admin_overview($form, &$form_state, $arg) {
'#account' => comment_prepare_author($comment), '#account' => comment_prepare_author($comment),
); );
$options[$comment->id()] = array( $options[$comment->id()] = array(
'title' => array('data' => array('#title' => $comment->subject->value ?: $comment->id())),
'subject' => array( 'subject' => array(
'data' => array( 'data' => array(
'#type' => 'link', '#type' => 'link',
......
...@@ -88,8 +88,8 @@ protected function buildFormStyle(array &$form, array &$form_state, $type) { ...@@ -88,8 +88,8 @@ protected function buildFormStyle(array &$form, array &$form_state, $type) {
case 'comment': case 'comment':
$style_form['row_options']['links'] = array( $style_form['row_options']['links'] = array(
'#type' => 'select', '#type' => 'select',
'#title_display' => 'invisible',
'#title' => t('Should links be displayed below each comment'), '#title' => t('Should links be displayed below each comment'),
'#title_display' => 'invisible',
'#options' => array( '#options' => array(
1 => t('with links (allow users to reply to the comment, etc.)'), 1 => t('with links (allow users to reply to the comment, etc.)'),
0 => t('without links'), 0 => t('without links'),
......
...@@ -59,9 +59,10 @@ public function buildForm(array $form, array &$form_state) { ...@@ -59,9 +59,10 @@ public function buildForm(array $form, array &$form_state) {
); );
$form['import_tarball'] = array( $form['import_tarball'] = array(
'#type' => 'file', '#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.'), '#description' => $this->t('This form will redirect you to the import configuration screen.'),
); );
$form['submit'] = array( $form['submit'] = array(
'#type' => 'submit', '#type' => 'submit',
'#value' => $this->t('Upload'), '#value' => $this->t('Upload'),
......
...@@ -89,6 +89,7 @@ function _content_translation_form_language_content_settings_form_alter(array &$ ...@@ -89,6 +89,7 @@ function _content_translation_form_language_content_settings_form_alter(array &$
if ($fields) { if ($fields) {
$form['settings'][$entity_type][$bundle]['translatable'] = array( $form['settings'][$entity_type][$bundle]['translatable'] = array(
'#type' => 'checkbox', '#type' => 'checkbox',
'#title' => $bundle,
'#default_value' => content_translation_enabled($entity_type, $bundle), '#default_value' => content_translation_enabled($entity_type, $bundle),
); );
...@@ -99,6 +100,7 @@ function _content_translation_form_language_content_settings_form_alter(array &$ ...@@ -99,6 +100,7 @@ function _content_translation_form_language_content_settings_form_alter(array &$
$form['settings'][$entity_type][$bundle]['fields'][$field_name] = array( $form['settings'][$entity_type][$bundle]['fields'][$field_name] = array(
'#label' => $instance['label'], '#label' => $instance['label'],
'#type' => 'checkbox', '#type' => 'checkbox',
'#title' => $instance['label'],
'#default_value' => $field['translatable'], '#default_value' => $field['translatable'],
); );
$column_element = content_translation_field_sync_widget($field, $instance); $column_element = content_translation_field_sync_widget($field, $instance);
......
...@@ -155,6 +155,8 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac ...@@ -155,6 +155,8 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac
'#weight' => -100, '#weight' => -100,
'#multilingual' => TRUE, '#multilingual' => TRUE,
'source' => array( 'source' => array(
'#title' => t('Select source language'),
'#title_display' => 'invisible',
'#type' => 'select', '#type' => 'select',
'#default_value' => $source_langcode, '#default_value' => $source_langcode,
'#options' => array(), '#options' => array(),
......
...@@ -34,7 +34,11 @@ function getDefaultSettings() { ...@@ -34,7 +34,11 @@ function getDefaultSettings() {
* Implements \Drupal\editor\Plugin\EditPluginInterface::settingsForm(). * Implements \Drupal\editor\Plugin\EditPluginInterface::settingsForm().
*/ */
function settingsForm(array $form, array &$form_state, EditorEntity $editor) { 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; return $form;
} }
......
...@@ -82,7 +82,6 @@ public function form(array $form, array &$form_state) { ...@@ -82,7 +82,6 @@ public function form(array $form, array &$form_state) {
$form['id'] = array( $form['id'] = array(
'#type' => 'machine_name', '#type' => 'machine_name',
'#title' => t('Machine-readable name'),
'#description' => t('A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'), '#description' => t('A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'),
'#disabled' => !$this->entity->isNew(), '#disabled' => !$this->entity->isNew(),
'#default_value' => $this->entity->id(), '#default_value' => $this->entity->id(),
......
...@@ -54,6 +54,7 @@ function language_elements_configuration_element() { ...@@ -54,6 +54,7 @@ function language_elements_configuration_element() {
*/ */
function language_elements_configuration_element_test() { function language_elements_configuration_element_test() {
$form['langcode'] = array( $form['langcode'] = array(
'#title' => t('Language select'),
'#type' => 'language_select', '#type' => 'language_select',
'#default_value' => language_get_default_langcode('custom_type', 'some_bundle'), '#default_value' => language_get_default_langcode('custom_type', 'some_bundle'),
); );
......
...@@ -85,9 +85,10 @@ ...@@ -85,9 +85,10 @@
background: transparent url(../../../misc/menu-expanded.png) left .6em no-repeat; background: transparent url(../../../misc/menu-expanded.png) left .6em no-repeat;
} }
#locale-translation-status-form label { #locale-translation-status-form .label {
color: #1d1d1d; color: #1d1d1d;
font-size: 1.15em; font-size: 1.15em;
font-weight: bold;
} }
#locale-translation-status-form .description { #locale-translation-status-form .description {
cursor: pointer; cursor: pointer;
......
...@@ -167,7 +167,7 @@ function testUpdateImportSourceRemote() { ...@@ -167,7 +167,7 @@ function testUpdateImportSourceRemote() {
$this->drupalGet('admin/reports/translations/check'); $this->drupalGet('admin/reports/translations/check');
// Check the status on the Available translation status page. // Check the status on the Available translation status page.
$this->assertRaw('<label for="edit-langcodes-de" class="language-name">German</label>', 'German language found'); $this->assertRaw('<label class="visually-hidden" for="edit-langcodes-de">Update German</label>', 'German language found');
$this->assertText('Updates for: Contributed module one, Contributed module two, Custom module one, Locale test', 'Updates 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 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'); $this->assertText('Contributed module two (' . format_date($this->timestamp_new, 'html_date') . ')', 'Updates for Contrib module two');
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* Interface translation summary, editing and deletion user interfaces. * Interface translation summary, editing and deletion user interfaces.
*/ */
use Drupal\Component\Utility\String;
use Drupal\Core\Language\Language; use Drupal\Core\Language\Language;
use Drupal\locale\SourceString; use Drupal\locale\SourceString;
use Drupal\locale\TranslationString; use Drupal\locale\TranslationString;
...@@ -520,6 +521,7 @@ function locale_translation_status_form($form, &$form_state) { ...@@ -520,6 +521,7 @@ function locale_translation_status_form($form, &$form_state) {
// Build data options for the select table. // Build data options for the select table.
foreach($updates as $langcode => $update) { foreach($updates as $langcode => $update) {
$title = String::checkPlain($languages[$langcode]->name);
$locale_translation_update_info = array('#theme' => 'locale_translation_update_info'); $locale_translation_update_info = array('#theme' => 'locale_translation_update_info');
foreach (array('updates', 'not_found') as $update_status) { foreach (array('updates', 'not_found') as $update_status) {
if (isset($update[$update_status])) { if (isset($update[$update_status])) {
...@@ -527,12 +529,20 @@ function locale_translation_status_form($form, &$form_state) { ...@@ -527,12 +529,20 @@ function locale_translation_status_form($form, &$form_state) {
} }
} }
$options[$langcode] = array( $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)), 'status' => array('class' => array('description', 'expand', 'priority-low'), 'data' => drupal_render($locale_translation_update_info)),
); );
} }
// Sort the table data on language name. // 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'); $last_checked = Drupal::state()->get('locale.translation_last_checked');
...@@ -639,13 +649,6 @@ function locale_translation_status_form_submit($form, &$form_state) { ...@@ -639,13 +649,6 @@ function locale_translation_status_form_submit($form, &$form_state) {
* translation files could not be found. * translation files could not be found.
*/ */
function locale_translation_language_table($form_element) { 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'] = '<label for="' . $form_element[$langcode]['#id'] . '" class="language-name">' . $title . '</label>';
}
// Remove checkboxes of languages without updates. // Remove checkboxes of languages without updates.
if ($form_element['#not_found']) { if ($form_element['#not_found']) {
foreach ($form_element['#not_found'] as $langcode) { foreach ($form_element['#not_found'] as $langcode) {
......
...@@ -315,8 +315,8 @@ protected function buildOverviewTreeForm($tree, $delta) { ...@@ -315,8 +315,8 @@ protected function buildOverviewTreeForm($tree, $delta) {
'#type' => 'weight', '#type' => 'weight',
'#delta' => $delta, '#delta' => $delta,
'#default_value' => $item['weight'], '#default_value' => $item['weight'],
'#title_display' => 'invisible',
'#title' => t('Weight for @title', array('@title' => $item['title'])), '#title' => t('Weight for @title', array('@title' => $item['title'])),
'#title_display' => 'invisible',
); );
$form[$mlid]['mlid'] = array( $form[$mlid]['mlid'] = array(
'#type' => 'hidden', '#type' => 'hidden',
......
...@@ -39,6 +39,7 @@ public function buildForm(array $form, array &$form_state) { ...@@ -39,6 +39,7 @@ public function buildForm(array $form, array &$form_state) {
$options[$type->type] = $type->name; $options[$type->type] = $type->name;
} }
$form['bundles'] = array( $form['bundles'] = array(
'#title' => t('Node types'),
'#type' => 'checkboxes', '#type' => 'checkboxes',
'#options' => $options, '#options' => $options,
'#required' => TRUE, '#required' => TRUE,
......
...@@ -107,8 +107,8 @@ protected function buildFormStyle(array &$form, array &$form_state, $type) { ...@@ -107,8 +107,8 @@ protected function buildFormStyle(array &$form, array &$form_state, $type) {
case 'teasers': case 'teasers':
$style_form['row_options']['links'] = array( $style_form['row_options']['links'] = array(
'#type' => 'select', '#type' => 'select',
'#title_display' => 'invisible',
'#title' => t('Should links be displayed below each node'), '#title' => t('Should links be displayed below each node'),
'#title_display' => 'invisible',
'#options' => array( '#options' => array(
1 => t('with links (allow users to add comments, etc.)'), 1 => t('with links (allow users to add comments, etc.)'),
0 => t('without links'), 0 => t('without links'),
...@@ -117,8 +117,8 @@ protected function buildFormStyle(array &$form, array &$form_state, $type) { ...@@ -117,8 +117,8 @@ protected function buildFormStyle(array &$form, array &$form_state, $type) {
); );
$style_form['row_options']['comments'] = array( $style_form['row_options']['comments'] = array(
'#type' => 'select', '#type' => 'select',
'#title_display' => 'invisible',
'#title' => t('Should comments be displayed below each node'), '#title' => t('Should comments be displayed below each node'),
'#title_display' => 'invisible',
'#options' => array( '#options' => array(
1 => t('with comments'), 1 => t('with comments'),
0 => t('without comments'), 0 => t('without comments'),
......
...@@ -94,11 +94,15 @@ public function buildOptionsForm(&$form, &$form_state) { ...@@ -94,11 +94,15 @@ public function buildOptionsForm(&$form, &$form_state) {
'#markup' => $id, '#markup' => $id,
); );
$form['field_options'][$id]['alias'] = array( $form['field_options'][$id]['alias'] = array(
'#title' => t('Alias for @id', array('@id' => $id)),
'#title_display' => 'invisible',
'#type' => 'textfield', '#type' => 'textfield',
'#default_value' => isset($options[$id]['alias']) ? $options[$id]['alias'] : '', '#default_value' => isset($options[$id]['alias']) ? $options[$id]['alias'] : '',
'#element_validate' => array(array($this, 'validateAliasName')), '#element_validate' => array(array($this, 'validateAliasName')),
); );
$form['field_options'][$id]['raw_output'] = array( $form['field_options'][$id]['raw_output'] = array(
'#title' => t('Raw output for @id', array('@id' => $id)),
'#title_display' => 'invisible',
'#type' => 'checkbox', '#type' => 'checkbox',
'#default_value' => isset($options[$id]['raw_output']) ? $options[$id]['raw_output'] : '', '#default_value' => isset($options[$id]['raw_output']) ? $options[$id]['raw_output'] : '',
); );
......
...@@ -84,6 +84,7 @@ public function buildForm(array $form, array &$form_state) { ...@@ -84,6 +84,7 @@ public function buildForm(array $form, array &$form_state) {
); );
$form['cron'] = array( $form['cron'] = array(
'#title' => t('Cron settings'),
'#type' => 'details', '#type' => 'details',
); );
$form['cron']['cron_safe_threshold'] = array( $form['cron']['cron_safe_threshold'] = array(
......
...@@ -125,7 +125,6 @@ public function form(array $form, array &$form_state) { ...@@ -125,7 +125,6 @@ public function form(array $form, array &$form_state) {
$form['id'] = array( $form['id'] = array(
'#type' => 'machine_name', '#type' => 'machine_name',
'#title' => t('Machine-readable name'),
'#description' => t('A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'), '#description' => t('A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'),
'#disabled' => !$this->entity->isNew(), '#disabled' => !$this->entity->isNew(),
'#default_value' => $this->entity->id(), '#default_value' => $this->entity->id(),
......
...@@ -49,6 +49,7 @@ function ajax_forms_test_simple_form($form, &$form_state) { ...@@ -49,6 +49,7 @@ function ajax_forms_test_simple_form($form, &$form_state) {
$form = array(); $form = array();
$form['select'] = array( $form['select'] = array(
'#title' => t('Color'),
'#type' => 'select', '#type' => 'select',
'#options' => array( '#options' => array(
'red' => 'red', 'red' => 'red',
...@@ -83,6 +84,7 @@ function ajax_forms_test_simple_form($form, &$form_state) { ...@@ -83,6 +84,7 @@ function ajax_forms_test_simple_form($form, &$form_state) {
foreach ($invalid_callbacks as $key => $value) { foreach ($invalid_callbacks as $key => $value) {
$form['select_' . $key . '_callback'] = array( $form['select_' . $key . '_callback'] = array(
'#type' => 'select', '#type' => 'select',
'#title' => t('Test %key callbacks', array('%key' => $key)),
'#options' => array('red' => 'red'), '#options' => array('red' => 'red'),
'#ajax' => array('callback' => $value), '#ajax' => array('callback' => $value),
); );
...@@ -542,6 +544,7 @@ function ajax_forms_test_lazy_load_form($form, &$form_state) { ...@@ -542,6 +544,7 @@ function ajax_forms_test_lazy_load_form($form, &$form_state) {
'data' => array('test' => 'currentPathUpdate'), 'data' => array('test' => 'currentPathUpdate'),
); );
$form['add_files'] = array( $form['add_files'] = array(
'#title' => t('Add files'),
'#type' => 'checkbox', '#type' => 'checkbox',
'#default_value' => FALSE, '#default_value' => FALSE,
); );
......
...@@ -312,6 +312,7 @@ function _batch_test_nested_drupal_form_submit_callback($value) { ...@@ -312,6 +312,7 @@ function _batch_test_nested_drupal_form_submit_callback($value) {
*/ */
function batch_test_mock_form($form, $form_state) { function batch_test_mock_form($form, $form_state) {
$form['test_value'] = array( $form['test_value'] = array(
'#title' => t('Test value'),
'#type' => 'textfield', '#type' => 'textfield',
); );
$form['submit'] = array( $form['submit'] = array(
......
<?php <?php
use Drupal\Component\Utility\String;
use Drupal\Core\Database\Query\AlterableInterface; use Drupal\Core\Database\Query\AlterableInterface;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
...@@ -233,6 +234,7 @@ function database_test_theme_tablesort($form, &$form_state) { ...@@ -233,6 +234,7 @@ function database_test_theme_tablesort($form, &$form_state) {
foreach (user_load_multiple($uids) as $account) { foreach (user_load_multiple($uids) as $account) {
$options[$account->id()] = array( $options[$account->id()] = array(
'title' => array('data' => array('#title' => String::checkPlain($account->getUsername()))),
'username' => check_plain($account->getUsername()), 'username' => check_plain($account->getUsername()),
'status' => $account->isActive() ? t('active') : t('blocked'), 'status' => $account->isActive() ? t('active') : t('blocked'),
); );
......
...@@ -701,6 +701,7 @@ function _form_test_tableselect_get_data() { ...@@ -701,6 +701,7 @@ function _form_test_tableselect_get_data() {
); );
$options['row1'] = array( $options['row1'] = array(
'title' => array('data' => array('#title' => t('row1'))),
'one' => 'row1col1', 'one' => 'row1col1',
'two' => t('row1col2'), 'two' => t('row1col2'),
'three' => t('row1col3'), 'three' => t('row1col3'),
...@@ -708,6 +709,7 @@ function _form_test_tableselect_get_data() { ...@@ -708,6 +709,7 @@ function _form_test_tableselect_get_data() {
); );
$options['row2'] = array( $options['row2'] = array(
'title' => array('data' => array('#title' => t('row2'))),
'one' => 'row2col1', 'one' => 'row2col1',
'two' => t('row2col2'), 'two' => t('row2col2'),
'three' => t('row2col3'), 'three' => t('row2col3'),
...@@ -715,6 +717,7 @@ function _form_test_tableselect_get_data() { ...@@ -715,6 +717,7 @@ function _form_test_tableselect_get_data() {
); );
$options['row3'] = array( $options['row3'] = array(
'title' => array('data' => array('#title' => t('row3'))),
'one' => 'row3col1', 'one' => 'row3col1',
'two' => t('row3col2'), 'two' => t('row3col2'),
'three' => t('row3col3'), 'three' => t('row3col3'),
...@@ -1044,21 +1047,21 @@ function form_label_test_form() { ...@@ -1044,21 +1047,21 @@ function form_label_test_form() {
$form['form_checkboxes_title_attribute'] = array( $form['form_checkboxes_title_attribute'] = array(
'#type' => 'checkboxes', '#type' => 'checkboxes',
'#title' => 'Checkboxes test', '#title' => 'Checkboxes test',
'#title_display' => 'attribute',
'#options' => array( '#options' => array(
'first-checkbox' => 'First checkbox', 'first-checkbox' => 'First checkbox',
'second-checkbox' => 'Second checkbox', 'second-checkbox' => 'Second checkbox',
), ),
'#title_display' => 'attribute',
'#required' => TRUE, '#required' => TRUE,
); );
$form['form_radios_title_attribute'] = array( $form['form_radios_title_attribute'] = array(
'#type' => 'radios', '#type' => 'radios',
'#title' => 'Radios test', '#title' => 'Radios test',
'#title_display' => 'attribute',
'#options' => array( '#options' => array(
'first-radio' => 'First radio', 'first-radio' => 'First radio',
'second-radio' => 'Second radio', 'second-radio' => 'Second radio',
), ),
'#title_display' => 'attribute',
'#required' => TRUE, '#required' => TRUE,
); );
...@@ -1338,25 +1341,30 @@ function form_test_language_select() { ...@@ -1338,25 +1341,30 @@ function form_test_language_select() {
$form['#submit'] = array('_form_test_submit_values_json'); $form['#submit'] = array('_form_test_submit_values_json');
$form['languages_all'] = array( $form['languages_all'] = array(
'#title' => t('Languages: All'),
'#type' => 'language_select', '#type' => 'language_select',
'#languages' => Language::STATE_ALL, '#languages' => Language::STATE_ALL,
'#default_value' => 'xx', '#default_value' => 'xx',
); );
$form['languages_configurable'] = array( $form['languages_configurable'] = array(
'#title' => t('Languages: Configurable'),
'#type' => 'language_select', '#type' => 'language_select',
'#languages' => Language::STATE_CONFIGURABLE, '#languages' => Language::STATE_CONFIGURABLE,
'#default_value' => 'en', '#default_value' => 'en',
); );
$form['languages_locked'] = array( $form['languages_locked'] = array(
'#title' => t('Languages: Locked'),
'#type' => 'language_select', '#type' => 'language_select',
'#languages' => Language::STATE_LOCKED, '#languages' => Language::STATE_LOCKED,
); );
$form['languages_config_and_locked'] = array( $form['languages_config_and_locked'] = array(
'#title' => t('Languages: Configurable and locked'),
'#type' => 'language_select', '#type' => 'language_select',
'#languages' => Language::STATE_CONFIGURABLE | Language::STATE_LOCKED, '#languages' => Language::STATE_CONFIGURABLE | Language::STATE_LOCKED,
'#default_value' => 'dummy_value', '#default_value' => 'dummy_value',
); );
$form['language_custom_options'] = array( $form['language_custom_options'] = array(
'#title' => t('Languages: Custom'),
'#type' => 'language_select', '#type' => 'language_select',
'#languages' => Language::STATE_CONFIGURABLE | Language::STATE_LOCKED, '#languages' => Language::STATE_CONFIGURABLE | Language::STATE_LOCKED,
'#options' => array('opt1' => 'First option', 'opt2' => 'Second option', 'opt3' => 'Third option'), '#options' => array('opt1' => 'First option', 'opt2' => 'Second option', 'opt3' => 'Third option'),
...@@ -1907,6 +1915,7 @@ function _form_test_input_forgery($form, &$form_state) { ...@@ -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 // For testing that a user can't submit a value not matching one of the
// allowed options. // allowed options.
$form['checkboxes'] = array( $form['checkboxes'] = array(
'#title' => t('Checkboxes'),
'#type' => 'checkboxes', '#type' => 'checkboxes',
'#options' => array( '#options' => array(
'one' => 'One', 'one' => 'One',
...@@ -2050,6 +2059,7 @@ function form_test_programmatic_form($form, &$form_state) { ...@@ -2050,6 +2059,7 @@ function form_test_programmatic_form($form, &$form_state) {
); );
$form[