diff --git a/core/includes/form.inc b/core/includes/form.inc
index 05b6d29..dd54069 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -2886,7 +2886,7 @@ function form_get_options($element, $key) {
* @param $variables
* An associative array containing:
* - element: An associative array containing the properties of the element.
- * Properties used: #attributes, #children, #collapsed, #description, #id,
+ * Properties used: #attributes, #children, #description, #id,
* #title, #value.
*
* @ingroup themeable
@@ -2932,7 +2932,7 @@ function theme_fieldset($variables) {
* @param $variables
* An associative array containing:
* - element: An associative array containing the properties of the element.
- * Properties used: #attributes, #children, #collapsed, #description, #id,
+ * Properties used: #attributes, #children, #open, #description, #id,
* #title, #value.
*
* @ingroup themeable
@@ -2950,7 +2950,7 @@ function theme_details($variables) {
if (!empty($element['#attributes']['id'])) {
$summary_attributes['aria-controls'] = $element['#attributes']['id'];
}
- $summary_attributes['aria-expanded'] = empty($element['#attributes']['open']) ? FALSE : TRUE;
+ $summary_attributes['aria-expanded'] = !empty($element['#attributes']['open']);
$summary_attributes['aria-pressed'] = $summary_attributes['aria-expanded'];
$output .= '
Changing the settings below will cause the site index to be rebuilt. The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed.
The default settings should be appropriate for the majority of sites.
') @@ -174,7 +177,8 @@ public function buildForm(array $form, array &$form_state) { $form['active'] = array( '#type' => 'details', - '#title' => $this->t('Active search plugins') + '#title' => $this->t('Active search plugins'), + '#open' => TRUE, ); $options = $this->getOptions(); $form['active']['active_plugins'] = array( diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestResultsForm.php b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestResultsForm.php index d1d339a..d59bf76 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestResultsForm.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestResultsForm.php @@ -144,6 +144,7 @@ public function buildForm(array $form, array &$form_state, $test_id = NULL) { '#type' => 'details', '#title' => $info['name'], '#description' => $info['description'], + '#open' => TRUE, ); $form['result']['results'][$group]['summary'] = $summary; $group_summary =& $form['result']['results'][$group]['summary']; @@ -176,7 +177,7 @@ public function buildForm(array $form, array &$form_state, $test_id = NULL) { // Set summary information. $group_summary['#ok'] = $group_summary['#fail'] + $group_summary['#exception'] == 0; - $form['result']['results'][$group]['#collapsed'] = $group_summary['#ok']; + $form['result']['results'][$group]['#open'] = !$group_summary['#ok']; // Store test group (class) as for use in filter. $filter[$group_summary['#ok'] ? 'pass' : 'fail'][] = $group; diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php index ed65884..1f9f277 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php @@ -29,6 +29,7 @@ public function buildForm(array $form, array &$form_state) { $form['general'] = array( '#type' => 'details', '#title' => $this->t('General'), + '#open' => TRUE, ); $form['general']['simpletest_clear_results'] = array( '#type' => 'checkbox', @@ -47,7 +48,6 @@ public function buildForm(array $form, array &$form_state) { '#type' => 'details', '#title' => $this->t('HTTP authentication'), '#description' => $this->t('HTTP auth settings to be used by the SimpleTest browser during testing. Useful when the site requires basic HTTP authentication.'), - '#collapsed' => TRUE, ); $form['httpauth']['simpletest_httpauth_method'] = array( '#type' => 'select', diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php index 7d7a8c5..c6c4148 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php @@ -49,6 +49,7 @@ public function buildForm(array $form, array &$form_state) { '#type' => 'details', '#title' => $this->t('Tests'), '#description' => $this->t('Select the test(s) or test group(s) you would like to run, and click Run tests.'), + '#open' => TRUE, ); $form['tests']['table'] = array( @@ -61,10 +62,6 @@ public function buildForm(array $form, array &$form_state) { $form_state['storage']['PHPUnit'] = $groups['PHPUnit']; foreach ($groups as $group => $tests) { - $form['tests']['table'][$group] = array( - '#collapsed' => TRUE, - ); - foreach ($tests as $class => $info) { $form['tests']['table'][$group][$class] = array( '#type' => 'checkbox', diff --git a/core/modules/simpletest/simpletest.theme.inc b/core/modules/simpletest/simpletest.theme.inc index 4ee0261..a1bd055 100644 --- a/core/modules/simpletest/simpletest.theme.inc +++ b/core/modules/simpletest/simpletest.theme.inc @@ -64,8 +64,8 @@ function theme_simpletest_test_table($variables) { // Select the right "expand"/"collapse" image, depending on whether the // category is expanded (at least one test selected) or not. - $collapsed = !empty($element['#collapsed']); - $image_index = $collapsed ? 0 : 1; + $open = !empty($element['#open']); + $image_index = $open ? 1 : 0; // Place-holder for checkboxes to select group of tests. $row[] = array('id' => $test_class, 'class' => array('simpletest-select-all')); @@ -125,7 +125,7 @@ function theme_simpletest_test_table($variables) { 'class' => array('simpletest-test-description', 'table-filter-text-source'), ); - $rows[] = array('data' => $row, 'class' => array($test_class . '-test', ($collapsed ? 'js-hide' : ''))); + $rows[] = array('data' => $row, 'class' => array($test_class . '-test', ($open ? 'js-hide' : ''))); } $js['simpletest-test-group-' . $test_class] = $current_js; unset($table[$key]); diff --git a/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php b/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php index 437946f..0461d59 100644 --- a/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php +++ b/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php @@ -68,6 +68,7 @@ public function buildForm(array $form, array &$form_state) { $form['content'] = array( '#type' => 'details', '#title' => t('Content viewing counter settings'), + '#open' => TRUE, ); $form['content']['statistics_count_content_views'] = array( '#type' => 'checkbox', diff --git a/core/modules/system/lib/Drupal/system/Form/CronForm.php b/core/modules/system/lib/Drupal/system/Form/CronForm.php index 12802e4..84bd4b3 100644 --- a/core/modules/system/lib/Drupal/system/Form/CronForm.php +++ b/core/modules/system/lib/Drupal/system/Form/CronForm.php @@ -86,6 +86,7 @@ public function buildForm(array $form, array &$form_state) { $form['cron'] = array( '#title' => t('Cron settings'), '#type' => 'details', + '#open' => TRUE, ); $form['cron']['cron_safe_threshold'] = array( '#type' => 'select', diff --git a/core/modules/system/lib/Drupal/system/Form/ImageToolkitForm.php b/core/modules/system/lib/Drupal/system/Form/ImageToolkitForm.php index dcdb2cc..1a14aa4 100644 --- a/core/modules/system/lib/Drupal/system/Form/ImageToolkitForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ImageToolkitForm.php @@ -82,8 +82,7 @@ public function buildForm(array $form, array &$form_state) { $form['image_toolkit_settings'][$id] = array( '#type' => 'fieldset', '#title' => t('@toolkit settings', array('@toolkit' => $definition['title'])), - '#collapsible' => TRUE, - '#collapsed' => ($id == $current_toolkit) ? FALSE : TRUE, + '#open' => ($id == $current_toolkit), '#tree' => TRUE, ); $form['image_toolkit_settings'][$id] += $toolkit->settingsForm(); diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php index 28836dd..2d75d50 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php @@ -115,6 +115,7 @@ public function buildForm(array $form, array &$form_state) { $form['modules'][$package] += array( '#type' => 'details', '#title' => $this->t($package), + '#open' => TRUE, '#theme' => 'system_modules_details', '#header' => array( array('data' => '' . $this->t('Installed') . '', 'class' => array('checkbox')), diff --git a/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php b/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php index 8ae0382..618f6b5 100644 --- a/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php +++ b/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php @@ -69,6 +69,7 @@ public function buildForm(array $form, array &$form_state) { $form['clear_cache'] = array( '#type' => 'details', '#title' => t('Clear cache'), + '#open' => TRUE, ); $form['clear_cache']['clear'] = array( @@ -80,6 +81,7 @@ public function buildForm(array $form, array &$form_state) { $form['caching'] = array( '#type' => 'details', '#title' => t('Caching'), + '#open' => TRUE, ); $period = drupal_map_assoc(array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 86400), 'format_interval'); @@ -111,6 +113,7 @@ public function buildForm(array $form, array &$form_state) { '#type' => 'details', '#title' => t('Bandwidth optimization'), '#description' => t('External resources can be optimized automatically, which can reduce both the size and number of requests made to your website.') . $disabled_message, + '#open' => TRUE, ); $js_hide = ($config->get('cache.page.max_age') > 0) ? '' : ' class="js-hide"'; diff --git a/core/modules/system/lib/Drupal/system/Form/RegionalForm.php b/core/modules/system/lib/Drupal/system/Form/RegionalForm.php index 569a5c6..26c10c0 100644 --- a/core/modules/system/lib/Drupal/system/Form/RegionalForm.php +++ b/core/modules/system/lib/Drupal/system/Form/RegionalForm.php @@ -71,6 +71,7 @@ public function buildForm(array $form, array &$form_state) { $form['locale'] = array( '#type' => 'details', '#title' => t('Locale'), + '#open' => TRUE, ); $form['locale']['site_default_country'] = array( @@ -92,6 +93,7 @@ public function buildForm(array $form, array &$form_state) { $form['timezone'] = array( '#type' => 'details', '#title' => t('Time zones'), + '#open' => TRUE, ); $form['timezone']['date_default_timezone'] = array( diff --git a/core/modules/system/lib/Drupal/system/Form/SiteInformationForm.php b/core/modules/system/lib/Drupal/system/Form/SiteInformationForm.php index 1b5029b..4ae4ae3 100644 --- a/core/modules/system/lib/Drupal/system/Form/SiteInformationForm.php +++ b/core/modules/system/lib/Drupal/system/Form/SiteInformationForm.php @@ -72,6 +72,7 @@ public function buildForm(array $form, array &$form_state) { $form['site_information'] = array( '#type' => 'details', '#title' => t('Site details'), + '#open' => TRUE, ); $form['site_information']['site_name'] = array( '#type' => 'textfield', @@ -95,6 +96,7 @@ public function buildForm(array $form, array &$form_state) { $form['front_page'] = array( '#type' => 'details', '#title' => t('Front page'), + '#open' => TRUE, ); $front_page = $site_config->get('page.front') != 'user' ? $this->aliasManager->getPathAlias($site_config->get('page.front')) : ''; $form['front_page']['site_frontpage'] = array( @@ -108,6 +110,7 @@ public function buildForm(array $form, array &$form_state) { $form['error_page'] = array( '#type' => 'details', '#title' => t('Error pages'), + '#open' => TRUE, ); $form['error_page']['site_403'] = array( '#type' => 'textfield', diff --git a/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php b/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php index 44b34fe..5aa62aa 100644 --- a/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php @@ -127,6 +127,7 @@ public function buildForm(array $form, array &$form_state, $theme_name = '') { '#type' => 'details', '#title' => t('Toggle display'), '#description' => t('Enable or disable the display of certain page elements.'), + '#open' => TRUE, ); foreach ($toggles as $name => $title) { if ((!$theme_name) || in_array($name, $features)) { @@ -150,6 +151,7 @@ public function buildForm(array $form, array &$form_state, $theme_name = '') { '#type' => 'details', '#title' => t('Logo image settings'), '#attributes' => array('class' => array('theme-settings-bottom')), + '#open' => TRUE, '#states' => array( // Hide the logo image settings fieldset when logo display is disabled. 'invisible' => array( @@ -190,6 +192,7 @@ public function buildForm(array $form, array &$form_state, $theme_name = '') { '#type' => 'details', '#title' => t('Shortcut icon settings'), '#description' => t("Your shortcut icon, or 'favicon', is displayed in the address bar and bookmarks of most browsers."), + '#open' => TRUE, '#states' => array( // Hide the shortcut icon settings fieldset when shortcut icon display // is disabled. @@ -266,6 +269,7 @@ public function buildForm(array $form, array &$form_state, $theme_name = '') { '#type' => 'details', '#title' => t('Theme-engine-specific settings'), '#description' => t('These settings only exist for the themes based on the %engine theme engine.', array('%engine' => $themes[$theme_name]->prefix)), + '#open' => TRUE, ); $function($form, $form_state); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php index 4a871d5..eb1e7f2 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php @@ -337,6 +337,7 @@ function testDrupalRenderChildrenAttached() { $subchild_js = drupal_get_path('module', 'book') . '/book.js'; $element = array( '#type' => 'details', + '#open' => TRUE, '#cache' => array( 'keys' => array('simpletest', 'drupal_render', 'children_attached'), ), @@ -345,6 +346,7 @@ function testDrupalRenderChildrenAttached() { ); $element['child'] = array( '#type' => 'details', + '#open' => TRUE, '#attached' => array('js' => array($child_js)), '#title' => 'Child', ); @@ -484,6 +486,7 @@ function testDrupalRenderFormElements() { $element = array( '#type' => 'details', '#title' => $this->randomName(), + '#open' => TRUE, ); $this->assertRenderedElement($element, '//details/summary[contains(., :title)]', array( ':title' => $element['#title'], @@ -492,6 +495,7 @@ function testDrupalRenderFormElements() { $element = array( '#type' => 'details', '#title' => $this->randomName(), + '#open' => TRUE, ); $this->assertRenderedElement($element, '//details'); diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index f1a428f..426058c 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -161,6 +161,7 @@ function system_themes_admin_form($form, &$form_state, $theme_options) { $form['admin_theme'] = array( '#type' => 'details', '#title' => t('Administration theme'), + '#open' => TRUE, ); $form['admin_theme']['admin_theme'] = array( '#type' => 'select', @@ -591,7 +592,6 @@ function theme_system_modules_details($variables) { '#title' => ' ' . drupal_render($module['description']) . '', '#attributes' => array('id' => $module['enable']['#id'] . '-description'), '#description' => $description, - '#collapsed' => TRUE, ); $col4 = drupal_render($details); $row[] = array('class' => array('description', 'expand'), 'data' => $col4); diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 8437e4c..e5aec32 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -545,7 +545,7 @@ function system_element_info() { '#theme_wrappers' => array('fieldset'), ); $types['details'] = array( - '#collapsed' => FALSE, + '#open' => FALSE, '#value' => NULL, '#process' => array('form_process_group', 'ajax_process_form'), '#pre_render' => array('form_pre_render_details', 'form_pre_render_group'), @@ -2280,6 +2280,7 @@ function system_user_timezone(&$form, &$form_state) { '#type' => 'details', '#title' => t('Locale settings'), '#weight' => 6, + '#open' => TRUE, ); $form['timezone']['timezone'] = array( '#type' => 'select', diff --git a/core/modules/system/tests/modules/design_test/form/details.inc b/core/modules/system/tests/modules/design_test/form/details.inc index 60d153a..a5df90f 100644 --- a/core/modules/system/tests/modules/design_test/form/details.inc +++ b/core/modules/system/tests/modules/design_test/form/details.inc @@ -13,7 +13,7 @@ function design_test_form_details($form, &$form_state) { '#type' => 'details', '#title' => 'Collapsible details', '#description' => 'Details description', - '#collapsed' => FALSE, + '#open' => TRUE, '#states' => array( 'collapsed' => array( ':input[name="states-trigger"]' => array('checked' => TRUE), @@ -25,7 +25,6 @@ function design_test_form_details($form, &$form_state) { '#type' => 'details', '#title' => 'Collapsed details', '#description' => 'Details description', - '#collapsed' => TRUE, ); $form['collapsed']['textfield'] = array( '#type' => 'textfield', @@ -46,30 +45,30 @@ function design_test_form_details($form, &$form_state) { '#type' => 'details', '#title' => 'Details', '#description' => 'Details description', - '#collapsed' => TRUE, ); $form['collapsed2']['collapsible'] = array( '#type' => 'details', '#title' => 'Collapsible details', '#description' => 'Details description', - '#collapsed' => FALSE, + '#open' => TRUE, ); $form['collapsed2']['collapsed'] = array( '#type' => 'details', '#title' => 'Collapsed details', '#description' => 'Details description', - '#collapsed' => TRUE, ); $form['collapsed2']['regular'] = array( '#type' => 'details', '#title' => 'Details', '#description' => 'Details description', + '#open' => TRUE, ); $form['regular'] = array( '#type' => 'details', '#title' => 'Details', '#description' => 'Details description', + '#open' => TRUE, ); #$form['#attributes'] = array('class' => array('search-form')); @@ -77,6 +76,7 @@ function design_test_form_details($form, &$form_state) { '#type' => 'details', '#title' => 'Filter aliases', '#attributes' => array('class' => array('container-inline')), + '#open' => TRUE, ); $form['basic']['filter'] = array( '#type' => 'textfield', @@ -114,6 +114,7 @@ function design_test_form_details($form, &$form_state) { '#title' => 'Vertical tab 1', '#description' => 'Description', '#group' => 'group', + '#open' => TRUE, ); $form['tabs'][0] += $subform; @@ -122,6 +123,7 @@ function design_test_form_details($form, &$form_state) { '#title' => 'Vertical tab 2', '#description' => 'Description
Description
', '#group' => 'group', + '#open' => TRUE, ); $form['tabs'][1] += $subform; @@ -135,6 +137,7 @@ function design_test_form_details($form, &$form_state) { '#title' => 'Vertical tab 1', '#description' => 'Description', '#group' => 'subgroup', + '#open' => TRUE, ); $form['subtabs'][0] += $subform; @@ -143,6 +146,7 @@ function design_test_form_details($form, &$form_state) { '#title' => 'Vertical tab 2', '#description' => 'Description
Description
', '#group' => 'subgroup', + '#open' => TRUE, ); $form['subtabs'][1] += $subform; diff --git a/core/modules/system/tests/modules/design_test/form/fieldset.inc b/core/modules/system/tests/modules/design_test/form/fieldset.inc index f55bfe5..3b953aa 100644 --- a/core/modules/system/tests/modules/design_test/form/fieldset.inc +++ b/core/modules/system/tests/modules/design_test/form/fieldset.inc @@ -19,7 +19,7 @@ function design_test_form_fieldset($form, &$form_state) { '#type' => 'details', '#title' => 'Collapsible details', '#description' => 'Details description', - '#collapsed' => FALSE, + '#open' => TRUE, ); $form['collapsible']['fieldset'] = array( '#type' => 'fieldset', @@ -40,7 +40,6 @@ function design_test_form_fieldset($form, &$form_state) { $form['collapsed'] = $form['collapsible']; $form['collapsed']['#title'] = 'Collapsed details'; - $form['collapsed']['#collapsed'] = TRUE; $form['nested'] = $form['regular']; $form['nested']['#title'] = 'Parent fieldset'; @@ -59,6 +58,7 @@ function design_test_form_fieldset($form, &$form_state) { '#title' => 'Vertical tab 1', '#description' => 'Description', '#group' => 'group', + '#open' => TRUE, ); $form['tabs'][0] += $subform; @@ -67,6 +67,7 @@ function design_test_form_fieldset($form, &$form_state) { '#title' => 'Vertical tab 2', '#description' => 'Description
Description
', '#group' => 'group', + '#open' => TRUE, ); $form['tabs'][1] += $subform; @@ -80,6 +81,7 @@ function design_test_form_fieldset($form, &$form_state) { '#title' => 'Vertical tab 1', '#description' => 'Description', '#group' => 'subgroup', + '#open' => TRUE, ); $form['subtabs'][0] += $subform; @@ -88,6 +90,7 @@ function design_test_form_fieldset($form, &$form_state) { '#title' => 'Vertical tab 2', '#description' => 'Description
Description
', '#group' => 'subgroup', + '#open' => TRUE, ); $form['subtabs'][1] += $subform; 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 5b34e1b..6cf453e 100644 --- a/core/modules/system/tests/modules/form_test/form_test.module +++ b/core/modules/system/tests/modules/form_test/form_test.module @@ -845,7 +845,8 @@ function _form_test_vertical_tabs_form($form, &$form_state) { '#type' => 'details', '#title' => t('Tab 1'), '#group' => 'vertical_tabs', - '#access' => user_access('access vertical_tab_test tabs') + '#access' => user_access('access vertical_tab_test tabs'), + '#open' => TRUE, ); $form['tab1']['field1'] = array( '#title' => t('Field 1'), @@ -855,7 +856,8 @@ function _form_test_vertical_tabs_form($form, &$form_state) { '#type' => 'details', '#title' => t('Tab 2'), '#group' => 'vertical_tabs', - '#access' => user_access('access vertical_tab_test tabs') + '#access' => user_access('access vertical_tab_test tabs'), + '#open' => TRUE, ); $form['tab2']['field2'] = array( '#title' => t('Field 2'), @@ -2386,11 +2388,13 @@ function form_test_group_details() { $form['details'] = array( '#type' => 'details', '#title' => 'Root element', + '#open' => TRUE, ); $form['meta'] = array( '#type' => 'details', '#title' => 'Group element', '#group' => 'details', + '#open' => TRUE, ); $form['meta']['element'] = array( '#type' => 'textfield', @@ -2410,6 +2414,7 @@ function form_test_group_container() { '#type' => 'details', '#title' => 'Group element', '#group' => 'container', + '#open' => TRUE, ); $form['meta']['element'] = array( '#type' => 'textfield', @@ -2449,6 +2454,7 @@ function form_test_group_vertical_tabs() { '#type' => 'details', '#title' => 'First group element', '#group' => 'vertical_tabs', + '#open' => TRUE, ); $form['meta']['element'] = array( '#type' => 'textfield', @@ -2458,6 +2464,7 @@ function form_test_group_vertical_tabs() { '#type' => 'details', '#title' => 'Second group element', '#group' => 'vertical_tabs', + '#open' => TRUE, ); $form['meta_2']['element_2'] = array( '#type' => 'textfield', diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php index b6bbb41..c4c55d0 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php @@ -94,7 +94,7 @@ public function form(array $form, array &$form_state) { $form['relations'] = array( '#type' => 'details', '#title' => $this->t('Relations'), - '#collapsed' => ($vocabulary->hierarchy != TAXONOMY_HIERARCHY_MULTIPLE), + '#open' => ($vocabulary->hierarchy == TAXONOMY_HIERARCHY_MULTIPLE), '#weight' => 10, ); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php index 0a1537b..72710b6 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php @@ -57,6 +57,7 @@ public function form(array $form, array &$form_state) { $form['default_terms_language'] = array( '#type' => 'details', '#title' => $this->t('Terms language'), + '#open' => TRUE, ); $form['default_terms_language']['default_language'] = array( '#type' => 'language_configuration', diff --git a/core/modules/translation/translation.module b/core/modules/translation/translation.module index bd1bf31..602bf0a 100644 --- a/core/modules/translation/translation.module +++ b/core/modules/translation/translation.module @@ -215,7 +215,7 @@ function translation_form_node_form_alter(&$form, &$form_state) { '#type' => 'details', '#title' => t('Translation settings'), '#access' => translation_user_can_translate_node($node), - '#collapsed' => !$node->translate->value, + '#open' => $node->translate->value, '#tree' => TRUE, '#weight' => 30, ); diff --git a/core/modules/user/lib/Drupal/user/AccountFormController.php b/core/modules/user/lib/Drupal/user/AccountFormController.php index 138b86e..6748af4 100644 --- a/core/modules/user/lib/Drupal/user/AccountFormController.php +++ b/core/modules/user/lib/Drupal/user/AccountFormController.php @@ -167,6 +167,7 @@ public function form(array $form, array &$form_state) { '#title' => $this->t('Signature settings'), '#weight' => 1, '#access' => (!$register && $config->get('signatures')), + '#open' => TRUE, ); $form['signature_settings']['signature'] = array( @@ -190,6 +191,7 @@ public function form(array $form, array &$form_state) { // Display language selector when either creating a user on the admin // interface or editing a user account. '#access' => !$register || user_access('administer users'), + '#open' => TRUE, ); $form['language']['preferred_langcode'] = array( diff --git a/core/modules/user/lib/Drupal/user/AccountSettingsForm.php b/core/modules/user/lib/Drupal/user/AccountSettingsForm.php index e8077d3..01ba636 100644 --- a/core/modules/user/lib/Drupal/user/AccountSettingsForm.php +++ b/core/modules/user/lib/Drupal/user/AccountSettingsForm.php @@ -70,6 +70,7 @@ public function buildForm(array $form, array &$form_state) { $form['anonymous_settings'] = array( '#type' => 'details', '#title' => $this->t('Anonymous users'), + '#open' => TRUE, ); $form['anonymous_settings']['anonymous'] = array( '#type' => 'textfield', @@ -83,6 +84,7 @@ public function buildForm(array $form, array &$form_state) { $form['admin_role'] = array( '#type' => 'details', '#title' => $this->t('Administrator role'), + '#open' => TRUE, ); // Do not allow users to set the anonymous or authenticated user roles as the // administrator role. @@ -103,6 +105,7 @@ public function buildForm(array $form, array &$form_state) { '#type' => 'details', '#title' => $this->t('Language settings'), '#tree' => TRUE, + '#open' => TRUE, ); $form_state['content_translation']['key'] = 'language'; $form['language'] += content_translation_enable_widget('user', 'user', $form, $form_state); @@ -112,6 +115,7 @@ public function buildForm(array $form, array &$form_state) { $form['registration_cancellation'] = array( '#type' => 'details', '#title' => $this->t('Registration and cancellation'), + '#open' => TRUE, ); $form['registration_cancellation']['user_register'] = array( '#type' => 'radios', @@ -154,6 +158,7 @@ public function buildForm(array $form, array &$form_state) { $form['personalization'] = array( '#type' => 'details', '#title' => $this->t('Personalization'), + '#open' => TRUE, ); $form['personalization']['user_signatures'] = array( '#type' => 'checkbox', @@ -181,7 +186,7 @@ public function buildForm(array $form, array &$form_state) { $form['email_admin_created'] = array( '#type' => 'details', '#title' => $this->t('Welcome (new user created by administrator)'), - '#collapsed' => ($config->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY), + '#open' => ($config->get('register') == USER_REGISTER_ADMINISTRATORS_ONLY), '#description' => $this->t('Edit the welcome e-mail messages sent to new member accounts created by an administrator.') . ' ' . $email_token_help, '#group' => 'email', ); @@ -201,7 +206,7 @@ public function buildForm(array $form, array &$form_state) { $form['email_pending_approval'] = array( '#type' => 'details', '#title' => $this->t('Welcome (awaiting approval)'), - '#collapsed' => ($config->get('register') != USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL), + '#open' => ($config->get('register') == USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL), '#description' => $this->t('Edit the welcome e-mail messages sent to new members upon registering, when administrative approval is required.') . ' ' . $email_token_help, '#group' => 'email', ); @@ -221,7 +226,7 @@ public function buildForm(array $form, array &$form_state) { $form['email_pending_approval_admin'] = array( '#type' => 'details', '#title' => $this->t('Admin (user awaiting approval)'), - '#collapsed' => ($config->get('register') != USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL), + '#open' => ($config->get('register') == USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL), '#description' => $this->t('Edit the e-mail notifying the site administrator that there are new members awaiting administrative approval.') . ' ' . $email_token_help, '#group' => 'email', ); @@ -241,7 +246,7 @@ public function buildForm(array $form, array &$form_state) { $form['email_no_approval_required'] = array( '#type' => 'details', '#title' => $this->t('Welcome (no approval required)'), - '#collapsed' => ($config->get('register') != USER_REGISTER_VISITORS), + '#open' => ($config->get('register') == USER_REGISTER_VISITORS), '#description' => $this->t('Edit the welcome e-mail messages sent to new members upon registering, when no administrator approval is required.') . ' ' . $email_token_help, '#group' => 'email', ); @@ -261,7 +266,6 @@ public function buildForm(array $form, array &$form_state) { $form['email_password_reset'] = array( '#type' => 'details', '#title' => $this->t('Password recovery'), - '#collapsed' => TRUE, '#description' => $this->t('Edit the e-mail messages sent to users who request a new password.') . ' ' . $email_token_help, '#group' => 'email', '#weight' => 10, @@ -282,7 +286,6 @@ public function buildForm(array $form, array &$form_state) { $form['email_activated'] = array( '#type' => 'details', '#title' => $this->t('Account activation'), - '#collapsed' => TRUE, '#description' => $this->t('Enable and edit e-mail messages sent to users upon account activation (when an administrator activates an account of a user who has already registered, on a site where administrative approval is required).') . ' ' . $email_token_help, '#group' => 'email', ); @@ -316,7 +319,6 @@ public function buildForm(array $form, array &$form_state) { $form['email_blocked'] = array( '#type' => 'details', '#title' => $this->t('Account blocked'), - '#collapsed' => TRUE, '#description' => $this->t('Enable and edit e-mail messages sent to users when their accounts are blocked.') . ' ' . $email_token_help, '#group' => 'email', ); @@ -350,7 +352,6 @@ public function buildForm(array $form, array &$form_state) { $form['email_cancel_confirm'] = array( '#type' => 'details', '#title' => $this->t('Account cancellation confirmation'), - '#collapsed' => TRUE, '#description' => $this->t('Edit the e-mail messages sent to users when they attempt to cancel their accounts.') . ' ' . $email_token_help, '#group' => 'email', ); @@ -370,7 +371,6 @@ public function buildForm(array $form, array &$form_state) { $form['email_canceled'] = array( '#type' => 'details', '#title' => $this->t('Account canceled'), - '#collapsed' => TRUE, '#description' => $this->t('Enable and edit e-mail messages sent to users when their accounts are canceled.') . ' ' . $email_token_help, '#group' => 'email', ); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php index 5912c76..8da0827 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php @@ -303,7 +303,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['admin_label'] = array( '#type' => 'details', '#title' => t('Administrative title'), - '#collapsed' => TRUE, '#weight' => 150, ); $form['admin_label']['admin_label'] = array( @@ -319,7 +318,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['more'] = array( '#type' => 'details', '#title' => t('More'), - '#collapsed' => TRUE, '#weight' => 200, ); // Allow to alter the default values brought into the form. diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php index a261315..8ec9d3d 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php @@ -353,7 +353,6 @@ public function globalTokenForm(&$form, &$form_state) { $form['global_tokens'] = array( '#type' => 'details', '#title' => t('Available global token replacements'), - '#collapsed' => TRUE, ); $form['global_tokens']['list'] = array( '#theme' => 'item_list', 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 0b0f992..c30867d 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 @@ -176,6 +176,7 @@ public function buildOptionsForm(&$form, &$form_state) { $form['no_argument'] = array( '#type' => 'details', '#title' => $argument_text['filter value not present'], + '#open' => TRUE, ); // Everything in the details is floated, so the last element needs to // clear those floats. @@ -195,7 +196,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['exception'] = array( '#type' => 'details', '#title' => t('Exceptions'), - '#collapsed' => TRUE, '#fieldset' => 'no_argument', ); $form['exception']['value'] = array( @@ -241,6 +241,7 @@ public function buildOptionsForm(&$form, &$form_state) { $form['argument_present'] = array( '#type' => 'details', '#title' => $argument_text['filter value present'], + '#open' => TRUE, ); $form['title_enable'] = array( '#type' => 'checkbox', diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php index 25c28a8..23f7c85 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php @@ -536,7 +536,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['style_settings'] = array( '#type' => 'details', '#title' => t('Style settings'), - '#collapsed' => TRUE, '#weight' => 99, ); @@ -685,7 +684,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['alter'] = array( '#title' => t('Rewrite results'), '#type' => 'details', - '#collapsed' => TRUE, '#weight' => 100, ); @@ -886,7 +884,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['alter']['help'] = array( '#type' => 'details', '#title' => t('Replacement patterns'), - '#collapsed' => TRUE, '#value' => $output, '#states' => array( 'visible' => array( @@ -1025,7 +1022,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['empty_field_behavior'] = array( '#type' => 'details', '#title' => t('No results behavior'), - '#collapsed' => TRUE, '#weight' => 100, ); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/pager/SqlBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/pager/SqlBase.php index 1e6ab81..f794863 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/pager/SqlBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/pager/SqlBase.php @@ -75,7 +75,7 @@ public function buildOptionsForm(&$form, &$form_state) { $form['tags'] = array( '#type' => 'details', - '#collapsed' => FALSE, + '#open' => TRUE, '#tree' => TRUE, '#title' => t('Pager link labels'), '#input' => TRUE, @@ -95,7 +95,7 @@ public function buildOptionsForm(&$form, &$form_state) { $form['expose'] = array( '#type' => 'details', - '#collapsed' => FALSE, + '#open' => TRUE, '#tree' => TRUE, '#title' => t('Exposed options'), '#input' => TRUE, diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/row/RssFields.php b/core/modules/views/lib/Drupal/views/Plugin/views/row/RssFields.php index a9571d1..9efd1ce 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/row/RssFields.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/row/RssFields.php @@ -92,7 +92,7 @@ public function buildOptionsForm(&$form, &$form_state) { $form['guid_field_options'] = array( '#type' => 'details', '#title' => t('GUID settings'), - '#collapsed' => FALSE, + '#open' => TRUE, ); $form['guid_field_options']['guid_field'] = array( '#type' => 'select', 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 121047a..7c1c80a 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 @@ -255,7 +255,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['accessibility_details'] = array( '#type' => 'details', '#title' => t('Table details'), - '#collapsed' => TRUE, ); $form['summary'] = array( diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/AdvancedSettingsForm.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/AdvancedSettingsForm.php index fd77d5e..5eebba1 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/AdvancedSettingsForm.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/AdvancedSettingsForm.php @@ -31,6 +31,7 @@ public function buildForm(array $form, array &$form_state) { $form['cache'] = array( '#type' => 'details', '#title' => $this->t('Caching'), + '#open' => TRUE, ); $form['cache']['skip_cache'] = array( @@ -49,6 +50,7 @@ public function buildForm(array $form, array &$form_state) { $form['debug'] = array( '#type' => 'details', '#title' => $this->t('Debugging'), + '#open' => TRUE, ); $form['debug']['sql_signature'] = 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 d1206d5..0518a07 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 @@ -70,6 +70,7 @@ public function buildForm(array $form, array &$form_state) { $form['live_preview'] = array( '#type' => 'details', '#title' => $this->t('Live preview settings'), + '#open' => TRUE, ); $form['live_preview']['ui_always_live_preview'] = array( diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php index 09f178d..9c283cb 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -490,7 +490,6 @@ public function getDisplayDetails($view, $display) { $build['columns']['third'] = array( '#type' => 'details', '#title' => $this->t('Advanced'), - '#collapsed' => TRUE, '#theme_wrappers' => array('details'), '#attributes' => array( 'class' => array( @@ -501,9 +500,7 @@ public function getDisplayDetails($view, $display) { ); // Collapse the details by default. - if (\Drupal::config('views.settings')->get('ui.show.advanced_column')) { - $build['columns']['third']['#collapsed'] = FALSE; - } + $build['columns']['third']['#open'] = \Drupal::config('views.settings')->get('ui.show.advanced_column'); // Each option (e.g. title, access, display as grid/table/list) fits into one // of several "buckets," or boxes (Format, Fields, Sort, and so on). diff --git a/core/update.php b/core/update.php index db92c1a..c15b9fc 100644 --- a/core/update.php +++ b/core/update.php @@ -70,7 +70,6 @@ function update_script_selection_form($form, &$form_state) { $form['start'] = array( '#tree' => TRUE, '#type' => 'details', - '#collapsed' => TRUE, ); // Ensure system.module's updates appear first.