diff --git a/core/includes/form.inc b/core/includes/form.inc index 5cd3bdbae..eddf394 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -1004,7 +1004,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 @@ -1071,7 +1071,7 @@ function theme_fieldset($variables) { * @param array $variables * An associative array containing: * - element: An associative array containing the properties of the element. - * Properties used: #attributes, #children, #collapsed, #collapsible, + * Properties used: #attributes, #children, #open, * #description, #id, #title, #value, #optional. * * @ingroup themeable @@ -1085,7 +1085,7 @@ function template_preprocess_details(&$variables) { if (!empty($element['#attributes']['id'])) { $variables['summary_attributes']['aria-controls'] = $element['#attributes']['id']; } - $variables['summary_attributes']['aria-expanded'] = empty($element['#attributes']['open']) ? FALSE : TRUE; + $variables['summary_attributes']['aria-expanded'] = !empty($element['#attributes']['open']); $variables['summary_attributes']['aria-pressed'] = $variables['summary_attributes']['aria-expanded']; } $variables['title'] = (!empty($element['#title'])) ? $element['#title'] : ''; @@ -2063,7 +2063,7 @@ function form_pre_render_details($element) { // Collapsible details. $element['#attached']['library'][] = array('system', 'drupal.collapse'); - if (empty($element['#collapsed'])) { + if (!empty($element['#open'])) { $element['#attributes']['open'] = 'open'; } diff --git a/core/lib/Drupal/Core/Database/Install/Tasks.php b/core/lib/Drupal/Core/Database/Install/Tasks.php index 0f66af6..41ba2db 100644 --- a/core/lib/Drupal/Core/Database/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Install/Tasks.php @@ -247,7 +247,6 @@ public function getFormOptions(array $database) { $form['advanced_options'] = array( '#type' => 'details', '#title' => t('Advanced options'), - '#collapsed' => TRUE, '#weight' => 10, ); diff --git a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php index fae7d5b..415e9ff 100644 --- a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php +++ b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php @@ -405,7 +405,6 @@ public function getSettingsForm() { $form['advanced'] = array( '#type' => 'details', '#title' => t('Advanced settings'), - '#collapsed' => TRUE, ); $form['advanced']['hostname'] = array( '#type' => 'textfield', diff --git a/core/lib/Drupal/Core/Update/Form/UpdateScriptSelectionForm.php b/core/lib/Drupal/Core/Update/Form/UpdateScriptSelectionForm.php index ce01146..b6d440d 100644 --- a/core/lib/Drupal/Core/Update/Form/UpdateScriptSelectionForm.php +++ b/core/lib/Drupal/Core/Update/Form/UpdateScriptSelectionForm.php @@ -30,7 +30,6 @@ public function buildForm(array $form, array &$form_state) { $form['start'] = array( '#tree' => TRUE, '#type' => 'details', - '#collapsed' => TRUE, ); // Ensure system.module's updates appear first. diff --git a/core/modules/action/lib/Drupal/action/Form/ActionAdminManageForm.php b/core/modules/action/lib/Drupal/action/Form/ActionAdminManageForm.php index e44a7f8..fd1a0d0 100644 --- a/core/modules/action/lib/Drupal/action/Form/ActionAdminManageForm.php +++ b/core/modules/action/lib/Drupal/action/Form/ActionAdminManageForm.php @@ -65,6 +65,7 @@ public function buildForm(array $form, array &$form_state) { '#type' => 'details', '#title' => $this->t('Create an advanced action'), '#attributes' => array('class' => array('container-inline')), + '#open' => TRUE, ); $form['parent']['action'] = array( '#type' => 'select', diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Form/SettingsForm.php b/core/modules/aggregator/lib/Drupal/aggregator/Form/SettingsForm.php index 8470858..29376bc 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Form/SettingsForm.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Form/SettingsForm.php @@ -145,7 +145,7 @@ public function buildForm(array $form, array &$form_state) { '#type' => 'details', '#title' => $this->t('Basic configuration'), '#description' => $this->t('For most aggregation tasks, the default settings are fine.'), - '#collapsed' => FALSE, + '#open' => TRUE, ); $form['basic_conf'] += $basic_conf; } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php index 77fa921..46692dd 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php @@ -83,7 +83,7 @@ public function buildConfigurationForm(array $form, array &$form_state) { '#type' => 'details', '#title' => t('Default processor settings'), '#description' => $info['description'], - '#collapsed' => !in_array($info['id'], $processors), + '#open' => in_array($info['id'], $processors), ); } diff --git a/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php b/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php index 6fc9479..798be1a 100644 --- a/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php +++ b/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php @@ -74,7 +74,7 @@ public function buildConfigurationForm(array $form, array &$form_state) { '#type' => 'details', '#title' => t('Test processor settings'), '#description' => $info['description'], - '#collapsed' => !in_array($info['id'], $processors), + '#open' => in_array($info['id'], $processors), ); // Add some dummy settings to verify settingsForm is called. $form['processors'][$info['id']]['dummy_length'] = array( diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php index e67b354..4ad8ba9 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php @@ -134,9 +134,8 @@ public function form(array $form, array &$form_state) { $form['revision_information'] = array( '#type' => 'details', '#title' => $this->t('Revision information'), - '#collapsible' => TRUE, - // Collapsed by default when "Create new revision" is unchecked. - '#collapsed' => !$block->isNewRevision(), + // Open by default when "Create new revision" is checked. + '#open' => $block->isNewRevision(), '#group' => 'advanced', '#attributes' => array( 'class' => array('custom-block-form-revision-information'), diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php index d2ab376..10dea1c 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php @@ -57,8 +57,6 @@ public function form(array $form, array &$form_state) { $form['language'] = array( '#type' => 'details', '#title' => t('Language settings'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, '#group' => 'additional_settings', ); diff --git a/core/modules/block/lib/Drupal/block/BlockFormController.php b/core/modules/block/lib/Drupal/block/BlockFormController.php index 3419afc..b70575d 100644 --- a/core/modules/block/lib/Drupal/block/BlockFormController.php +++ b/core/modules/block/lib/Drupal/block/BlockFormController.php @@ -127,7 +127,6 @@ public function form(array $form, array &$form_state) { $form['visibility']['path'] = array( '#type' => 'details', '#title' => $this->t('Pages'), - '#collapsed' => TRUE, '#group' => 'visibility', '#weight' => 0, ); @@ -183,7 +182,6 @@ public function form(array $form, array &$form_state) { $form['visibility']['language'] = array( '#type' => 'details', '#title' => $this->t('Languages'), - '#collapsed' => TRUE, '#group' => 'visibility', '#weight' => 5, ); @@ -216,7 +214,6 @@ public function form(array $form, array &$form_state) { $form['visibility']['role'] = array( '#type' => 'details', '#title' => $this->t('Roles'), - '#collapsed' => TRUE, '#group' => 'visibility', '#weight' => 10, ); diff --git a/core/modules/block/lib/Drupal/block/BlockListController.php b/core/modules/block/lib/Drupal/block/BlockListController.php index 89a6191..fa58486 100644 --- a/core/modules/block/lib/Drupal/block/BlockListController.php +++ b/core/modules/block/lib/Drupal/block/BlockListController.php @@ -348,6 +348,7 @@ public function buildForm(array $form, array &$form_state) { $form['place_blocks']['list'][$category_key] = array( '#type' => 'details', '#title' => $category, + '#open' => TRUE, 'content' => array( '#theme' => 'links', '#links' => array(), diff --git a/core/modules/book/lib/Drupal/book/BookManager.php b/core/modules/book/lib/Drupal/book/BookManager.php index 077dab7..ff3f998 100644 --- a/core/modules/book/lib/Drupal/book/BookManager.php +++ b/core/modules/book/lib/Drupal/book/BookManager.php @@ -201,7 +201,6 @@ public function addFormElements(array $form, array &$form_state, NodeInterface $ '#type' => 'details', '#title' => $this->t('Book outline'), '#weight' => 10, - '#collapsed' => TRUE, '#group' => 'advanced', '#attributes' => array( 'class' => array('book-outline-form'), diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/CKEditorPluginManager.php b/core/modules/ckeditor/lib/Drupal/ckeditor/CKEditorPluginManager.php index 38a3ec6..ffd401b 100644 --- a/core/modules/ckeditor/lib/Drupal/ckeditor/CKEditorPluginManager.php +++ b/core/modules/ckeditor/lib/Drupal/ckeditor/CKEditorPluginManager.php @@ -156,6 +156,7 @@ public function injectPluginSettingsForm(array &$form, array &$form_state, Edito $form['plugins'][$plugin_id] = array( '#type' => 'details', '#title' => $definitions[$plugin_id]['label'], + '#open' => TRUE, '#group' => 'editor][settings][plugin_settings', '#attributes' => array( 'data-ckeditor-plugin-id' => $plugin_id, diff --git a/core/modules/color/color.module b/core/modules/color/color.module index 8a54e55..b7ab5a3 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -45,6 +45,7 @@ function color_form_system_theme_settings_alter(&$form, &$form_state) { $form['color'] = array( '#type' => 'details', '#title' => t('Color scheme'), + '#open' => TRUE, '#weight' => -1, '#attributes' => array('id' => 'color_scheme_form'), '#theme' => 'color_scheme_form', diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php index c96fe61..96a6ac7 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php @@ -118,7 +118,6 @@ public function form(array $form, array &$form_state) { $form['author'] += array( '#type' => 'details', '#title' => $this->t('Administration'), - '#collapsed' => TRUE, ); } diff --git a/core/modules/comment/lib/Drupal/comment/Form/CommentAdminOverview.php b/core/modules/comment/lib/Drupal/comment/Form/CommentAdminOverview.php index 3f5caef..5fed1db 100644 --- a/core/modules/comment/lib/Drupal/comment/Form/CommentAdminOverview.php +++ b/core/modules/comment/lib/Drupal/comment/Form/CommentAdminOverview.php @@ -119,6 +119,7 @@ public function buildForm(array $form, array &$form_state, $type = 'new') { $form['options'] = array( '#type' => 'details', '#title' => $this->t('Update options'), + '#open' => TRUE, '#attributes' => array('class' => array('container-inline')), ); diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldType/CommentItem.php b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldType/CommentItem.php index a43e338..cf2c7f9 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldType/CommentItem.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldType/CommentItem.php @@ -100,8 +100,7 @@ public function instanceSettingsForm(array $form, array &$form_state) { $element['comment'] = array( '#type' => 'details', '#title' => t('Comment form settings'), - '#collapsible' => TRUE, - '#collapsed' => FALSE, + '#open' => TRUE, '#bundle' => "{$entity_type}__{$field_name}", '#process' => array(array(get_class($this), 'processSettingsElement')), '#attributes' => array( diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldWidget/CommentWidget.php b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldWidget/CommentWidget.php index fd4ece7..1ee4766 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldWidget/CommentWidget.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldWidget/CommentWidget.php @@ -68,9 +68,9 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen if (isset($form['advanced'])) { $element += array( '#type' => 'details', - // Collapse this field when the selected value is the same as stored in + // Open the details when the selected value is different to the stored // default values for the field instance. - '#collapsed' => ($items->status == $field_default_values[0]['status']), + '#open' => ($items->status != $field_default_values[0]['status']), '#group' => 'advanced', '#attributes' => array( 'class' => array('comment-' . drupal_html_class($element['#entity_type']) . '-settings-form'), diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Form/ConfigTranslationFormBase.php b/core/modules/config_translation/lib/Drupal/config_translation/Form/ConfigTranslationFormBase.php index 22e6783..45803cb 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Form/ConfigTranslationFormBase.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Form/ConfigTranslationFormBase.php @@ -293,8 +293,7 @@ protected function buildConfigForm(Element $schema, $config_data, $base_config_d $build[$key] = array( '#type' => 'details', '#title' => (!empty($title) ? (strip_tags($title) . ' ') : '') . $this->t($definition['label']), - '#collapsible' => TRUE, - '#collapsed' => $collapsed, + '#open' => !$collapsed, ) + $sub_build; } } diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index bd9454f..3fca2ce 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -252,6 +252,7 @@ function contact_form_user_form_alter(&$form, &$form_state) { $form['contact'] = array( '#type' => 'details', '#title' => t('Contact settings'), + '#open' => TRUE, '#weight' => 5, ); $account = $form_state['controller']->getEntity(); @@ -286,6 +287,7 @@ function contact_form_user_admin_settings_alter(&$form, &$form_state) { $form['contact'] = array( '#type' => 'details', '#title' => t('Contact settings'), + '#open' => TRUE, '#weight' => 0, ); $form['contact']['contact_default_status'] = array( 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 497b01c..4fc6c1e 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php @@ -112,7 +112,6 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac $form['source_langcode'] = array( '#type' => 'details', '#title' => t('Source language: @language', array('@language' => $languages[$source_langcode]->name)), - '#collapsed' => TRUE, '#tree' => TRUE, '#weight' => -100, '#multilingual' => TRUE, @@ -182,7 +181,6 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac $form['content_translation'] = array( '#type' => 'details', '#title' => t('Translation'), - '#collapsed' => TRUE, '#tree' => TRUE, '#weight' => 10, '#access' => $this->getTranslationAccess($entity, $source_langcode ? 'create' : 'update'), diff --git a/core/modules/dblog/lib/Drupal/dblog/Form/DblogClearLogForm.php b/core/modules/dblog/lib/Drupal/dblog/Form/DblogClearLogForm.php index ebdfb8f..439148a 100644 --- a/core/modules/dblog/lib/Drupal/dblog/Form/DblogClearLogForm.php +++ b/core/modules/dblog/lib/Drupal/dblog/Form/DblogClearLogForm.php @@ -57,7 +57,6 @@ public function buildForm(array $form, array &$form_state) { '#type' => 'details', '#title' => $this->t('Clear log messages'), '#description' => $this->t('This will permanently remove the log messages from the database.'), - '#collapsed' => TRUE, ); $form['dblog_clear']['clear'] = array( '#type' => 'submit', diff --git a/core/modules/dblog/lib/Drupal/dblog/Form/DblogFilterForm.php b/core/modules/dblog/lib/Drupal/dblog/Form/DblogFilterForm.php index 89eeba7..2422472 100644 --- a/core/modules/dblog/lib/Drupal/dblog/Form/DblogFilterForm.php +++ b/core/modules/dblog/lib/Drupal/dblog/Form/DblogFilterForm.php @@ -30,7 +30,7 @@ public function buildForm(array $form, array &$form_state) { $form['filters'] = array( '#type' => 'details', '#title' => $this->t('Filter log messages'), - '#collapsed' => empty($_SESSION['dblog_overview_filter']), + '#open' => !empty($_SESSION['dblog_overview_filter']), ); foreach ($filters as $key => $filter) { $form['filters']['status'][$key] = array( diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php b/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php index f2eb699..793cccf 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php @@ -201,6 +201,7 @@ public function instanceSettingsForm(array $form, array &$form_state) { $form['handler'] = array( '#type' => 'details', '#title' => t('Reference type'), + '#open' => TRUE, '#tree' => TRUE, '#process' => array('_entity_reference_form_process_merge_parent'), ); diff --git a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php index cc3dacc..2897933 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php +++ b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php @@ -478,7 +478,6 @@ function multiple_options_form(&$form, &$form_state) { $form['multiple_field_settings'] = array( '#type' => 'details', '#title' => t('Multiple field settings'), - '#collapsed' => TRUE, '#weight' => 5, ); diff --git a/core/modules/field/tests/modules/field_test/field_test.entity.inc b/core/modules/field/tests/modules/field_test/field_test.entity.inc index 2d6a96b..824cbfc 100644 --- a/core/modules/field/tests/modules/field_test/field_test.entity.inc +++ b/core/modules/field/tests/modules/field_test/field_test.entity.inc @@ -60,6 +60,7 @@ function field_test_entity_nested_form($form, &$form_state, EntityInterface $ent $form['entity_2'] = array( '#type' => 'details', '#title' => t('Second entity'), + '#open' => TRUE, '#tree' => TRUE, '#parents' => array('entity_2'), '#weight' => 50, diff --git a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverviewBase.php b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverviewBase.php index 2ed54e8..5323e4e 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverviewBase.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverviewBase.php @@ -186,7 +186,6 @@ public function buildForm(array $form, array &$form_state, $entity_type_id = NUL $form['modes'] = array( '#type' => 'details', '#title' => $this->t('Custom display settings'), - '#collapsed' => TRUE, ); // Collect options and default values for the 'Custom display settings' // checkboxes. diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldInstanceEditForm.php b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldInstanceEditForm.php index 79aabe0..a475799 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldInstanceEditForm.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldInstanceEditForm.php @@ -142,6 +142,7 @@ public function buildForm(array $form, array &$form_state, FieldInstanceInterfac $element += array( '#type' => 'details', '#title' => $this->t('Default value'), + '#open' => TRUE, '#description' => $this->t('The default value for this field, used when creating new content.'), ); $form['instance']['default_value'] = $element; diff --git a/core/modules/file/lib/Drupal/file/Plugin/Field/FieldWidget/FileWidget.php b/core/modules/file/lib/Drupal/file/Plugin/Field/FieldWidget/FileWidget.php index 5c976ed..9267eae 100644 --- a/core/modules/file/lib/Drupal/file/Plugin/Field/FieldWidget/FileWidget.php +++ b/core/modules/file/lib/Drupal/file/Plugin/Field/FieldWidget/FileWidget.php @@ -145,6 +145,7 @@ protected function formMultipleElements(FieldItemListInterface $items, array &$f // building up the full list (like draggable table rows). $elements['#file_upload_delta'] = $delta; $elements['#type'] = 'details'; + $elements['#open'] = TRUE; $elements['#theme'] = 'file_widget_multiple'; $elements['#theme_wrappers'] = array('details'); $elements['#process'] = array(array(get_class($this), 'processMultiple')); diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php index eae21c2..6fa194c 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php @@ -190,6 +190,7 @@ public function form(array $form, array &$form_state) { $form['filters']['settings'][$name] = array( '#type' => 'details', '#title' => $filter->getLabel(), + '#open' => TRUE, '#weight' => $filter->weight, '#parents' => array('filters', $name, 'settings'), '#group' => 'filter_settings', diff --git a/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserForm.php b/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserForm.php index 0455b7d..8bbf247 100644 --- a/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserForm.php +++ b/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserForm.php @@ -107,7 +107,6 @@ public function buildForm(array $form, array &$form_state) { $form['new_mapping'] = array( '#type' => 'details', '#title' => $this->t('Add a new mapping'), - '#collapsed' => TRUE, '#tree' => TRUE, ); $form['new_mapping']['browser_langcode'] = array( diff --git a/core/modules/language/lib/Drupal/language/Form/NegotiationUrlForm.php b/core/modules/language/lib/Drupal/language/Form/NegotiationUrlForm.php index 172e6b0..6f9cdf5 100644 --- a/core/modules/language/lib/Drupal/language/Form/NegotiationUrlForm.php +++ b/core/modules/language/lib/Drupal/language/Form/NegotiationUrlForm.php @@ -43,6 +43,7 @@ public function buildForm(array $form, array &$form_state) { '#type' => 'details', '#tree' => TRUE, '#title' => t('Path prefix configuration'), + '#open' => TRUE, '#description' => t('Language codes or other custom text to use as a path prefix for URL language detection. For the default language, this value may be left blank. Modifying this value may break existing URLs. Use with caution in a production environment. Example: Specifying "deutsch" as the path prefix code for German results in URLs like "example.com/deutsch/contact".'), '#states' => array( 'visible' => array( @@ -56,6 +57,7 @@ public function buildForm(array $form, array &$form_state) { '#type' => 'details', '#tree' => TRUE, '#title' => t('Domain configuration'), + '#open' => TRUE, '#description' => t('The domain names to use for these languages. Leave blank for the default language. Use with caution in a production environment.Modifying this value may break existing URLs. Use with caution in a production environment. Example: Specifying "de.example.com" as language domain for German will result in an URL like "http://de.example.com/contact".'), '#states' => array( 'visible' => array( diff --git a/core/modules/locale/lib/Drupal/locale/Form/TranslateFilterForm.php b/core/modules/locale/lib/Drupal/locale/Form/TranslateFilterForm.php index 9018755..2fd6ad6 100644 --- a/core/modules/locale/lib/Drupal/locale/Form/TranslateFilterForm.php +++ b/core/modules/locale/lib/Drupal/locale/Form/TranslateFilterForm.php @@ -33,7 +33,7 @@ public function buildForm(array $form, array &$form_state) { $form['filters'] = array( '#type' => 'details', '#title' => $this->t('Filter translatable strings'), - '#collapsed' => FALSE, + '#open' => TRUE, ); foreach ($filters as $key => $filter) { // Special case for 'string' filter. diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index bb8da40..96cf924 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -190,7 +190,6 @@ function locale_translate_export_form($form, &$form_state) { $form['content_options'] = array( '#type' => 'details', '#title' => t('Export options'), - '#collapsed' => TRUE, '#tree' => TRUE, '#states' => array( 'invisible' => array( diff --git a/core/modules/menu/lib/Drupal/menu/MenuFormController.php b/core/modules/menu/lib/Drupal/menu/MenuFormController.php index 9a7d93b..c054484 100644 --- a/core/modules/menu/lib/Drupal/menu/MenuFormController.php +++ b/core/modules/menu/lib/Drupal/menu/MenuFormController.php @@ -113,6 +113,7 @@ public function form(array $form, array &$form_state) { $form['default_menu_links_language'] = array( '#type' => 'details', '#title' => t('Menu links language'), + '#open' => TRUE, ); $form['default_menu_links_language']['default_language'] = array( '#type' => 'language_configuration', diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index 82145b4..e4a9fd6 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -504,7 +504,7 @@ function menu_form_node_form_alter(&$form, $form_state) { '#type' => 'details', '#title' => t('Menu settings'), '#access' => \Drupal::currentUser()->hasPermission('administer menu'), - '#collapsed' => !$link['link_title'], + '#open' => !empty($link['link_title']), '#group' => 'advanced', '#attached' => array( 'library' => array(array('menu', 'drupal.menu')), @@ -623,7 +623,6 @@ function menu_form_node_type_form_alter(&$form, $form_state) { $form['menu'] = array( '#type' => 'details', '#title' => t('Menu settings'), - '#collapsed' => TRUE, '#attached' => array( 'library' => array(array('menu', 'drupal.menu.admin')), ), diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php index 569f502..24fa5b9 100644 --- a/core/modules/node/lib/Drupal/node/NodeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeFormController.php @@ -108,8 +108,8 @@ public function form(array $form, array &$form_state) { '#type' => 'details', '#group' => 'advanced', '#title' => t('Revision information'), - // Collapsed by default when "Create new revision" is unchecked. - '#collapsed' => !$node->isNewRevision(), + // Open by default when "Create new revision" is checked. + '#open' => $node->isNewRevision(), '#attributes' => array( 'class' => array('node-form-revision-information'), ), @@ -147,7 +147,6 @@ public function form(array $form, array &$form_state) { $form['author'] = array( '#type' => 'details', '#title' => t('Authoring information'), - '#collapsed' => TRUE, '#group' => 'advanced', '#attributes' => array( 'class' => array('node-form-author'), @@ -190,7 +189,6 @@ public function form(array $form, array &$form_state) { $form['options'] = array( '#type' => 'details', '#title' => t('Promotion options'), - '#collapsed' => TRUE, '#group' => 'advanced', '#attributes' => array( 'class' => array('node-form-options'), diff --git a/core/modules/node/lib/Drupal/node/NodeTypeFormController.php b/core/modules/node/lib/Drupal/node/NodeTypeFormController.php index cc86095..e0a466c 100644 --- a/core/modules/node/lib/Drupal/node/NodeTypeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeTypeFormController.php @@ -74,6 +74,7 @@ public function form(array $form, array &$form_state) { '#type' => 'details', '#title' => t('Submission form settings'), '#group' => 'additional_settings', + '#open' => TRUE, ); $form['submission']['title_label'] = array( '#title' => t('Title field label'), @@ -108,7 +109,6 @@ public function form(array $form, array &$form_state) { $form['workflow'] = array( '#type' => 'details', '#title' => t('Publishing options'), - '#collapsed' => TRUE, '#group' => 'additional_settings', ); $form['workflow']['options'] = array('#type' => 'checkboxes', @@ -127,7 +127,6 @@ public function form(array $form, array &$form_state) { $form['language'] = array( '#type' => 'details', '#title' => t('Language settings'), - '#collapsed' => TRUE, '#group' => 'additional_settings', ); @@ -144,7 +143,6 @@ public function form(array $form, array &$form_state) { $form['display'] = array( '#type' => 'details', '#title' => t('Display settings'), - '#collapsed' => TRUE, '#group' => 'additional_settings', ); $form['display']['submitted'] = array( diff --git a/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php b/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php index 1e9e7ff..6106729 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php +++ b/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php @@ -379,14 +379,12 @@ public function searchFormAlter(array &$form, array &$form_state) { $form['advanced'] = array( '#type' => 'details', '#title' => t('Advanced search'), - '#collapsed' => TRUE, '#attributes' => array('class' => array('search-advanced')), '#access' => $this->account && $this->account->hasPermission('use advanced search'), ); $form['advanced']['keywords-fieldset'] = array( '#type' => 'fieldset', '#title' => t('Keywords'), - '#collapsible' => FALSE, ); $form['advanced']['keywords'] = array( '#prefix' => '
', @@ -416,7 +414,6 @@ public function searchFormAlter(array &$form, array &$form_state) { $form['advanced']['types-fieldset'] = array( '#type' => 'fieldset', '#title' => t('Types'), - '#collapsible' => FALSE, ); $form['advanced']['types-fieldset']['type'] = array( '#type' => 'checkboxes', @@ -443,8 +440,6 @@ public function searchFormAlter(array &$form, array &$form_state) { $form['advanced']['lang-fieldset'] = array( '#type' => 'fieldset', '#title' => t('Languages'), - '#collapsible' => FALSE, - '#collapsed' => FALSE, ); $form['advanced']['lang-fieldset']['language'] = array( '#type' => 'checkboxes', @@ -556,6 +551,7 @@ public function buildConfigurationForm(array $form, array &$form_state) { $form['content_ranking'] = array( '#type' => 'details', '#title' => t('Content ranking'), + '#open' => TRUE, ); $form['content_ranking']['#theme'] = 'node_search_admin'; $form['content_ranking']['info'] = array( diff --git a/core/modules/node/node.module b/core/modules/node/node.module index f72bbc5..3655553 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -1134,7 +1134,6 @@ function node_form_block_form_alter(&$form, &$form_state) { $form['visibility']['node_type'] = array( '#type' => 'details', '#title' => t('Content types'), - '#collapsed' => TRUE, '#group' => 'visibility', '#weight' => 5, ); diff --git a/core/modules/path/path.admin.inc b/core/modules/path/path.admin.inc index fe8d542..a2b2072 100644 --- a/core/modules/path/path.admin.inc +++ b/core/modules/path/path.admin.inc @@ -283,8 +283,10 @@ function path_admin_form_submit($form, &$form_state) { */ function path_admin_filter_form($form, &$form_state, $keys = '') { $form['#attributes'] = array('class' => array('search-form')); - $form['basic'] = array('#type' => 'details', + $form['basic'] = array( + '#type' => 'details', '#title' => t('Filter aliases'), + '#open' => TRUE, '#attributes' => array('class' => array('container-inline')), ); $form['basic']['filter'] = array( diff --git a/core/modules/path/path.module b/core/modules/path/path.module index 6c823ea..a8512db 100644 --- a/core/modules/path/path.module +++ b/core/modules/path/path.module @@ -119,7 +119,7 @@ function path_form_node_form_alter(&$form, $form_state) { $form['path'] = array( '#type' => 'details', '#title' => t('URL path settings'), - '#collapsed' => empty($path['alias']), + '#open' => !empty($path['alias']), '#group' => 'advanced', '#attributes' => array( 'class' => array('path-form'), diff --git a/core/modules/search/lib/Drupal/search/SearchPageListController.php b/core/modules/search/lib/Drupal/search/SearchPageListController.php index 6d4edc3..fbbe6bb 100644 --- a/core/modules/search/lib/Drupal/search/SearchPageListController.php +++ b/core/modules/search/lib/Drupal/search/SearchPageListController.php @@ -158,6 +158,7 @@ public function buildForm(array $form, array &$form_state) { $form['status'] = array( '#type' => 'details', '#title' => $this->t('Indexing status'), + '#open' => TRUE, ); $form['status']['status'] = array('#markup' => $status); $form['status']['wipe'] = array( @@ -171,7 +172,8 @@ public function buildForm(array $form, array &$form_state) { // Indexing throttle: $form['indexing_throttle'] = array( '#type' => 'details', - '#title' => $this->t('Indexing throttle') + '#title' => $this->t('Indexing throttle'), + '#open' => TRUE, ); $form['indexing_throttle']['cron_limit'] = array( '#type' => 'select', @@ -183,7 +185,8 @@ public function buildForm(array $form, array &$form_state) { // Indexing settings: $form['indexing_settings'] = array( '#type' => 'details', - '#title' => $this->t('Indexing settings') + '#title' => $this->t('Indexing settings'), + '#open' => TRUE, ); $form['indexing_settings']['info'] = array( '#markup' => $this->t('

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.

') @@ -206,6 +209,7 @@ public function buildForm(array $form, array &$form_state) { $form['search_pages'] = array( '#type' => 'details', '#title' => $this->t('Search pages'), + '#open' => TRUE, ); $form['search_pages']['add_page'] = array( '#type' => 'container', diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestResultsForm.php b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestResultsForm.php index a166422..8b74dc5 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestResultsForm.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestResultsForm.php @@ -145,6 +145,7 @@ public function buildForm(array $form, array &$form_state, $test_id = NULL) { $form['result']['results'][$group] = array( '#type' => 'details', '#title' => $info['name'], + '#open' => TRUE, '#description' => $info['description'], ); $form['result']['results'][$group]['summary'] = $summary; @@ -178,7 +179,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 24bdb85..dfd80a1 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 c469b52..acef828 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php @@ -48,6 +48,7 @@ public function buildForm(array $form, array &$form_state) { $form['tests'] = array( '#type' => 'details', '#title' => $this->t('Tests'), + '#open' => TRUE, '#description' => $this->t('Select the test(s) or test group(s) you would like to run, and click Run tests.'), ); @@ -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 1743b74..40402df 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 2f4d9f7..d4683a9 100644 --- a/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php +++ b/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php @@ -64,6 +64,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 ac5789d..f32a463 100644 --- a/core/modules/system/lib/Drupal/system/Form/CronForm.php +++ b/core/modules/system/lib/Drupal/system/Form/CronForm.php @@ -94,6 +94,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 dca33b4..e28e647 100644 --- a/core/modules/system/lib/Drupal/system/Form/ImageToolkitForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ImageToolkitForm.php @@ -78,7 +78,7 @@ public function buildForm(array $form, array &$form_state) { $form['image_toolkit_settings'][$id] = array( '#type' => 'details', '#title' => $this->t('@toolkit settings', array('@toolkit' => $definition['title'])), - '#collapsed' => FALSE, + '#open' => TRUE, '#tree' => TRUE, '#states' => array( 'visible' => array( diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php index a090c67..894acfc 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php @@ -120,6 +120,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 3f44128..a123d8b 100644 --- a/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php +++ b/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php @@ -65,6 +65,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( @@ -76,6 +77,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'); @@ -106,6 +108,7 @@ public function buildForm(array $form, array &$form_state) { $form['bandwidth_optimization'] = array( '#type' => 'details', '#title' => t('Bandwidth optimization'), + '#open' => TRUE, '#description' => t('External resources can be optimized automatically, which can reduce both the size and number of requests made to your website.') . $disabled_message, ); diff --git a/core/modules/system/lib/Drupal/system/Form/RegionalForm.php b/core/modules/system/lib/Drupal/system/Form/RegionalForm.php index 1c45f15..bf4ebaf 100644 --- a/core/modules/system/lib/Drupal/system/Form/RegionalForm.php +++ b/core/modules/system/lib/Drupal/system/Form/RegionalForm.php @@ -67,6 +67,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( @@ -88,6 +89,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 6f433ee..1a10aaa 100644 --- a/core/modules/system/lib/Drupal/system/Form/SiteInformationForm.php +++ b/core/modules/system/lib/Drupal/system/Form/SiteInformationForm.php @@ -68,6 +68,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', @@ -91,6 +92,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( @@ -104,6 +106,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/ThemeAdminForm.php b/core/modules/system/lib/Drupal/system/Form/ThemeAdminForm.php index 8bb44ef..81aebc7 100644 --- a/core/modules/system/lib/Drupal/system/Form/ThemeAdminForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ThemeAdminForm.php @@ -30,6 +30,7 @@ public function buildForm(array $form, array &$form_state, array $theme_options $form['admin_theme'] = array( '#type' => 'details', '#title' => $this->t('Administration theme'), + '#open' => TRUE, ); $form['admin_theme']['admin_theme'] = array( '#type' => 'select', diff --git a/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php b/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php index 5dbbea1..2f910ae 100644 --- a/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php @@ -122,6 +122,7 @@ public function buildForm(array $form, array &$form_state, $theme = '') { $form['theme_settings'] = array( '#type' => 'details', '#title' => t('Toggle display'), + '#open' => TRUE, '#description' => t('Enable or disable the display of certain page elements.'), ); foreach ($toggles as $name => $title) { @@ -145,6 +146,7 @@ public function buildForm(array $form, array &$form_state, $theme = '') { $form['logo'] = array( '#type' => 'details', '#title' => t('Logo image settings'), + '#open' => TRUE, '#attributes' => array('class' => array('theme-settings-bottom')), '#states' => array( // Hide the logo image settings fieldset when logo display is disabled. @@ -185,6 +187,7 @@ public function buildForm(array $form, array &$form_state, $theme = '') { $form['favicon'] = array( '#type' => 'details', '#title' => t('Shortcut icon settings'), + '#open' => TRUE, '#description' => t("Your shortcut icon, or 'favicon', is displayed in the address bar and bookmarks of most browsers."), '#states' => array( // Hide the shortcut icon settings fieldset when shortcut icon display @@ -261,6 +264,7 @@ public function buildForm(array $form, array &$form_state, $theme = '') { $form['engine_specific'] = array( '#type' => 'details', '#title' => t('Theme-engine-specific settings'), + '#open' => TRUE, '#description' => t('These settings only exist for the themes based on the %engine theme engine.', array('%engine' => $themes[$theme]->prefix)), ); $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 7ad7312..45751f3 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php @@ -345,6 +345,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'), ), @@ -353,6 +354,7 @@ function testDrupalRenderChildrenAttached() { ); $element['child'] = array( '#type' => 'details', + '#open' => TRUE, '#attached' => array('js' => array($child_js)), '#title' => 'Child', ); @@ -558,6 +560,7 @@ function testDrupalRenderChildrenPostRenderCache() { $context_3 = array('baz' => $this->randomContextValue()); $test_element = array( '#type' => 'details', + '#open' => TRUE, '#cache' => array( 'keys' => array('simpletest', 'drupal_render', 'children_post_render_cache'), ), @@ -573,6 +576,7 @@ function testDrupalRenderChildrenPostRenderCache() { ); $test_element['child'] = array( '#type' => 'details', + '#open' => TRUE, '#post_render_cache' => array( 'common_test_post_render_cache' => array($context_2) ), diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/RenderWebTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/RenderWebTest.php index c42997d..8168b96 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderWebTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderWebTest.php @@ -122,6 +122,7 @@ function testDrupalRenderFormElements() { $element = array( '#type' => 'details', + '#open' => TRUE, '#title' => $this->randomName(), ); $this->assertRenderedElement($element, '//details/summary[contains(., :title)]', array( @@ -130,6 +131,7 @@ function testDrupalRenderFormElements() { $element = array( '#type' => 'details', + '#open' => TRUE, '#title' => $this->randomName(), ); $this->assertRenderedElement($element, '//details'); diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 4a6005d..e8ce232 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -391,7 +391,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 d85a30e..bea6cd9 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -556,7 +556,7 @@ function system_element_info() { '#attributes' => array('class' => array('fieldgroup')), ); $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'), @@ -2443,6 +2443,7 @@ function system_user_timezone(&$form, &$form_state) { $form['timezone'] = array( '#type' => 'details', '#title' => t('Locale settings'), + '#open' => TRUE, '#weight' => 6, ); $form['timezone']['timezone'] = array( 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 0e8bdb9..e801708 100644 --- a/core/modules/system/tests/modules/form_test/form_test.module +++ b/core/modules/system/tests/modules/form_test/form_test.module @@ -527,7 +527,7 @@ 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'), ); $form['tab1']['field1'] = array( '#title' => t('Field 1'), @@ -537,7 +537,7 @@ 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'), ); $form['tab2']['field2'] = array( '#title' => t('Field 2'), @@ -2054,10 +2054,12 @@ function form_test_group_details() { $form['details'] = array( '#type' => 'details', '#title' => 'Root element', + '#open' => TRUE, ); $form['meta'] = array( '#type' => 'details', '#title' => 'Group element', + '#open' => TRUE, '#group' => 'details', ); $form['meta']['element'] = array( @@ -2079,6 +2081,7 @@ function form_test_group_container() { $form['meta'] = array( '#type' => 'details', '#title' => 'Group element', + '#open' => TRUE, '#group' => 'container', ); $form['meta']['element'] = array( diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php index 3fa15e2..52ef2a8 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php @@ -89,7 +89,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 6a02f1e..7246970 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php @@ -58,6 +58,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/user/lib/Drupal/user/AccountFormController.php b/core/modules/user/lib/Drupal/user/AccountFormController.php index 6fa3732..964c664 100644 --- a/core/modules/user/lib/Drupal/user/AccountFormController.php +++ b/core/modules/user/lib/Drupal/user/AccountFormController.php @@ -214,6 +214,7 @@ public function form(array $form, array &$form_state) { $form['signature_settings'] = array( '#type' => 'details', '#title' => $this->t('Signature settings'), + '#open' => TRUE, '#weight' => 1, '#access' => (!$register && $config->get('signatures')), ); @@ -245,6 +246,7 @@ public function form(array $form, array &$form_state) { $form['language'] = array( '#type' => $this->languageManager->isMultilingual() ? 'details' : 'container', '#title' => $this->t('Language settings'), + '#open' => TRUE, // Display language selector when either creating a user on the admin // interface or editing a user account. '#access' => !$register || $user->hasPermission('administer users'), diff --git a/core/modules/user/lib/Drupal/user/AccountSettingsForm.php b/core/modules/user/lib/Drupal/user/AccountSettingsForm.php index b7c4c3a..cc4e255 100644 --- a/core/modules/user/lib/Drupal/user/AccountSettingsForm.php +++ b/core/modules/user/lib/Drupal/user/AccountSettingsForm.php @@ -66,6 +66,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', @@ -79,6 +80,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. @@ -98,6 +100,7 @@ public function buildForm(array $form, array &$form_state) { $form['language'] = array( '#type' => 'details', '#title' => $this->t('Language settings'), + '#open' => TRUE, '#tree' => TRUE, ); $form_state['content_translation']['key'] = 'language'; @@ -108,6 +111,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', @@ -151,6 +155,7 @@ public function buildForm(array $form, array &$form_state) { $form['personalization'] = array( '#type' => 'details', '#title' => $this->t('Personalization'), + '#open' => TRUE, '#access' => $filter_exists, ); $form['personalization']['user_signatures'] = array( @@ -180,7 +185,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', ); @@ -200,7 +205,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', ); @@ -220,7 +225,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', ); @@ -240,7 +245,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', ); @@ -260,7 +265,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, @@ -281,7 +285,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', ); @@ -315,7 +318,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', ); @@ -349,7 +351,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', ); @@ -369,7 +370,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 e319ab1..24ae8f7 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php @@ -294,7 +294,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( @@ -310,7 +309,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 087c9ab..aaae022 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php @@ -354,7 +354,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 fc68703..be1a69c 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 @@ -156,6 +156,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. @@ -175,7 +176,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['exception'] = array( '#type' => 'details', '#title' => t('Exceptions'), - '#collapsed' => TRUE, '#fieldset' => 'no_argument', ); $form['exception']['value'] = array( @@ -221,6 +221,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 5f66de4..08c12cc 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 @@ -538,7 +538,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['style_settings'] = array( '#type' => 'details', '#title' => t('Style settings'), - '#collapsed' => TRUE, '#weight' => 99, ); @@ -687,7 +686,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['alter'] = array( '#title' => t('Rewrite results'), '#type' => 'details', - '#collapsed' => TRUE, '#weight' => 100, ); @@ -890,7 +888,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( @@ -1029,7 +1026,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 c81841e..a0c1c3d 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 00d371d..b59b72e 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 @@ -89,7 +89,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 d6e6e7a..25686f8 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 @@ -253,7 +253,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 3730005..daaee70 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( @@ -70,6 +72,7 @@ public function buildForm(array $form, array &$form_state) { if (!empty($options)) { $form['extenders'] = array( '#type' => 'details', + '#open' => TRUE, ); $form['extenders']['display_extenders'] = array( '#title' => $this->t('Display extenders'), 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 e471528..caade6e 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 @@ -68,6 +68,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 9d3b6bd..50bb465 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -494,7 +494,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( @@ -503,11 +502,8 @@ 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).