diff --git a/core/includes/authorize.inc b/core/includes/authorize.inc index f98820f..251ce11 100644 --- a/core/includes/authorize.inc +++ b/core/includes/authorize.inc @@ -158,7 +158,7 @@ function _authorize_filetransfer_connection_settings($backend) { * * The default settings for the file transfer connection forms are saved in * the database. The settings are stored as a nested array in the case of a - * settings form that has fieldsets or otherwise uses a nested structure. + * settings form that has details or otherwise uses a nested structure. * Therefore, to properly add defaults, we need to walk through all the * children form elements and process those defaults recursively. * @@ -170,14 +170,14 @@ function _authorize_filetransfer_connection_settings($backend) { * The default settings for the file transfer backend we're operating on. */ function _authorize_filetransfer_connection_settings_set_defaults(&$element, $key, array $defaults) { - // If we're operating on a form element which isn't a fieldset, and we have + // If we're operating on a form element which isn't a details, and we have // a default setting saved, stash it in #default_value. - if (!empty($key) && isset($defaults[$key]) && isset($element['#type']) && $element['#type'] != 'fieldset') { + if (!empty($key) && isset($defaults[$key]) && isset($element['#type']) && $element['#type'] != 'details') { $element['#default_value'] = $defaults[$key]; } // Now, we walk through all the child elements, and recursively invoke // ourself on each one. Since the $defaults settings array can be nested - // (because of #tree, any values inside fieldsets will be nested), if + // (because of #tree, any values inside details will be nested), if // there's a subarray of settings for the form key we're currently // processing, pass in that subarray to the recursive call. Otherwise, just // pass on the whole $defaults array. diff --git a/core/includes/common.inc b/core/includes/common.inc index 6800fa5..a292d17 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -5573,8 +5573,8 @@ function drupal_render_page($page) { * * The #theme_wrappers property contains an array of theme functions which will * be called, in order, after #theme has run. These can be used to add further - * markup around the rendered children; e.g., fieldsets add the required markup - * for a fieldset around their rendered child elements. All wrapper theme + * markup around the rendered children; e.g., details add the required markup + * for a details element around their rendered child elements. All wrapper theme * functions have to include the element's #children property in their output, * as it contains the output of the previous theme functions and the rendered * children. diff --git a/core/includes/form.inc b/core/includes/form.inc index 6956f04..0784d2d 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -256,8 +256,8 @@ function drupal_get_form($form_id) { * handler, and is also used in Ajax handlers. * - has_file_element: Internal. If TRUE, there is a file element and Form API * will set the appropriate 'enctype' HTML attribute on the form. - * - groups: Internal. An array containing references to fieldsets to render - * them within vertical tabs. + * - groups: Internal. An array containing references to details elements to + * render them within vertical tabs. * - storage: $form_state['storage'] is not a special key, and no specific * support is provided for it in the Form API. By tradition it was * the location where application-specific data was stored for communication @@ -1706,9 +1706,9 @@ function form_error(&$element, $message = '') { * type, one of the functions in this array is form_process_date(), which adds * the individual 'year', 'month', 'day', etc. child elements. These functions * can also be used to set additional properties or implement special logic - * other than adding child elements: for example, for the 'fieldset' element - * type, one of the functions in this array is form_process_fieldset(), which - * adds the attributes and JavaScript needed to make the fieldset collapsible + * other than adding child elements: for example, for the 'details' element + * type, one of the functions in this array is form_process_details(), which + * adds the attributes and JavaScript needed to make the details collapsible * if the #collapsible property is set. The #process functions are called in * preorder traversal, meaning they are called for the parent element first, * then for the child elements. @@ -2814,6 +2814,39 @@ function theme_fieldset($variables) { } /** + * Returns HTML for a details form element and its children. + * + * @param $variables + * An associative array containing: + * - element: An associative array containing the properties of the element. + * Properties used: #attributes, #children, #collapsed, #collapsible, + * #description, #id, #title, #value. + * + * @ingroup themeable + */ +function theme_details($variables) { + $element = $variables['element']; + element_set_attributes($element, array('id')); + _form_set_attributes($element, array('form-wrapper')); + + $output = ''; + if (!empty($element['#title'])) { + $output .= '' . $element['#title'] . ''; + } + $output .= '
'; + if (!empty($element['#description'])) { + $output .= '
' . $element['#description'] . '
'; + } + $output .= $element['#children']; + if (isset($element['#value'])) { + $output .= $element['#value']; + } + $output .= '
'; + $output .= "\n"; + return $output; +} + +/** * Returns HTML for a radio button form element. * * Note: The input "name" attribute needs to be sanitized before output, which @@ -3670,29 +3703,29 @@ function form_validate_machine_name(&$element, &$form_state) { } /** - * Arranges fieldsets into groups. + * Arranges details into groups. * * @param $element * An associative array containing the properties and children of the - * fieldset. Note that $element must be taken by reference here, so processed + * details. Note that $element must be taken by reference here, so processed * child elements are taken over into $form_state. * @param $form_state - * The $form_state array for the form this fieldset belongs to. + * The $form_state array for the form this details belongs to. * * @return * The processed element. */ -function form_process_fieldset(&$element, &$form_state) { +function form_process_details(&$element, &$form_state) { $parents = implode('][', $element['#parents']); - // Each fieldset forms a new group. The #type 'vertical_tabs' basically only - // injects a new fieldset. + // Each details element forms a new group. The #type 'vertical_tabs' basically + // only injects a new details element. $form_state['groups'][$parents]['#group_exists'] = TRUE; $element['#groups'] = &$form_state['groups']; - // Process vertical tabs group member fieldsets. + // Process vertical tabs group member details elements. if (isset($element['#group'])) { - // Add this fieldset to the defined group (by reference). + // Add this details element to the defined group (by reference). $group = $element['#group']; $form_state['groups'][$group][] = &$element; } @@ -3708,19 +3741,19 @@ function form_process_fieldset(&$element, &$form_state) { * * @param $element * An associative array containing the properties and children of the - * fieldset. + * details. * * @return * The modified element with all group members. */ -function form_pre_render_fieldset($element) { - // The .form-wrapper class is required for #states to treat fieldsets like +function form_pre_render_details($element) { + // The .form-wrapper class is required for #states to treat details like // containers. if (!isset($element['#attributes']['class'])) { $element['#attributes']['class'] = array(); } - // Collapsible fieldsets + // Collapsible details. if (!empty($element['#collapsible'])) { $element['#attached']['library'][] = array('system', 'drupal.collapse'); $element['#attributes']['class'][] = 'collapsible'; @@ -3729,7 +3762,7 @@ function form_pre_render_fieldset($element) { } } - // Fieldsets may be rendered outside of a Form API context. + // Details may be rendered outside of a Form API context. if (!isset($element['#parents']) || !isset($element['#groups'])) { return $element; } @@ -3741,7 +3774,7 @@ function form_pre_render_fieldset($element) { // Break references and indicate that the element should be rendered as // group member. $child = (array) $element['#groups'][$parents][$key]; - $child['#group_fieldset'] = TRUE; + $child['#group_details'] = TRUE; // Inject the element as new child element. $element[] = $child; @@ -3761,7 +3794,7 @@ function form_pre_render_fieldset($element) { // Intentionally empty to clarify the flow; we simply return $element. } // If we injected this element into the group, then we want to render it. - elseif (!empty($element['#group_fieldset'])) { + elseif (!empty($element['#group_details'])) { // Intentionally empty to clarify the flow; we simply return $element. } // Otherwise, this element belongs to a group and the group exists, so we do @@ -3779,7 +3812,7 @@ function form_pre_render_fieldset($element) { * * @param $element * An associative array containing the properties and children of the - * fieldset. + * details element. * @param $form_state * The $form_state array for the form this vertical tab widget belongs to. * @@ -3787,10 +3820,10 @@ function form_pre_render_fieldset($element) { * The processed element. */ function form_process_vertical_tabs($element, &$form_state) { - // Inject a new fieldset as child, so that form_process_fieldset() processes - // this fieldset like any other fieldset. + // Inject a new details as child, so that form_process_details() processes + // this details element like any other details. $element['group'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#theme_wrappers' => array(), '#parents' => $element['#parents'], ); @@ -3813,12 +3846,12 @@ function form_process_vertical_tabs($element, &$form_state) { } /** - * Returns HTML for an element's children fieldsets as vertical tabs. + * Returns HTML for an element's children details as vertical tabs. * * @param $variables * An associative array containing: * - element: An associative array containing the properties and children of - * the fieldset. Properties used: #children. + * the details element. Properties used: #children. * * @ingroup themeable */ diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 3968682..5da7bbf 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1875,7 +1875,7 @@ function install_check_requirements($install_state) { */ function _install_configure_form($form, &$form_state, &$install_state) { $form['site_information'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => st('Site information'), '#collapsible' => FALSE, ); @@ -1894,7 +1894,7 @@ function _install_configure_form($form, &$form_state, &$install_state) { '#weight' => -15, ); $form['admin_account'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => st('Site maintenance account'), '#collapsible' => FALSE, ); @@ -1923,7 +1923,7 @@ function _install_configure_form($form, &$form_state, &$install_state) { ); $form['server_settings'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => st('Server settings'), '#collapsible' => FALSE, ); @@ -1950,7 +1950,7 @@ function _install_configure_form($form, &$form_state, &$install_state) { ); $form['update_notifications'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => st('Update notifications'), '#collapsible' => FALSE, ); diff --git a/core/includes/theme.inc b/core/includes/theme.inc index cc29a98..f3d6988 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -3042,6 +3042,9 @@ function drupal_common_theme() { 'fieldset' => array( 'render element' => 'element', ), + 'details' => array( + 'render element' => 'element', + ), 'radio' => array( 'render element' => 'element', ), diff --git a/core/lib/Drupal/Core/Database/Install/Tasks.php b/core/lib/Drupal/Core/Database/Install/Tasks.php index 5d34a62..d7faaec 100644 --- a/core/lib/Drupal/Core/Database/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Install/Tasks.php @@ -232,7 +232,7 @@ public function getFormOptions($database) { ); $form['advanced_options'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => st('Advanced options'), '#collapsible' => TRUE, '#collapsed' => TRUE, diff --git a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php index 337b0b3..72a6751 100644 --- a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php +++ b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php @@ -406,7 +406,7 @@ public function getSettingsForm() { '#description' => t('Your password is not saved in the database and is only used to establish a connection.'), ); $form['advanced'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Advanced settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, diff --git a/core/misc/collapse.js b/core/misc/collapse.js index 80f5939..a64ce05 100644 --- a/core/misc/collapse.js +++ b/core/misc/collapse.js @@ -3,18 +3,18 @@ "use strict"; /** - * The collapsible fieldset object represents a single collapsible fieldset. + * The collapsible details object represents a single collapsible details element. */ -function CollapsibleFieldset(node, settings) { +function CollapsibleDetails(node, settings) { this.$node = $(node); - this.$node.data('fieldset', this); + this.$node.data('details', this); this.settings = $.extend({ duration:'fast', easing:'linear' }, settings ); - // Expand fieldset if there are errors inside, or if it contains an + // Expand details if there are errors inside, or if it contains an // element that is targeted by the URI fragment identifier. var anchor = location.hash && location.hash !== '#' ? ', ' + location.hash : ''; if (this.$node.find('.error' + anchor).length) { @@ -27,19 +27,19 @@ function CollapsibleFieldset(node, settings) { } /** - * Extend CollapsibleFieldset function. + * Extend CollapsibleDetails function. */ -$.extend(CollapsibleFieldset, { +$.extend(CollapsibleDetails, { /** - * Holds references to instantiated CollapsibleFieldset objects. + * Holds references to instantiated CollapsibleDetails objects. */ - fieldsets: [] + instances: [] }); /** - * Extend CollapsibleFieldset prototype. + * Extend CollapsibleDetails prototype. */ -$.extend(CollapsibleFieldset.prototype, { +$.extend(CollapsibleDetails.prototype, { /** * Flag preventing multiple simultaneous animations. */ @@ -57,17 +57,16 @@ $.extend(CollapsibleFieldset.prototype, { * Initialize and setup legend markup. */ setupLegend: function () { - // Turn the legend into a clickable link, but retain span.fieldset-legend - // for CSS positioning. - var $legend = this.$node.find('> legend .fieldset-legend'); + // Turn the summary into a clickable link. + var $legend = this.$node.find('> summary'); - $('') + $('') .append(this.$node.hasClass('collapsed') ? Drupal.t('Show') : Drupal.t('Hide')) .prependTo($legend) .after(' '); // .wrapInner() does not retain bound events. - var $link = $('') + var $link = $('') .prepend($legend.contents()) .appendTo($legend) .click($.proxy(this.onLegendClick, this)); @@ -88,7 +87,7 @@ $.extend(CollapsibleFieldset.prototype, { this.$summary.html(text ? ' (' + text + ')' : ''); }, /** - * Toggle the visibility of a fieldset using smooth animations. + * Toggle the visibility of a details element using smooth animations. */ toggle: function () { // Don't animate multiple times. @@ -96,11 +95,11 @@ $.extend(CollapsibleFieldset.prototype, { return; } if (this.$node.is('.collapsed')) { - var $content = this.$node.find('> .fieldset-wrapper').hide(); + var $content = this.$node.find('> .details-wrapper').hide(); this.$node .removeClass('collapsed') .trigger({ type:'collapsed', value:false }) - .find('> legend span.fieldset-legend-prefix').html(Drupal.t('Hide')); + .find('> summary span.details-summary-prefix').html(Drupal.t('Hide')); $content.slideDown( $.extend(this.settings, { complete:$.proxy(this.onCompleteSlideDown, this) @@ -109,7 +108,7 @@ $.extend(CollapsibleFieldset.prototype, { } else { this.$node.trigger({ type:'collapsed', value:true }); - this.$node.find('> .fieldset-wrapper').slideUp( + this.$node.find('> .details-wrapper').slideUp( $.extend(this.settings, { complete:$.proxy(this.onCompleteSlideUp, this) }) @@ -117,19 +116,19 @@ $.extend(CollapsibleFieldset.prototype, { } }, /** - * Completed opening fieldset. + * Completed opening details element. */ onCompleteSlideDown: function () { this.$node.trigger('completeSlideDown'); this.animating = false; }, /** - * Completed closing fieldset. + * Completed closing details element. */ onCompleteSlideUp: function () { this.$node .addClass('collapsed') - .find('> legend span.fieldset-legend-prefix').html(Drupal.t('Show')); + .find('> summary span.details-summary-prefix').html(Drupal.t('Show')); this.$node.trigger('completeSlideUp'); this.animating = false; } @@ -137,16 +136,16 @@ $.extend(CollapsibleFieldset.prototype, { Drupal.behaviors.collapse = { attach: function (context, settings) { - var $collapsibleFieldsets = $(context).find('fieldset.collapsible').once('collapse'); - if ($collapsibleFieldsets.length) { - for (var i = 0; i < $collapsibleFieldsets.length; i++) { - CollapsibleFieldset.fieldsets.push(new CollapsibleFieldset($collapsibleFieldsets[i], settings.collapsibleFieldset)); + var $collapsibleDetails = $(context).find('details.collapsible').once('collapse'); + if ($collapsibleDetails.length) { + for (var i = 0; i < $collapsibleDetails.length; i++) { + CollapsibleDetails.instances.push(new CollapsibleDetails($collapsibleDetails[i], settings.collapsibleDetails)); } } } }; // Expose constructor in the public space. -Drupal.CollapsibleFieldset = CollapsibleFieldset; +Drupal.CollapsibleDetails = CollapsibleDetails; })(jQuery, Drupal); diff --git a/core/misc/states.js b/core/misc/states.js index afd922c..171bac5 100644 --- a/core/misc/states.js +++ b/core/misc/states.js @@ -538,7 +538,7 @@ $(document).bind('state:checked', function(e) { $(document).bind('state:collapsed', function(e) { if (e.trigger) { if ($(e.target).is('.collapsed') !== e.value) { - $(e.target).find('> legend a').click(); + $(e.target).find('> summary a').click(); } } }); diff --git a/core/misc/vertical-tabs.css b/core/misc/vertical-tabs.css index c946503..e749668 100644 --- a/core/misc/vertical-tabs.css +++ b/core/misc/vertical-tabs.css @@ -11,12 +11,11 @@ div.vertical-tabs { margin: -1px 0 -1px -15em; /* LTR */ float: left; /* LTR */ } -.vertical-tabs fieldset.vertical-tabs-pane { - margin: 0 !important; - padding: 0 1em; +.vertical-tabs .vertical-tabs-pane { + margin: 0; border: 0; } -fieldset.vertical-tabs-pane > legend { +.vertical-tabs-pane > summary { display: none; } diff --git a/core/misc/vertical-tabs.js b/core/misc/vertical-tabs.js index 303840a..f8c20ed 100644 --- a/core/misc/vertical-tabs.js +++ b/core/misc/vertical-tabs.js @@ -3,13 +3,13 @@ "use strict"; /** - * This script transforms a set of fieldsets into a stack of vertical + * This script transforms a set of details into a stack of vertical * tabs. Another tab pane can be selected by clicking on the respective * tab. * * Each tab may have a summary which can be updated by another - * script. For that to work, each fieldset has an associated - * 'verticalTabCallback' (with jQuery.data() attached to the fieldset), + * script. For that to work, each details element has an associated + * 'verticalTabCallback' (with jQuery.data() attached to the details), * which is called every time the user performs an update to a form * element inside the tab pane. */ @@ -25,9 +25,9 @@ Drupal.behaviors.verticalTabs = { var focusID = $this.find(':hidden.vertical-tabs-active-tab').val(); var tab_focus; - // Check if there are some fieldsets that can be converted to vertical-tabs - var $fieldsets = $this.find('> fieldset'); - if ($fieldsets.length === 0) { + // Check if there are some details that can be converted to vertical-tabs + var $details = $this.find('> details'); + if ($details.length === 0) { return; } @@ -35,12 +35,12 @@ Drupal.behaviors.verticalTabs = { var tab_list = $(''); $this.wrap('
').before(tab_list); - // Transform each fieldset into a tab. - $fieldsets.each(function () { + // Transform each details into a tab. + $details.each(function () { var $this = $(this); var vertical_tab = new Drupal.verticalTab({ - title: $this.find('> legend').text(), - fieldset: $this + title: $this.find('> summary').text(), + details: $this }); tab_list.append(vertical_tab.item); $this @@ -79,7 +79,7 @@ Drupal.behaviors.verticalTabs = { * @param settings * An object with the following keys: * - title: The name of the tab. - * - fieldset: The jQuery object of the fieldset that is the tab pane. + * - details: The jQuery object of the details element that is the tab pane. */ Drupal.verticalTab = function (settings) { var self = this; @@ -96,12 +96,12 @@ Drupal.verticalTab = function (settings) { event.preventDefault(); if (event.keyCode === 13) { self.focus(); - // Set focus on the first input field of the visible fieldset/tab pane. - $("fieldset.vertical-tabs-pane :input:visible:enabled:first").focus(); + // Set focus on the first input field of the visible details/tab pane. + $(".vertical-tabs-pane :input:visible:enabled:first").focus(); } }); - this.fieldset + this.details .bind('summaryUpdated', function () { self.updateSummary(); }) @@ -113,17 +113,17 @@ Drupal.verticalTab.prototype = { * Displays the tab's content pane. */ focus: function () { - this.fieldset - .siblings('fieldset.vertical-tabs-pane') + this.details + .siblings('.vertical-tabs-pane') .each(function () { var tab = $(this).data('verticalTab'); - tab.fieldset.hide(); + tab.details.hide(); tab.item.removeClass('selected'); }) .end() .show() .siblings(':hidden.vertical-tabs-active-tab') - .val(this.fieldset.attr('id')); + .val(this.details.attr('id')); this.item.addClass('selected'); // Mark the active tab for screen readers. $('#active-vertical-tab').remove(); @@ -134,7 +134,7 @@ Drupal.verticalTab.prototype = { * Updates the tab's summary. */ updateSummary: function () { - this.summary.html(this.fieldset.drupalGetSummary()); + this.summary.html(this.details.drupalGetSummary()); }, /** @@ -148,8 +148,8 @@ Drupal.verticalTab.prototype = { // method. this.item.parent().children('.vertical-tab-button').removeClass('first') .filter(':visible:first').addClass('first'); - // Display the fieldset. - this.fieldset.removeClass('vertical-tab-hidden').show(); + // Display the details element. + this.details.removeClass('vertical-tab-hidden').show(); // Focus this tab. this.focus(); return this; @@ -166,10 +166,10 @@ Drupal.verticalTab.prototype = { // method. this.item.parent().children('.vertical-tab-button').removeClass('first') .filter(':visible:first').addClass('first'); - // Hide the fieldset. - this.fieldset.addClass('vertical-tab-hidden').hide(); + // Hide the details element. + this.details.addClass('vertical-tab-hidden').hide(); // Focus the first visible tab (if there is one). - var $firstTab = this.fieldset.siblings('.vertical-tabs-pane:not(.vertical-tab-hidden):first'); + var $firstTab = this.details.siblings('.vertical-tabs-pane:not(.vertical-tab-hidden):first'); if ($firstTab.length) { $firstTab.data('verticalTab').focus(); } diff --git a/core/modules/action/action.admin.inc b/core/modules/action/action.admin.inc index f130111..c9db258 100644 --- a/core/modules/action/action.admin.inc +++ b/core/modules/action/action.admin.inc @@ -96,7 +96,7 @@ function action_admin_manage() { */ function action_admin_manage_form($form, &$form_state, $options = array()) { $form['parent'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Create an advanced action'), '#attributes' => array('class' => array('container-inline')), ); diff --git a/core/modules/aggregator/aggregator.admin.inc b/core/modules/aggregator/aggregator.admin.inc index a859e85..9b9d2be 100644 --- a/core/modules/aggregator/aggregator.admin.inc +++ b/core/modules/aggregator/aggregator.admin.inc @@ -538,7 +538,7 @@ function aggregator_admin_form($form, $form_state) { } if (count($basic_conf)) { $form['basic_conf'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Basic configuration'), '#description' => t('For most aggregation tasks, the default settings are fine.'), '#collapsible' => TRUE, diff --git a/core/modules/aggregator/aggregator.processor.inc b/core/modules/aggregator/aggregator.processor.inc index b333a96..f00edc5 100644 --- a/core/modules/aggregator/aggregator.processor.inc +++ b/core/modules/aggregator/aggregator.processor.inc @@ -79,10 +79,10 @@ function aggregator_form_aggregator_admin_form_alter(&$form, $form_state) { $period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800), 'format_interval'); $period[AGGREGATOR_CLEAR_NEVER] = t('Never'); - // Only wrap into a collapsible fieldset if there is a basic configuration. + // Only wrap into a collapsible details if there is a basic configuration. if (isset($form['basic_conf'])) { $form['modules']['aggregator'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Default processor settings'), '#description' => $info['description'], '#collapsible' => TRUE, diff --git a/core/modules/block/block.admin.inc b/core/modules/block/block.admin.inc index 2a17a55..f632232 100644 --- a/core/modules/block/block.admin.inc +++ b/core/modules/block/block.admin.inc @@ -303,7 +303,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) { // Region settings. $form['regions'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Region settings'), '#collapsible' => FALSE, '#description' => t('Specify in which themes and regions this block is displayed.'), @@ -355,7 +355,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) { // Per-path visibility. $form['visibility']['path'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Pages'), '#collapsible' => TRUE, '#collapsed' => TRUE, @@ -429,7 +429,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) { $langcodes_options[$language->langcode] = $language->name; } $form['visibility']['language'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Languages'), '#collapsible' => TRUE, '#collapsed' => TRUE, @@ -467,7 +467,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) { ))->fetchCol(); $role_options = array_map('check_plain', user_roles()); $form['visibility']['role'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Roles'), '#collapsible' => TRUE, '#collapsed' => TRUE, @@ -484,7 +484,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) { // Per-user visibility. $form['visibility']['user'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Users'), '#collapsible' => TRUE, '#collapsed' => TRUE, diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 2978146..e733525 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -611,10 +611,10 @@ function block_form_user_profile_form_alter(&$form, &$form_state) { ); } } - // Only display the fieldset if there are any personalizable blocks. + // Only display the form element if there are any personalizable blocks. if ($blocks) { $form['block'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Personalize blocks'), '#description' => t('Blocks consist of content or information that complements the main content of the page. Enable or disable optional blocks using the checkboxes below.'), '#weight' => 3, diff --git a/core/modules/book/book.js b/core/modules/book/book.js index 301c67f..d1c54c8 100644 --- a/core/modules/book/book.js +++ b/core/modules/book/book.js @@ -8,9 +8,9 @@ "use strict"; -Drupal.behaviors.bookFieldsetSummaries = { +Drupal.behaviors.bookDetailsSummaries = { attach: function (context) { - $(context).find('fieldset.book-outline-form').drupalSetSummary(function (context) { + $(context).find('.book-outline-form').drupalSetSummary(function (context) { var $select = $(context).find('.book-title-select'); var val = $select.val(); diff --git a/core/modules/book/book.module b/core/modules/book/book.module index 7c43e28..e42bc88 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -419,7 +419,7 @@ function book_get_books() { /** * Implements hook_form_BASE_FORM_ID_alter() for node_form(). * - * Adds the book fieldset to the node form. + * Adds the book form element to the node form. * * @see book_pick_book_nojs_submit() */ @@ -535,7 +535,7 @@ function _book_add_form_elements(&$form, &$form_state, Node $node) { } $form['book'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Book outline'), '#weight' => 10, '#collapsible' => TRUE, diff --git a/core/modules/color/color.module b/core/modules/color/color.module index 56c04cf..53a7f39 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -39,7 +39,7 @@ function color_theme() { function color_form_system_theme_settings_alter(&$form, &$form_state) { if (isset($form_state['build_info']['args'][0]) && ($theme = $form_state['build_info']['args'][0]) && color_get_info($theme) && function_exists('gd_info')) { $form['color'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Color scheme'), '#weight' => -1, '#attributes' => array('id' => 'color_scheme_form'), diff --git a/core/modules/comment/comment-node-form.js b/core/modules/comment/comment-node-form.js index 0249d96..67800da 100644 --- a/core/modules/comment/comment-node-form.js +++ b/core/modules/comment/comment-node-form.js @@ -7,15 +7,15 @@ "use strict"; -Drupal.behaviors.commentFieldsetSummaries = { +Drupal.behaviors.commentDetailsSummaries = { attach: function (context) { var $context = $(context); - $context.find('fieldset.comment-node-settings-form').drupalSetSummary(function (context) { + $context.find('.comment-node-settings-form').drupalSetSummary(function (context) { return Drupal.checkPlain($(context).find('.form-item-comment input:checked').next('label').text()); }); // Provide the summary for the node type form. - $context.find('fieldset.comment-node-type-settings-form').drupalSetSummary(function(context) { + $context.find('.comment-node-type-settings-form').drupalSetSummary(function(context) { var $context = $(context); var vals = []; diff --git a/core/modules/comment/comment.admin.inc b/core/modules/comment/comment.admin.inc index dcbd1bc..734dbf6 100644 --- a/core/modules/comment/comment.admin.inc +++ b/core/modules/comment/comment.admin.inc @@ -44,7 +44,7 @@ function comment_admin($type = 'new') { function comment_admin_overview($form, &$form_state, $arg) { // Build an 'Update options' form. $form['options'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Update options'), '#attributes' => array('class' => array('container-inline')), ); diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index df0a33a..19109c5 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1069,7 +1069,7 @@ function comment_view_multiple($comments, $view_mode = 'full', $langcode = NULL) function comment_form_node_type_form_alter(&$form, $form_state) { if (isset($form['type'])) { $form['comment'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Comment settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, @@ -1146,7 +1146,7 @@ function comment_form_node_type_form_alter(&$form, $form_state) { function comment_form_node_form_alter(&$form, $form_state) { $node = $form_state['controller']->getEntity($form_state); $form['comment_settings'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#access' => user_access('administer comments'), '#title' => t('Comment settings'), '#collapsible' => TRUE, diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php index cead0cd..7460f71 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php @@ -49,10 +49,10 @@ public function form(array $form, array &$form_state, EntityInterface $comment) $form['author'] = array( '#weight' => 10, ); - // Display author information in a fieldset for comment moderators. + // Display author information in a details element for comment moderators. if ($is_admin) { $form['author'] += array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Administration'), '#collapsible' => TRUE, '#collapsed' => TRUE, diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index 1087308..f357e5a 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -304,7 +304,7 @@ function contact_mail($key, &$message, $params) { */ function contact_form_user_profile_form_alter(&$form, &$form_state) { $form['contact'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Contact settings'), '#weight' => 5, '#collapsible' => TRUE, @@ -334,7 +334,7 @@ function contact_user_presave($account) { */ function contact_form_user_admin_settings_alter(&$form, &$form_state) { $form['contact'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Contact settings'), '#weight' => 0, ); diff --git a/core/modules/dblog/dblog.admin.inc b/core/modules/dblog/dblog.admin.inc index 012d01e..faeac67 100644 --- a/core/modules/dblog/dblog.admin.inc +++ b/core/modules/dblog/dblog.admin.inc @@ -307,7 +307,7 @@ function dblog_filter_form($form) { $filters = dblog_filters(); $form['filters'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Filter log messages'), '#collapsible' => TRUE, '#collapsed' => empty($_SESSION['dblog_overview_filter']), @@ -384,7 +384,7 @@ function dblog_filter_form_submit($form, &$form_state) { */ function dblog_clear_log_form($form) { $form['dblog_clear'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Clear log messages'), '#description' => t('This will permanently remove the log messages from the database.'), '#collapsible' => TRUE, 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 4c5e5da..4f69b05 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 @@ -451,7 +451,7 @@ function multiple_options_form(&$form, &$form_state) { $field = $this->field_info; $form['multiple_field_settings'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Multiple field settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, 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 fab06fa..1705391 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 @@ -311,7 +311,7 @@ function field_test_entity_nested_form($form, &$form_state, $entity_1, $entity_2 // Second entity. $form['entity_2'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Second entity'), '#tree' => TRUE, '#parents' => array('entity_2'), diff --git a/core/modules/field_ui/field_ui.admin.inc b/core/modules/field_ui/field_ui.admin.inc index 7f58240..61a91d6 100644 --- a/core/modules/field_ui/field_ui.admin.inc +++ b/core/modules/field_ui/field_ui.admin.inc @@ -562,7 +562,7 @@ function field_ui_field_settings_form($form, &$form_state, $instance) { // Create a form structure for the field values. $form['field'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Field settings'), '#description' => $description, '#tree' => TRUE, @@ -656,7 +656,7 @@ function field_ui_widget_type_form($form, &$form_state, FieldInstance $instance) ); $form['basic'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Change widget'), ); $form['basic']['widget_type'] = array( @@ -815,15 +815,15 @@ function field_ui_field_edit_form($form, &$form_state, $instance) { // Create a form structure for the instance values. $form['instance'] = array( '#tree' => TRUE, - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('%type settings', array('%type' => $bundles[$entity_type][$bundle]['label'])), '#description' => t('These settings apply only to the %field field when used in the %type type.', array( '%field' => $instance['label'], '%type' => $bundles[$entity_type][$bundle]['label'], )), // Ensure field_ui_field_edit_instance_pre_render() gets called in addition - // to, not instead of, the #pre_render function(s) needed by all fieldsets. - '#pre_render' => array_merge(array('field_ui_field_edit_instance_pre_render'), element_info_property('fieldset', '#pre_render', array())), + // to, not instead of, the #pre_render function(s) needed by all details. + '#pre_render' => array_merge(array('field_ui_field_edit_instance_pre_render'), element_info_property('details', '#pre_render', array())), ); // Build the non-configurable instance values. @@ -908,7 +908,7 @@ function field_ui_field_edit_form($form, &$form_state, $instance) { // Create a form structure for the field values. $form['field'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#collapsible' => TRUE, '#collapsed' => TRUE, '#title' => t('Global settings'), @@ -966,7 +966,7 @@ function field_ui_field_edit_form_delete_submit($form, &$form_state) { /** * Render API callback: Merges instance, widget and other settings. * - * Combines the instance, widget, and other settings into a single fieldset so + * Combines the instance, widget, and other settings into a single details so * that elements within each group can be shown at different weights as if they * all had the same parent. * @@ -994,14 +994,14 @@ function field_ui_field_edit_instance_pre_render($element) { } /** - * Builds the default value fieldset for a given field instance. + * Builds the default value widget for a given field instance. */ function field_ui_default_value_widget($field, $instance, &$form, &$form_state) { $field_name = $field['field_name']; $entity = $form['#entity']; $element = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Default value'), '#collapsible' => FALSE, '#tree' => TRUE, diff --git a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php index 086f6ee..4e26616 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php @@ -337,7 +337,7 @@ public function form(array $form, array &$form_state) { // Only show the settings if there is more than one view mode. if (count($view_modes) > 1) { $form['modes'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Custom display settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php index 96f59a2..c61039f 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php @@ -168,11 +168,11 @@ function testViewModeCustom() { } /** - * Tests hiding the view modes fieldset when there's only one available. + * Tests hiding the view modes widget when there's only one available. */ function testSingleViewMode() { $this->drupalGet('admin/config/people/accounts/display'); - $this->assertNoText('Use custom display settings for the following view modes', 'Custom display settings fieldset found.'); + $this->assertNoText('Use custom display settings for the following view modes'); // This may not trigger a notice when 'view_modes_custom' isn't available. $this->drupalPost('admin/config/people/accounts/display', array(), t('Save')); diff --git a/core/modules/file/file.field.inc b/core/modules/file/file.field.inc index cbd55e9..4f1db3e 100644 --- a/core/modules/file/file.field.inc +++ b/core/modules/file/file.field.inc @@ -437,7 +437,7 @@ function file_field_widget_form(&$form, &$form_state, $field, $instance, $langco // after building up the full list (like draggable table rows). $elements['#file_upload_delta'] = $delta; $elements['#theme'] = 'file_widget_multiple'; - $elements['#theme_wrappers'] = array('fieldset'); + $elements['#theme_wrappers'] = array('details'); $elements['#process'] = array('file_field_widget_process_multiple'); $elements['#title'] = $element['#title']; $elements['#description'] = $element['#description']; diff --git a/core/modules/filter/filter.admin-rtl.css b/core/modules/filter/filter.admin-rtl.css index c49481b..10620bf 100644 --- a/core/modules/filter/filter.admin-rtl.css +++ b/core/modules/filter/filter.admin-rtl.css @@ -7,10 +7,6 @@ /** * Filter information under field. */ -.filter-wrapper .form-item { - float: right; - padding: 0 1.5em 0.5em 0; -} .filter-help { float: left; } diff --git a/core/modules/filter/filter.admin.css b/core/modules/filter/filter.admin.css index fdb2eff..db3898e 100644 --- a/core/modules/filter/filter.admin.css +++ b/core/modules/filter/filter.admin.css @@ -7,18 +7,16 @@ /** * Filter information under field. */ -.text-format-wrapper .form-item { +.text-format-wrapper > .form-item { margin-bottom: 0; } .filter-wrapper { border-top: 0; margin: 0; - padding: 1.5em 0; } .filter-wrapper .form-item { - float: left; /* LTR */ - padding: 0 0 0.5em 1.5em; /* LTR */ + margin-top: 0; } .filter-wrapper .form-item label { display: inline; @@ -26,7 +24,6 @@ .filter-help { float: right; /* LTR */ - padding: 0 1.5em 0.5em; } .filter-help p { margin: 0; @@ -36,10 +33,6 @@ padding: 0 20px; } -.filter-guidelines { - clear: left; - padding: 0 1.5em; -} .text-format-wrapper .description { margin-top: 0.5em; } diff --git a/core/modules/filter/filter.admin.inc b/core/modules/filter/filter.admin.inc index 4f56856..c01fb93 100644 --- a/core/modules/filter/filter.admin.inc +++ b/core/modules/filter/filter.admin.inc @@ -284,7 +284,7 @@ function filter_admin_format_form($form, &$form_state, $format) { $settings_form = $function($form, $form_state, $filters[$name], $format, $defaults, $filters); if (!empty($settings_form)) { $form['filters']['settings'][$name] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => $filter['title'], '#parents' => array('filters', $name, 'settings'), '#weight' => $filter['weight'], diff --git a/core/modules/filter/filter.admin.js b/core/modules/filter/filter.admin.js index b2d7c6e..f55159a 100644 --- a/core/modules/filter/filter.admin.js +++ b/core/modules/filter/filter.admin.js @@ -38,7 +38,7 @@ Drupal.behaviors.filterStatus = { // Attach summary for configurable filters (only for screen-readers). if (tab) { - tab.fieldset.drupalSetSummary(function (tabContext) { + tab.details.drupalSetSummary(function (tabContext) { return $checkbox.is(':checked') ? Drupal.t('Enabled') : Drupal.t('Disabled'); }); } diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index b55066f..a9619ae 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -53,7 +53,7 @@ function filter_help($path, $arg) { $output .= '
' . t('Defining text formats') . '
'; $output .= '
' . t('One format is included by default: Plain text (which removes all HTML tags). Additional formats may be created by your installation profile when you install Drupal, and more can be created by an administrator on the Text formats page.', array('@text-formats' => url('admin/config/content/formats'))) . '
'; $output .= '
' . t('Choosing a text format') . '
'; - $output .= '
' . t('Users with access to more than one text format can use the Text format fieldset to choose between available text formats when creating or editing multi-line content. Administrators can define the text formats available to each user role, and control the order of formats listed in the Text format fieldset on the Text formats page.', array('@text-formats' => url('admin/config/content/formats'))) . '
'; + $output .= '
' . t('Users with access to more than one text format can use the Text format widget to choose between available text formats when creating or editing multi-line content. Administrators can define the text formats available to each user role, and control the order of formats listed in the Text format widget on the Text formats page.', array('@text-formats' => url('admin/config/content/formats'))) . '
'; $output .= ''; return $output; @@ -905,7 +905,7 @@ function check_markup($text, $format_id = NULL, $langcode = '', $cache = FALSE, * selector: * - value: Holds the original element, having its #type changed to the value * of #base_type or 'textarea' by default. - * - format: Holds the text format fieldset and the text format selection, + * - format: Holds the text format details and the text format selection, * using the text format ID specified in #format or the user's default format * by default, if NULL. * @@ -967,7 +967,7 @@ function filter_process_format($element) { // Setup child container for the text format widget. $element['format'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#attributes' => array('class' => array('filter-wrapper')), ); diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php index 67e58a2..e5d7f39 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php @@ -312,9 +312,9 @@ private function doAdminTests($user) { // Test tags vocabulary term form is not affected. $this->drupalGet('admin/structure/taxonomy/tags/add'); $this->assertField('parent[]', 'Parent field found.'); - // Test relations fieldset exists. - $relations_fieldset = $this->xpath("//fieldset[@id='edit-relations']"); - $this->assertTrue(isset($relations_fieldset[0]), 'Relations fieldset element found.'); + // Test relations widget exists. + $relations_widget = $this->xpath("//details[@id='edit-relations']"); + $this->assertTrue(isset($relations_widget[0]), 'Relations widget element found.'); } /** diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc index b365937..87818fb 100644 --- a/core/modules/language/language.admin.inc +++ b/core/modules/language/language.admin.inc @@ -647,7 +647,7 @@ function language_negotiation_configure_url_form($form, &$form_state) { ); $form['prefix'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#tree' => TRUE, '#title' => t('Path prefix configuration'), '#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".'), @@ -660,7 +660,7 @@ function language_negotiation_configure_url_form($form, &$form_state) { ), ); $form['domain'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#tree' => TRUE, '#title' => t('Domain configuration'), '#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".'), @@ -873,7 +873,7 @@ function language_negotiation_configure_browser_form($form, &$form_state) { // Add empty row. $form['new_mapping'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Add a new mapping'), '#collapsible' => TRUE, '#collapsed' => TRUE, diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php index 61bfcf3..5379364 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php @@ -87,7 +87,7 @@ function testContentTypeLanguageConfiguration() { // Set the content type to use multilingual support. $this->drupalGet("admin/structure/types/manage/{$type2->type}"); - $this->assertText(t('Language settings'), 'Multilingual support fieldset present on content type configuration form.'); + $this->assertText(t('Language settings'), 'Multilingual support widget present on content type configuration form.'); $edit = array( 'language_configuration[language_hidden]' => FALSE, ); diff --git a/core/modules/locale/locale.admin.css b/core/modules/locale/locale.admin.css index 4b252b6..e5ccd61 100644 --- a/core/modules/locale/locale.admin.css +++ b/core/modules/locale/locale.admin.css @@ -37,7 +37,7 @@ position: absolute; } -#locale-translate-filter-form fieldset.form-wrapper { +#locale-translate-filter-form .form-wrapper { margin-bottom:0; } diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index 0be2aec..d29cf6f 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -174,7 +174,7 @@ function locale_translate_export_form($form, &$form_state) { '#empty_value' => LANGUAGE_SYSTEM, ); $form['content_options'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Export options'), '#collapsible' => TRUE, '#collapsed' => TRUE, diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index 8ea8780..72f1793 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -167,7 +167,7 @@ function locale_translate_filter_form($form, &$form_state) { ); $form['filters'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Filter translatable strings'), '#collapsible' => TRUE, '#collapsed' => FALSE, diff --git a/core/modules/menu/menu.admin.js b/core/modules/menu/menu.admin.js index d6a228a..530c8b6 100644 --- a/core/modules/menu/menu.admin.js +++ b/core/modules/menu/menu.admin.js @@ -13,10 +13,10 @@ Drupal.behaviors.menuChangeParentItems = { * Function to set the options of the menu parent item dropdown. */ Drupal.menuUpdateParentList = function () { - var $menuFieldset = $('#edit-menu'); + var $menu = $('#edit-menu'); var values = []; - $menuFieldset.find('input:checked').each(function () { + $menu.find('input:checked').each(function () { // Get the names of all checked menus. values.push(Drupal.checkPlain($.trim($(this).val()))); }); diff --git a/core/modules/menu/menu.js b/core/modules/menu/menu.js index 1990374..77baddb 100644 --- a/core/modules/menu/menu.js +++ b/core/modules/menu/menu.js @@ -2,9 +2,9 @@ "use strict"; -Drupal.behaviors.menuFieldsetSummaries = { +Drupal.behaviors.menuDetailsSummaries = { attach: function (context) { - $(context).find('fieldset.menu-link-form').drupalSetSummary(function (context) { + $(context).find('.menu-link-form').drupalSetSummary(function (context) { var $context = $(context); if ($context.find('.form-item-menu-enabled input').is(':checked')) { return Drupal.checkPlain($context.find('.form-item-menu-link-title input').val()); @@ -22,7 +22,7 @@ Drupal.behaviors.menuFieldsetSummaries = { Drupal.behaviors.menuLinkAutomaticTitle = { attach: function (context) { var $context = $(context); - $context.find('fieldset.menu-link-form').each(function () { + $context.find('.menu-link-form').each(function () { var $this = $(this); // Try to find menu settings widget elements as well as a 'title' field in // the form, but play nicely with user permissions and form alterations. @@ -53,7 +53,7 @@ Drupal.behaviors.menuLinkAutomaticTitle = { $link_title.val(''); $link_title.removeData('menuLinkAutomaticTitleOveridden'); } - $checkbox.closest('fieldset.vertical-tabs-pane').trigger('summaryUpdated'); + $checkbox.closest('.vertical-tabs-pane').trigger('summaryUpdated'); $checkbox.trigger('formUpdated'); }); // Take over any title change. diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index a55660b..8b959cd 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -643,7 +643,7 @@ function menu_form_node_form_alter(&$form, $form_state) { } $form['menu'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Menu settings'), '#access' => user_access('administer menu'), '#collapsible' => TRUE, @@ -750,7 +750,7 @@ function menu_form_node_type_form_alter(&$form, $form_state) { $menu_options = menu_get_menus(); $type = $form['#node_type']; $form['menu'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Menu settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, diff --git a/core/modules/node/content_types.inc b/core/modules/node/content_types.inc index a7faa59..7d3ff61 100644 --- a/core/modules/node/content_types.inc +++ b/core/modules/node/content_types.inc @@ -154,7 +154,7 @@ function node_type_form($form, &$form_state, $type = NULL) { ); $form['submission'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Submission form settings'), '#collapsible' => TRUE, '#group' => 'additional_settings', @@ -189,7 +189,7 @@ function node_type_form($form, &$form_state, $type = NULL) { '#description' => t('This text will be displayed at the top of the page when creating or editing content of this type.'), ); $form['workflow'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Publishing options'), '#collapsible' => TRUE, '#collapsed' => TRUE, @@ -208,7 +208,7 @@ function node_type_form($form, &$form_state, $type = NULL) { ); if (module_exists('language')) { $form['language'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Language settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, @@ -227,7 +227,7 @@ function node_type_form($form, &$form_state, $type = NULL) { $form['#submit'][] = 'language_configuration_element_submit'; } $form['display'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Display settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, diff --git a/core/modules/node/content_types.js b/core/modules/node/content_types.js index d2a63b6..f85ba7b 100644 --- a/core/modules/node/content_types.js +++ b/core/modules/node/content_types.js @@ -6,12 +6,12 @@ Drupal.behaviors.contentTypes = { attach: function (context) { var $context = $(context); // Provide the vertical tab summaries. - $context.find('fieldset#edit-submission').drupalSetSummary(function(context) { + $context.find('#edit-submission').drupalSetSummary(function(context) { var vals = []; vals.push(Drupal.checkPlain($(context).find('#edit-title-label').val()) || Drupal.t('Requires a title')); return vals.join(', '); }); - $context.find('fieldset#edit-workflow').drupalSetSummary(function(context) { + $context.find('#edit-workflow').drupalSetSummary(function(context) { var vals = []; $(context).find("input[name^='node_options']:checked").parent().each(function() { vals.push(Drupal.checkPlain($(this).text())); @@ -21,7 +21,7 @@ Drupal.behaviors.contentTypes = { } return vals.join(', '); }); - $('fieldset#edit-language', context).drupalSetSummary(function(context) { + $('#edit-language', context).drupalSetSummary(function(context) { var vals = []; vals.push($(".form-item-language-configuration-langcode select option:selected", context).text()) @@ -32,7 +32,7 @@ Drupal.behaviors.contentTypes = { return vals.join(', '); }); - $context.find('fieldset#edit-display').drupalSetSummary(function(context) { + $context.find('#edit-display').drupalSetSummary(function(context) { var vals = []; var $context = $(context); $context.find('input:checked').next('label').each(function() { diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php index 5add3df..073c910 100644 --- a/core/modules/node/lib/Drupal/node/NodeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeFormController.php @@ -115,7 +115,7 @@ public function form(array $form, array &$form_state, EntityInterface $node) { // Add a log field if the "Create new revision" option is checked, or if the // current user has the ability to check that option. $form['revision_information'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Revision information'), '#collapsible' => TRUE, // Collapsed by default when "Create new revision" is unchecked. @@ -159,7 +159,7 @@ public function form(array $form, array &$form_state, EntityInterface $node) { // Node author information for administrators. $form['author'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#access' => user_access('administer nodes'), '#title' => t('Authoring information'), '#collapsible' => TRUE, @@ -200,7 +200,7 @@ public function form(array $form, array &$form_state, EntityInterface $node) { // Node options for administrators. $form['options'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#access' => user_access('administer nodes'), '#title' => t('Publishing options'), '#collapsible' => TRUE, diff --git a/core/modules/node/node.admin.inc b/core/modules/node/node.admin.inc index 2ca2d3e..fbb6e22 100644 --- a/core/modules/node/node.admin.inc +++ b/core/modules/node/node.admin.inc @@ -165,7 +165,7 @@ function node_filter_form() { $i = 0; $form['filters'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Show only items where'), '#theme' => 'exposed_filters__node', ); @@ -431,7 +431,7 @@ function node_admin_nodes() { // Build the 'Update options' form. $form['options'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Update options'), '#attributes' => array('class' => array('container-inline')), '#access' => $admin_access, diff --git a/core/modules/node/node.js b/core/modules/node/node.js index 0899d3c..d4c5dc7 100644 --- a/core/modules/node/node.js +++ b/core/modules/node/node.js @@ -2,10 +2,10 @@ "use strict"; -Drupal.behaviors.nodeFieldsetSummaries = { +Drupal.behaviors.nodeDetailsSummaries = { attach: function (context) { var $context = $(context); - $context.find('fieldset.node-form-revision-information').drupalSetSummary(function (context) { + $context.find('.node-form-revision-information').drupalSetSummary(function (context) { var $context = $(context); var revisionCheckbox = $context.find('.form-item-revision input'); @@ -20,7 +20,7 @@ Drupal.behaviors.nodeFieldsetSummaries = { return Drupal.t('No revision'); }); - $context.find('fieldset.node-form-author').drupalSetSummary(function (context) { + $context.find('.node-form-author').drupalSetSummary(function (context) { var $context = $(context); var name = $context.find('.form-item-name input').val() || Drupal.settings.anonymous, date = $context.find('.form-item-date input').val(); @@ -29,7 +29,7 @@ Drupal.behaviors.nodeFieldsetSummaries = { Drupal.t('By @name', { '@name': name }); }); - $context.find('fieldset.node-form-options').drupalSetSummary(function (context) { + $context.find('.node-form-options').drupalSetSummary(function (context) { var $context = $(context); var vals = []; diff --git a/core/modules/node/node.module b/core/modules/node/node.module index a09aee1..6bca51d 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -1377,7 +1377,7 @@ function node_search_status() { function node_search_admin() { // Output form for defining rank factor weights. $form['content_ranking'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Content ranking'), ); $form['content_ranking']['#theme'] = 'node_search_admin'; @@ -2144,7 +2144,7 @@ function node_form_block_admin_configure_alter(&$form, &$form_state) { ':delta' => $form['delta']['#value'], ))->fetchCol(); $form['visibility']['node_type'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Content types'), '#collapsible' => TRUE, '#collapsed' => TRUE, @@ -2545,7 +2545,7 @@ function node_form_search_form_alter(&$form, $form_state) { if (isset($form['module']) && $form['module']['#value'] == 'node' && user_access('use advanced search')) { // Keyword boxes: $form['advanced'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Advanced search'), '#collapsible' => TRUE, '#collapsed' => TRUE, diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module index 6d78e43..263b07f 100644 --- a/core/modules/overlay/overlay.module +++ b/core/modules/overlay/overlay.module @@ -88,7 +88,7 @@ function overlay_form_user_profile_form_alter(&$form, &$form_state) { $account = $form_state['controller']->getEntity($form_state); if (user_access('access overlay', $account)) { $form['overlay_control'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Administrative overlay'), '#weight' => 4, '#collapsible' => TRUE, diff --git a/core/modules/path/path.admin.inc b/core/modules/path/path.admin.inc index 5465141..e78502c 100644 --- a/core/modules/path/path.admin.inc +++ b/core/modules/path/path.admin.inc @@ -296,7 +296,7 @@ function path_admin_delete_confirm_submit($form, &$form_state) { */ function path_admin_filter_form($form, &$form_state, $keys = '') { $form['#attributes'] = array('class' => array('search-form')); - $form['basic'] = array('#type' => 'fieldset', + $form['basic'] = array('#type' => 'details', '#title' => t('Filter aliases'), '#attributes' => array('class' => array('container-inline')), ); diff --git a/core/modules/path/path.js b/core/modules/path/path.js index 41b6e8f..7349d12 100644 --- a/core/modules/path/path.js +++ b/core/modules/path/path.js @@ -6,9 +6,9 @@ "use strict"; -Drupal.behaviors.pathFieldsetSummaries = { +Drupal.behaviors.pathDetailsSummaries = { attach: function (context) { - $(context).find('fieldset.path-form').drupalSetSummary(function (context) { + $(context).find('.path-form').drupalSetSummary(function (context) { var path = $('.form-item-path-alias input').val(); return path ? diff --git a/core/modules/path/path.module b/core/modules/path/path.module index 6a69c13..74e8960 100644 --- a/core/modules/path/path.module +++ b/core/modules/path/path.module @@ -120,7 +120,7 @@ function path_form_node_form_alter(&$form, $form_state) { ); $form['path'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('URL path settings'), '#collapsible' => TRUE, '#collapsed' => empty($path['alias']), diff --git a/core/modules/poll/poll.module b/core/modules/poll/poll.module index c85f121..b4e70fa 100644 --- a/core/modules/poll/poll.module +++ b/core/modules/poll/poll.module @@ -318,7 +318,7 @@ function poll_form(Node $node, &$form_state) { $active = array(0 => t('Closed'), 1 => t('Active')); $form['settings'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#collapsible' => TRUE, '#title' => t('Poll settings'), '#weight' => -3, diff --git a/core/modules/search/search.admin.inc b/core/modules/search/search.admin.inc index 57e5d6b..ef70eb7 100644 --- a/core/modules/search/search.admin.inc +++ b/core/modules/search/search.admin.inc @@ -61,7 +61,7 @@ function search_admin_settings($form, &$form_state) { $count = format_plural($remaining, 'There is 1 item left to index.', 'There are @count items left to index.'); $percentage = ((int)min(100, 100 * ($total - $remaining) / max(1, $total))) . '%'; $status = '

' . t('%percentage of the site has been indexed.', array('%percentage' => $percentage)) . ' ' . $count . '

'; - $form['status'] = array('#type' => 'fieldset', '#title' => t('Indexing status')); + $form['status'] = array('#type' => 'details', '#title' => t('Indexing status')); $form['status']['status'] = array('#markup' => $status); $form['status']['wipe'] = array('#type' => 'submit', '#value' => t('Re-index site'), '#submit' => array('search_admin_reindex_submit')); @@ -69,7 +69,7 @@ function search_admin_settings($form, &$form_state) { // Indexing throttle: $form['indexing_throttle'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Indexing throttle') ); $form['indexing_throttle']['cron_limit'] = array( @@ -81,7 +81,7 @@ function search_admin_settings($form, &$form_state) { ); // Indexing settings: $form['indexing_settings'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Indexing settings') ); $form['indexing_settings']['info'] = array( @@ -103,7 +103,7 @@ function search_admin_settings($form, &$form_state) { ); $form['active'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Active search modules') ); $module_options = _search_get_module_names(); diff --git a/core/modules/search/search.api.php b/core/modules/search/search.api.php index 0dd0a84..e3c8cbb 100644 --- a/core/modules/search/search.api.php +++ b/core/modules/search/search.api.php @@ -133,7 +133,7 @@ function hook_search_status() { function hook_search_admin() { // Output form for defining rank factor weights. $form['content_ranking'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Content ranking'), ); $form['content_ranking']['#theme'] = 'node_search_admin'; diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php index 8abc198..8db5bde 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php @@ -276,13 +276,13 @@ function assertAssertion($message, $type, $status, $file, $function) { function getTestResults() { $results = array(); if ($this->parse()) { - if ($fieldset = $this->getResultFieldSet()) { + if ($details = $this->getResultFieldSet()) { // Code assumes this is the only test in group. - $results['summary'] = $this->asText($fieldset->div->div[1]); - $results['name'] = $this->asText($fieldset->legend); + $results['summary'] = $this->asText($details->div->div[1]); + $results['name'] = $this->asText($details->summary); $results['assertions'] = array(); - $tbody = $fieldset->div->table->tbody; + $tbody = $details->div->table->tbody; foreach ($tbody->tr as $row) { $assertion = array(); $assertion['message'] = $this->asText($row->td[0]); @@ -300,14 +300,14 @@ function getTestResults() { } /** - * Get the fieldset containing the results for group this test is in. + * Get the details containing the results for group this test is in. */ function getResultFieldSet() { - $fieldsets = $this->xpath('//fieldset'); + $all_details = $this->xpath('//details'); $info = $this->getInfo(); - foreach ($fieldsets as $fieldset) { - if ($this->asText($fieldset->legend) == $info['name']) { - return $fieldset; + foreach ($all_details as $details) { + if ($this->asText($details->summary) == $info['name']) { + return $details; } } return FALSE; diff --git a/core/modules/simpletest/simpletest.pages.inc b/core/modules/simpletest/simpletest.pages.inc index 337a62c..fcd90ab 100644 --- a/core/modules/simpletest/simpletest.pages.inc +++ b/core/modules/simpletest/simpletest.pages.inc @@ -10,7 +10,7 @@ */ function simpletest_test_form($form) { $form['tests'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Tests'), '#description' => t('Select the test(s) or test group(s) you would like to run, and click Run tests.'), ); @@ -41,7 +41,7 @@ function simpletest_test_form($form) { '#value' => t('Run tests'), ); $form['clean'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#collapsible' => FALSE, '#collapsed' => FALSE, '#title' => t('Clean test environment'), @@ -219,9 +219,9 @@ function simpletest_result_form($form, &$form_state, $test_id) { 'fail' => array(), ); - // Summary result fieldset. + // Summary result widget. $form['result'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Results'), ); $form['result']['summary'] = $summary = array( @@ -238,10 +238,10 @@ function simpletest_result_form($form, &$form_state, $test_id) { $header = array(t('Message'), t('Group'), t('Filename'), t('Line'), t('Function'), array('colspan' => 2, 'data' => t('Status'))); $form['result']['results'] = array(); foreach ($results as $group => $assertions) { - // Create group fieldset with summary information. + // Create group details with summary information. $info = call_user_func(array($group, 'getInfo')); $form['result']['results'][$group] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => $info['name'], '#description' => $info['description'], '#collapsible' => TRUE, @@ -289,7 +289,7 @@ function simpletest_result_form($form, &$form_state, $test_id) { // Actions. $form['#action'] = url('admin/config/development/testing/results/re-run'); $form['action'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Actions'), '#attributes' => array('class' => array('container-inline')), '#weight' => -11, @@ -437,7 +437,7 @@ function simpletest_result_status_image($status) { function simpletest_settings_form($form, &$form_state) { $config = config('simpletest.settings'); $form['general'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('General'), ); $form['general']['simpletest_clear_results'] = array( @@ -454,7 +454,7 @@ function simpletest_settings_form($form, &$form_state) { ); $form['httpauth'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('HTTP authentication'), '#description' => t('HTTP auth settings to be used by the SimpleTest browser during testing. Useful when the site requires basic HTTP authentication.'), '#collapsible' => TRUE, diff --git a/core/modules/statistics/statistics.admin.inc b/core/modules/statistics/statistics.admin.inc index bec1eb5..5e0e256 100644 --- a/core/modules/statistics/statistics.admin.inc +++ b/core/modules/statistics/statistics.admin.inc @@ -331,7 +331,7 @@ function statistics_settings_form($form, &$form_state) { $config = config('statistics.settings'); // Access log settings. $form['access'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Access log settings'), ); $form['access']['statistics_enable_access_log'] = array( @@ -350,7 +350,7 @@ function statistics_settings_form($form, &$form_state) { // Content counter settings. $form['content'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Content viewing counter settings'), ); $form['content']['statistics_count_content_views'] = array( diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/ArrayUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/ArrayUnitTest.php index 48425e2..ede0b0b 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/ArrayUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/ArrayUnitTest.php @@ -36,12 +36,12 @@ function setUp() { parent::setUp(); // Create a form structure with a nested element. - $this->form['fieldset']['element'] = array( + $this->form['details']['element'] = array( '#value' => 'Nested element', ); // Set up parent array. - $this->parents = array('fieldset', 'element'); + $this->parents = array('details', 'element'); } /** @@ -57,7 +57,7 @@ function testGet() { $value['#value'] = 'New value'; $value = drupal_array_get_nested_value($this->form, $this->parents); $this->assertEqual($value['#value'], 'New value', 'Nested element value was changed by reference.'); - $this->assertEqual($this->form['fieldset']['element']['#value'], 'New value', 'Nested element value was changed by reference.'); + $this->assertEqual($this->form['details']['element']['#value'], 'New value', 'Nested element value was changed by reference.'); // Verify that an existing key is reported back. $key_exists = NULL; @@ -83,8 +83,8 @@ function testSet() { // Verify setting the value of a nested element. drupal_array_set_nested_value($this->form, $this->parents, $new_value); - $this->assertEqual($this->form['fieldset']['element']['#value'], 'New value', 'Changed nested element value found.'); - $this->assertIdentical($this->form['fieldset']['element']['#required'], TRUE, 'New nested element value found.'); + $this->assertEqual($this->form['details']['element']['#value'], 'New value', 'Changed nested element value found.'); + $this->assertIdentical($this->form['details']['element']['#required'], TRUE, 'New nested element value found.'); } /** @@ -97,13 +97,13 @@ function testUnset() { $parents = $this->parents; $parents[] = 'foo'; drupal_array_unset_nested_value($this->form, $parents, $key_existed); - $this->assertTrue(isset($this->form['fieldset']['element']['#value']), 'Outermost nested element key still exists.'); + $this->assertTrue(isset($this->form['details']['element']['#value']), 'Outermost nested element key still exists.'); $this->assertIdentical($key_existed, FALSE, 'Non-existing key not found.'); // Verify unsetting a nested element. $key_existed = NULL; drupal_array_unset_nested_value($this->form, $this->parents, $key_existed); - $this->assertFalse(isset($this->form['fieldset']['element']), 'Removed nested element not found.'); + $this->assertFalse(isset($this->form['details']['element']), 'Removed nested element not found.'); $this->assertIdentical($key_existed, TRUE, 'Existing key was found.'); } 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 adc35ba..485dc50 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php @@ -94,7 +94,7 @@ function testDrupalRenderChildrenAttached() { $child_js = drupal_get_path('module', 'forum') . '/forum.js'; $subchild_js = drupal_get_path('module', 'book') . '/book.js'; $element = array( - '#type' => 'fieldset', + '#type' => 'details', '#cache' => array( 'keys' => array('simpletest', 'drupal_render', 'children_attached'), ), @@ -102,7 +102,7 @@ function testDrupalRenderChildrenAttached() { '#title' => 'Parent', ); $element['child'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#attached' => array('js' => array($child_js)), '#title' => 'Child', ); @@ -240,19 +240,19 @@ function testDrupalRenderFormElements() { )); $element = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => $this->randomName(), ); - $this->assertRenderedElement($element, '//fieldset/legend[contains(., :title)]', array( + $this->assertRenderedElement($element, '//details/summary[contains(., :title)]', array( ':title' => $element['#title'], )); $element = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => $this->randomName(), '#collapsible' => TRUE, ); - $this->assertRenderedElement($element, '//fieldset[contains(@class, :class)]', array( + $this->assertRenderedElement($element, '//details[contains(@class, :class)]', array( ':class' => 'collapsible', )); @@ -261,7 +261,7 @@ function testDrupalRenderFormElements() { '#title' => $this->randomName(), '#markup' => $this->randomName(), ); - $this->assertRenderedElement($element, '//fieldset/div/div[contains(@class, :class) and contains(., :markup)]', array( + $this->assertRenderedElement($element, '//details/div/div[contains(@class, :class) and contains(., :markup)]', array( ':class' => 'form-type-item', ':markup' => $element['item']['#markup'], )); diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index c55289c..6f1c540 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -248,7 +248,7 @@ function system_themes_page() { function system_themes_admin_form($form, &$form_state, $theme_options) { // Administration theme settings. $form['admin_theme'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Administration theme'), ); $form['admin_theme']['admin_theme'] = array( @@ -419,7 +419,7 @@ function system_theme_settings($form, &$form_state, $key = '') { } $form['theme_settings'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Toggle display'), '#description' => t('Enable or disable the display of certain page elements.'), ); @@ -434,7 +434,7 @@ function system_theme_settings($form, &$form_state, $key = '') { } if (!element_children($form['theme_settings'])) { - // If there is no element in the theme settings fieldset then do not show + // If there is no element in the theme settings details then do not show // it -- but keep it in the form if another module wants to alter. $form['theme_settings']['#access'] = FALSE; } @@ -442,7 +442,7 @@ function system_theme_settings($form, &$form_state, $key = '') { // Logo settings, only available when file.module is enabled. if ((!$key) || in_array('logo', $features) && module_exists('file')) { $form['logo'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Logo image settings'), '#attributes' => array('class' => array('theme-settings-bottom')), ); @@ -476,7 +476,7 @@ function system_theme_settings($form, &$form_state, $key = '') { if ((!$key) || in_array('favicon', $features) && module_exists('file')) { $form['favicon'] = array( - '#type' => 'fieldset', + '#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."), ); @@ -545,7 +545,7 @@ function system_theme_settings($form, &$form_state, $key = '') { $function = $themes[$key]->prefix . '_engine_settings'; if (function_exists($function)) { $form['engine_specific'] = array( - '#type' => 'fieldset', + '#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[$key]->prefix)), ); @@ -911,13 +911,13 @@ function system_modules($form, $form_state = array()) { $form['modules'][$module->info['package']][$filename] = _system_modules_build_row($module->info, $extra); } - // Add basic information to the fieldsets. + // Add basic information to the details. foreach (element_children($form['modules']) as $package) { $form['modules'][$package] += array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t($package), '#collapsible' => TRUE, - '#theme' => 'system_modules_fieldset', + '#theme' => 'system_modules_details', '#header' => array( array('data' => t('Enabled'), 'class' => array('checkbox')), t('Name'), @@ -925,12 +925,12 @@ function system_modules($form, $form_state = array()) { array('data' => t('Description'), 'class' => array(RESPONSIVE_PRIORITY_LOW)), array('data' => t('Operations'), 'colspan' => 3), ), - // Ensure that the "Core" package fieldset comes first. + // Ensure that the "Core" package comes first. '#weight' => $package == 'Core' ? -10 : NULL, ); } - // Lastly, sort all fieldsets by title. + // Lastly, sort all packages by title. uasort($form['modules'], 'element_sort_by_title'); $form['actions'] = array('#type' => 'actions'); @@ -1384,7 +1384,7 @@ function system_site_information_settings($form, &$form_state) { } $form['site_information'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Site details'), ); $form['site_information']['site_name'] = array( @@ -1407,7 +1407,7 @@ function system_site_information_settings($form, &$form_state) { '#required' => TRUE, ); $form['front_page'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Front page'), ); $form['front_page']['site_frontpage'] = array( @@ -1419,7 +1419,7 @@ function system_site_information_settings($form, &$form_state) { '#field_prefix' => url(NULL, array('absolute' => TRUE)), ); $form['error_page'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Error pages'), ); $form['error_page']['site_403'] = array( @@ -1513,7 +1513,7 @@ function system_cron_settings($form, &$form_state) { ); $form['cron'] = array( - '#type' => 'fieldset', + '#type' => 'details', ); $form['cron']['cron_safe_threshold'] = array( '#type' => 'select', @@ -1598,7 +1598,7 @@ function system_performance_settings($form, &$form_state) { $config = config('system.performance'); $form['clear_cache'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Clear cache'), ); @@ -1609,7 +1609,7 @@ function system_performance_settings($form, &$form_state) { ); $form['caching'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Caching'), ); @@ -1639,7 +1639,7 @@ function system_performance_settings($form, &$form_state) { } $form['bandwidth_optimization'] = array( - '#type' => 'fieldset', + '#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, ); @@ -1862,7 +1862,7 @@ function system_regional_settings() { $zones = system_time_zones(); $form['locale'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Locale'), ); @@ -1883,7 +1883,7 @@ function system_regional_settings() { ); $form['timezone'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Time zones'), ); @@ -2493,13 +2493,12 @@ function theme_status_report($variables) { * * @ingroup themeable */ -function theme_system_modules_fieldset($variables) { +function theme_system_modules_details($variables) { $form = $variables['form']; // Individual table headers. $rows = array(); - // Iterate through all the modules, which are - // children of this fieldset. + // Iterate through all the modules, which are children of this element. foreach (element_children($form) as $key) { // Stick it into $module for easier accessing. $module = $form[$key]; diff --git a/core/modules/system/system.base.css b/core/modules/system/system.base.css index c50b085..39b454d 100644 --- a/core/modules/system/system.base.css +++ b/core/modules/system/system.base.css @@ -38,25 +38,13 @@ } /** - * Collapsible fieldsets. + * Collapsible details. * * @see collapse.js */ -.js fieldset.collapsed { - border-bottom-width: 0; - border-left-width: 0; - border-right-width: 0; - height: 1em; -} -.js fieldset.collapsed .fieldset-wrapper { +.js details.collapsed .details-wrapper { display: none; } -fieldset.collapsible { - position: relative; -} -fieldset.collapsible .fieldset-legend { - display: block; -} /** * Resizable textareas. @@ -192,8 +180,8 @@ tr .ajax-progress-throbber .throbber { .container-inline label { display: inline; } -/* Fieldset contents always need to be rendered as block. */ -.container-inline .fieldset-wrapper { +/* Details contents always need to be rendered as block. */ +.container-inline .details-wrapper { display: block; } @@ -216,7 +204,7 @@ tr .ajax-progress-throbber .throbber { * Hide elements from all users. * * Used for elements which should not be immediately displayed to any user. An - * example would be a collapsible fieldset that will be expanded with a click + * example would be collapsible details that will be expanded with a click * from a user. The effect of this class can be toggled with the jQuery show() * and hide() functions. */ diff --git a/core/modules/system/system.module b/core/modules/system/system.module index a9d951b..5ffb660 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -150,7 +150,7 @@ function system_theme() { 'confirm_form' => array( 'render element' => 'form', ), - 'system_modules_fieldset' => array( + 'system_modules_details' => array( 'render element' => 'form', 'file' => 'system.admin.inc', ), @@ -526,10 +526,17 @@ function system_element_info() { '#collapsible' => FALSE, '#collapsed' => FALSE, '#value' => NULL, - '#process' => array('form_process_fieldset', 'ajax_process_form'), - '#pre_render' => array('form_pre_render_fieldset'), + '#process' => array('ajax_process_form'), '#theme_wrappers' => array('fieldset'), ); + $types['details'] = array( + '#collapsible' => FALSE, + '#collapsed' => FALSE, + '#value' => NULL, + '#process' => array('form_process_details', 'ajax_process_form'), + '#pre_render' => array('form_pre_render_details'), + '#theme_wrappers' => array('details'), + ); $types['vertical_tabs'] = array( '#theme_wrappers' => array('vertical_tabs'), '#default_tab' => '', @@ -1260,9 +1267,9 @@ function system_library_info() { ), ); - // Drupal's collapsible fieldset. + // Drupal's collapsible details. $libraries['drupal.collapse'] = array( - 'title' => 'Drupal collapsible fieldset', + 'title' => 'Drupal collapsible details', 'version' => VERSION, 'js' => array( 'core/misc/collapse.js' => array('group' => JS_DEFAULT), @@ -2469,7 +2476,7 @@ function system_user_timezone(&$form, &$form_state) { $account = $form_state['controller']->getEntity($form_state); $form['timezone'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Locale settings'), '#weight' => 6, '#collapsible' => TRUE, diff --git a/core/modules/system/system.theme-rtl.css b/core/modules/system/system.theme-rtl.css index b13345a..de30fbe 100644 --- a/core/modules/system/system.theme-rtl.css +++ b/core/modules/system/system.theme-rtl.css @@ -39,16 +39,19 @@ th { } /** - * Collapsible fieldsets. + * Collapsible details. */ -.js fieldset.collapsible > legend .fieldset-legend { - background-position: 98% 75%; - padding-left: 0; - padding-right: 15px; +.js .collapsible > summary:before { + background-position: 100% 100%; + float: right; } -.js fieldset.collapsed > legend .fieldset-legend { - background-image: url(../../misc/menu-collapsed-rtl.png); - background-position: 98% 50%; +.js .collapsed > summary:before { + background-position: 75% 35%; + -moz-transform: rotate(90deg); + -ms-transform: rotate(90deg); + -o-transform: rotate(90deg); + -webkit-transform: rotate(90deg); + transform: rotate(90deg); } /** diff --git a/core/modules/system/system.theme.css b/core/modules/system/system.theme.css index 483c89d..83b104d 100644 --- a/core/modules/system/system.theme.css +++ b/core/modules/system/system.theme.css @@ -8,7 +8,8 @@ * HTML elements. */ fieldset { - margin-bottom: 1em; + border: 1px solid #ccc; + margin: 1em 0; padding: 0.5em; } form { @@ -179,22 +180,40 @@ abbr.form-required, abbr.tabledrag-changed, abbr.ajax-changed { } /** - * Collapsible fieldsets. + * Collapsible details. * * @see collapse.js + * @thanks http://nicolasgallagher.com/css-background-image-hacks/ */ -.js fieldset.collapsible > legend .fieldset-legend a { - background: url(../../misc/menu-expanded.png) 5px 65% no-repeat; /* LTR */ - padding-left: 15px; /* LTR */ -} -.js fieldset.collapsed > legend .fieldset-legend a { - background-image: url(../../misc/menu-collapsed.png); /* LTR */ - background-position: 5px 50%; /* LTR */ +details { + border: 1px solid #ccc; + margin-top: 1em; + margin-bottom: 1em; } -.fieldset-legend span.summary { - color: #999; - font-size: 0.9em; - margin-left: 0.5em; +details > .details-wrapper { + padding: 0.5em 1.5em; +} +summary { + padding: 0.2em 1.5em; +} +.collapsible > summary { + padding-left: 0.5em; + padding-right: 0.5em; +} +.js .collapsible > summary:before { + background: url(../../misc/menu-expanded.png) 0px 100% no-repeat; /* LTR */ + content: ""; + float: left; + height: 1em; + width: 1em; +} +.js .collapsed > summary:before { + background-position: 25% 35%; /* LTR */ + -moz-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + -webkit-transform: rotate(-90deg); + transform: rotate(-90deg); } /** diff --git a/core/modules/system/tests/modules/design_test/design_test.info b/core/modules/system/tests/modules/design_test/design_test.info new file mode 100644 index 0000000..ff7159c --- /dev/null +++ b/core/modules/system/tests/modules/design_test/design_test.info @@ -0,0 +1,6 @@ +name = Design test +description = Support module for design, markup, JavaScript, and CSS testing. +package = Testing +version = VERSION +core = 8.x +;hidden = TRUE diff --git a/core/modules/system/tests/modules/design_test/design_test.module b/core/modules/system/tests/modules/design_test/design_test.module new file mode 100644 index 0000000..b0dc5a1 --- /dev/null +++ b/core/modules/system/tests/modules/design_test/design_test.module @@ -0,0 +1,144 @@ + 'name', 'recurse' => TRUE)); + foreach ($tests as $name => $file) { + // Build include file path and category. + $filepath = strtr($file->uri, array($module_path . '/' => '')); + list($category) = explode('/', $filepath, 2); + $categories[$category] = $category; + + // Build router item path. + $path = preg_replace('@[^a-zA-Z0-9-]@', '-', $name); + // Build page callback function name. + $callback = "design_test_{$category}_" . strtr($path, '-', '_'); + + // Build router item callback. + if ($category == 'form') { + $page_callback = 'drupal_get_form'; + } + else { + $page_callback = $callback; + } + + $items["design_test/{$category}/{$path}"] = array( + 'title' => drupal_ucfirst($name), + 'page callback' => $page_callback, + 'page arguments' => array($callback), + 'file' => $filepath, + 'access callback' => TRUE, + 'type' => MENU_LOCAL_TASK | MENU_VISIBLE_IN_TREE, + ); + } + + // Now add some theme local tasks black magic... + $themes = array(); + $list = list_themes(); + foreach ($list as $name => $theme) { + if ($theme->status && !isset($theme->info['hidden'])) { + $themes[$name] = $theme->info['name']; + } + } + foreach ($items as $path => $item) { + foreach ($themes as $name => $theme) { + $items[$path . '/' . $name] = array( + 'title' => $theme, + 'type' => MENU_LOCAL_ACTION, + 'theme callback' => '_block_custom_theme', + 'theme arguments' => array($name), + 'access callback' => TRUE, + ); + } + } + + $items['design_test'] = array( + 'title' => 'Design test', + 'page callback' => 'design_test_category_page', + 'page arguments' => array(1), + 'access callback' => TRUE, + ); + $items['design_test/list'] = array( + 'title' => 'List', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); + // Lastly, add the category containers. + foreach ($categories as $category) { + $items["design_test/{$category}"] = array( + 'title' => drupal_ucfirst($category), + 'page callback' => 'design_test_category_page', + 'page arguments' => array(1), + 'access callback' => TRUE, + 'type' => MENU_LOCAL_TASK | MENU_VISIBLE_IN_TREE, + ); + } + + return $items; +} + +/** + * Menu page callback for a category listing page. + * + * This is a specialized version of system_admin_menu_block_page(), which + * retrieves all direct child menu links of the current page, regardless of + * their type, skips default local tasks, and outputs them as a simple menu + * tree as the main page content. + * + * @param string $category + * The design test category being currently accessed. Maps to the subdirectory + * names of this module. + * + * @return array + * A render array containing a menu link tree. + */ +function design_test_category_page($category) { + $link = menu_link_get_preferred(); + $tree = menu_build_tree($link['menu_name'], array( + 'expanded' => array($link['mlid']), + 'min_depth' => $link['depth'] + 1, + 'max_depth' => $link['depth'] + 2, + )); + // Local tasks are hidden = -1, so normally not rendered in menu trees. + foreach ($tree as &$data) { + // Exclude default local tasks. + if (!($data['link']['type'] & MENU_LINKS_TO_PARENT)) { + $data['link']['hidden'] = 0; + } + } + $build = menu_tree_output($tree); + return $build; +} diff --git a/core/modules/system/tests/modules/design_test/form/details.inc b/core/modules/system/tests/modules/design_test/form/details.inc new file mode 100644 index 0000000..6d7ac68 --- /dev/null +++ b/core/modules/system/tests/modules/design_test/form/details.inc @@ -0,0 +1,148 @@ + 'details', + '#title' => 'Collapsible details', + '#description' => 'Details description', + '#collapsible' => TRUE, + '#collapsed' => FALSE, + ); + + $form['collapsed'] = array( + '#type' => 'details', + '#title' => 'Collapsed details', + '#description' => 'Details description', + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['collapsed']['textfield'] = array( + '#type' => 'textfield', + '#title' => 'Textfield', + '#default_value' => '', + '#description' => 'Textfield description', + '#required' => TRUE, + ); + $form['collapsed']['textarea'] = array( + '#type' => 'textarea', + '#title' => 'Textarea', + '#default_value' => '', + '#description' => 'Textarea description', + '#required' => TRUE, + ); + + $form['collapsed2'] = array( + '#type' => 'details', + '#title' => 'Details', + '#description' => 'Details description', + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['collapsed2']['collapsible'] = array( + '#type' => 'details', + '#title' => 'Collapsible details', + '#description' => 'Details description', + '#collapsible' => TRUE, + '#collapsed' => FALSE, + ); + $form['collapsed2']['collapsed'] = array( + '#type' => 'details', + '#title' => 'Collapsed details', + '#description' => 'Details description', + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['collapsed2']['regular'] = array( + '#type' => 'details', + '#title' => 'Details', + '#description' => 'Details description', + '#collapsible' => FALSE, + ); + + $form['regular'] = array( + '#type' => 'details', + '#title' => 'Details', + '#description' => 'Details description', + '#collapsible' => FALSE, + ); + + #$form['#attributes'] = array('class' => array('search-form')); + $form['basic'] = array( + '#type' => 'details', + '#title' => 'Filter aliases', + '#attributes' => array('class' => array('container-inline')), + ); + $form['basic']['filter'] = array( + '#type' => 'textfield', + '#title' => '', + '#default_value' => '', + '#maxlength' => 128, + '#size' => 25, + ); + $form['basic']['actions'] = array( + '#type' => 'actions', + ); + $form['basic']['actions']['submit'] = array( + '#type' => 'submit', + '#value' => 'Filter', + ); + $form['basic']['actions']['reset'] = array( + '#type' => 'submit', + '#value' => 'Reset', + ); + + // Vertical tabs. + // Replicate the entire form; some more black magic. + $subform = array_diff_key($form, array('group' => 0, 'tabs' => 0)); + + $form['group'] = array( + '#type' => 'vertical_tabs', + ); + $form['tabs'][0] = array( + '#type' => 'details', + '#title' => 'Vertical tab 1', + '#description' => 'Description', + '#group' => 'group', + ); + $form['tabs'][0] += $subform; + + $form['tabs'][1] = array( + '#type' => 'details', + '#title' => 'Vertical tab 2', + '#description' => '

Description

Description

', + '#group' => 'group', + ); + $form['tabs'][1] += $subform; + + // In case you didn't know, vertical tabs are supported recursively. + $form['tabs'][0]['subgroup'] = array( + '#type' => 'vertical_tabs', + ); + + $form['subtabs'][0] = array( + '#type' => 'details', + '#title' => 'Vertical tab 1', + '#description' => 'Description', + '#group' => 'subgroup', + ); + $form['subtabs'][0] += $subform; + + $form['subtabs'][1] = array( + '#type' => 'details', + '#title' => 'Vertical tab 2', + '#description' => '

Description

Description

', + '#group' => 'subgroup', + ); + $form['subtabs'][1] += $subform; + + return $form; +} + diff --git a/core/modules/system/tests/modules/design_test/form/fieldset.inc b/core/modules/system/tests/modules/design_test/form/fieldset.inc new file mode 100644 index 0000000..4ab07fd --- /dev/null +++ b/core/modules/system/tests/modules/design_test/form/fieldset.inc @@ -0,0 +1,101 @@ + 'fieldset', + '#title' => 'Fieldset', + '#description' => 'Fieldset description', + ); + + $form['collapsible'] = array( + '#type' => 'details', + '#title' => 'Collapsible details', + '#description' => 'Details description', + '#collapsible' => TRUE, + '#collapsed' => FALSE, + ); + $form['collapsible']['fieldset'] = array( + '#type' => 'fieldset', + '#title' => 'Fieldset title', + '#description' => 'Fieldset description', + ); + $form['collapsible']['fieldset']['textfield'] = array( + '#type' => 'textfield', + '#title' => 'Textfield', + '#description' => 'Textfield description', + '#required' => TRUE, + ); + $form['collapsible']['fieldset']['textarea'] = array( + '#type' => 'textarea', + '#title' => 'Textarea', + '#description' => 'Textarea description', + ); + + $form['collapsed'] = $form['collapsible']; + $form['collapsed']['#title'] = 'Collapsed details'; + $form['collapsed']['#collapsed'] = TRUE; + + $form['uncollapsible'] = $form['collapsible']; + $form['uncollapsible']['#title'] = 'Uncollapsible details'; + $form['uncollapsible']['#collapsible'] = FALSE; + + $form['nested'] = $form['regular']; + $form['nested']['#title'] = 'Parent fieldset'; + $form['nested']['nested'] = $form['nested']; + $form['nested']['nested']['#title'] = 'Nested fieldset'; + + // Vertical tabs. + // Replicate the entire form; some more black magic. + $subform = array_diff_key($form, array('group' => 0, 'tabs' => 0)); + + $form['group'] = array( + '#type' => 'vertical_tabs', + ); + $form['tabs'][0] = array( + '#type' => 'details', + '#title' => 'Vertical tab 1', + '#description' => 'Description', + '#group' => 'group', + ); + $form['tabs'][0] += $subform; + + $form['tabs'][1] = array( + '#type' => 'details', + '#title' => 'Vertical tab 2', + '#description' => '

Description

Description

', + '#group' => 'group', + ); + $form['tabs'][1] += $subform; + + // In case you didn't know, vertical tabs are supported recursively. + $form['tabs'][0]['subgroup'] = array( + '#type' => 'vertical_tabs', + ); + + $form['subtabs'][0] = array( + '#type' => 'details', + '#title' => 'Vertical tab 1', + '#description' => 'Description', + '#group' => 'subgroup', + ); + $form['subtabs'][0] += $subform; + + $form['subtabs'][1] = array( + '#type' => 'details', + '#title' => 'Vertical tab 2', + '#description' => '

Description

Description

', + '#group' => 'subgroup', + ); + $form['subtabs'][1] += $subform; + + return $form; +} + diff --git a/core/modules/system/tests/modules/design_test/page/list-operations.inc b/core/modules/system/tests/modules/design_test/page/list-operations.inc new file mode 100644 index 0000000..7675e49 --- /dev/null +++ b/core/modules/system/tests/modules/design_test/page/list-operations.inc @@ -0,0 +1,84 @@ + 'table', + '#header' => array('Label', 'Created', 'Operations'), + '#rows' => array(), + ); + // Add an item with a very long label, using common operations. + $build['#rows']['long']['label'] = l('An item with a very insanely long label, which offers quite a couple of common operations', 'item/long'); + $build['#rows']['long']['created'] = format_interval(3200); + $build['#rows']['long']['operations'] = array( + 'data' => array( + '#type' => 'operations', + '#subtype' => 'node', + '#links' => array( + 'edit' => array( + 'title' => 'edit', + 'href' => 'item/long/edit', + ), + 'disable' => array( + 'title' => 'disable', + 'href' => 'item/long/disable', + ), + 'clone' => array( + 'title' => 'clone', + 'href' => 'item/long/clone', + ), + 'delete' => array( + 'title' => 'delete', + 'href' => 'item/long/delete', + ), + ), + ), + ); + + // Add another item, using common operations. + $build['#rows']['another']['label'] = l('Another item, using common operations', 'item/another'); + $build['#rows']['another']['created'] = format_interval(8600); + $build['#rows']['another']['operations'] = $build['#rows']['long']['operations']; + + // Add an item with only one operation. + $build['#rows']['one']['label'] = l('An item with only one operation', 'item/one'); + $build['#rows']['one']['created'] = format_interval(12400); + $build['#rows']['one']['operations'] = array( + 'data' => array( + '#type' => 'operations', + '#subtype' => 'node', + '#links' => array( + 'edit' => array( + 'title' => 'edit', + 'href' => 'item/long/edit', + ), + ), + ), + ); + + // Add an item that can only be viewed. + $build['#rows']['view']['label'] = l('An item that can only be viewed', 'item/view'); + $build['#rows']['view']['created'] = format_interval(12400); + $build['#rows']['view']['operations'] = array( + 'data' => array( + '#type' => 'operations', + '#subtype' => 'node', + '#links' => array(), + ), + ); + + // Add an item for which the default operation is denied. + $build['#rows']['denied']['label'] = l('An item for which the default operation is denied', 'item/denied'); + $build['#rows']['denied']['created'] = format_interval(18600); + $build['#rows']['denied']['operations'] = $build['#rows']['long']['operations']; + unset($build['#rows']['denied']['operations']['data']['#links']['edit']); + + return $build; +} 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 03b7cb8..16bb4a0 100644 --- a/core/modules/system/tests/modules/form_test/form_test.module +++ b/core/modules/system/tests/modules/form_test/form_test.module @@ -791,7 +791,7 @@ function _form_test_vertical_tabs_form($form, &$form_state) { '#type' => 'vertical_tabs', ); $form['tab1'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Tab 1'), '#collapsible' => TRUE, '#group' => 'vertical_tabs', @@ -802,7 +802,7 @@ function _form_test_vertical_tabs_form($form, &$form_state) { '#type' => 'textfield', ); $form['tab2'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Tab 2'), '#collapsible' => TRUE, '#group' => 'vertical_tabs', diff --git a/core/modules/system/tests/modules/theme_test/theme_test.module b/core/modules/system/tests/modules/theme_test/theme_test.module index a05bc46..73dbb4b 100644 --- a/core/modules/system/tests/modules/theme_test/theme_test.module +++ b/core/modules/system/tests/modules/theme_test/theme_test.module @@ -58,19 +58,6 @@ function theme_test_menu() { 'access callback' => TRUE, 'type' => MENU_CALLBACK, ); - - $items['theme-test'] = array( - 'title' => 'Theme test', - 'page callback' => 'system_admin_menu_block_page', - 'access callback' => TRUE, - 'file path' => drupal_get_path('module', 'system'), - 'file' => 'system.admin.inc', - ); - $items['theme-test/list/operations'] = array( - 'title' => 'Operations', - 'page callback' => '_theme_test_list_operations', - 'access callback' => TRUE, - ); return $items; } @@ -160,80 +147,3 @@ function theme_theme_test_foo($variables) { return $variables['foo']; } -/** - * Page callback for manual testing of operation links. - */ -function _theme_test_list_operations() { - $build = array( - '#theme' => 'table', - '#header' => array('Label', 'Created', 'Operations'), - '#rows' => array(), - ); - // Add an item with a very long label, using common operations. - $build['#rows']['long']['label'] = l('An item with a very insanely long label, which offers quite a couple of common operations', 'item/long'); - $build['#rows']['long']['created'] = format_interval(3200); - $build['#rows']['long']['operations'] = array( - 'data' => array( - '#type' => 'operations', - '#subtype' => 'node', - '#links' => array( - 'edit' => array( - 'title' => 'edit', - 'href' => 'item/long/edit', - ), - 'disable' => array( - 'title' => 'disable', - 'href' => 'item/long/disable', - ), - 'clone' => array( - 'title' => 'clone', - 'href' => 'item/long/clone', - ), - 'delete' => array( - 'title' => 'delete', - 'href' => 'item/long/delete', - ), - ), - ), - ); - - // Add another item, using common operations. - $build['#rows']['another']['label'] = l('Another item, using common operations', 'item/another'); - $build['#rows']['another']['created'] = format_interval(8600); - $build['#rows']['another']['operations'] = $build['#rows']['long']['operations']; - - // Add an item with only one operation. - $build['#rows']['one']['label'] = l('An item with only one operation', 'item/one'); - $build['#rows']['one']['created'] = format_interval(12400); - $build['#rows']['one']['operations'] = array( - 'data' => array( - '#type' => 'operations', - '#subtype' => 'node', - '#links' => array( - 'edit' => array( - 'title' => 'edit', - 'href' => 'item/long/edit', - ), - ), - ), - ); - - // Add an item that can only be viewed. - $build['#rows']['view']['label'] = l('An item that can only be viewed', 'item/view'); - $build['#rows']['view']['created'] = format_interval(12400); - $build['#rows']['view']['operations'] = array( - 'data' => array( - '#type' => 'operations', - '#subtype' => 'node', - '#links' => array(), - ), - ); - - // Add an item for which the default operation is denied. - $build['#rows']['denied']['label'] = l('An item for which the default operation is denied', 'item/denied'); - $build['#rows']['denied']['created'] = format_interval(18600); - $build['#rows']['denied']['operations'] = $build['#rows']['long']['operations']; - unset($build['#rows']['denied']['operations']['data']['#links']['edit']); - - return $build; -} diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php index f81b9e5..92185c6 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php @@ -56,7 +56,7 @@ public function form(array $form, array &$form_state, EntityInterface $term) { ); $form['relations'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Relations'), '#collapsible' => TRUE, '#collapsed' => ($vocabulary->hierarchy != TAXONOMY_HIERARCHY_MULTIPLE), diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php index f6e5110..5ed9a2b 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php @@ -58,7 +58,7 @@ public function form(array $form, array &$form_state, EntityInterface $vocabular ); if (module_exists('language')) { $form['default_terms_language'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Terms language'), ); $form['default_terms_language']['default_language'] = array( diff --git a/core/modules/translation/translation.module b/core/modules/translation/translation.module index e7f22fd..2dae5bf 100644 --- a/core/modules/translation/translation.module +++ b/core/modules/translation/translation.module @@ -210,7 +210,7 @@ function translation_form_node_form_alter(&$form, &$form_state) { // Add translation values and workflow options. $form['tnid'] = array('#type' => 'value', '#value' => $node->tnid); $form['translation'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Translation settings'), '#access' => translation_user_can_translate_node($node), '#collapsible' => TRUE, diff --git a/core/modules/user/lib/Drupal/user/AccountFormController.php b/core/modules/user/lib/Drupal/user/AccountFormController.php index b79e983..8286b92 100644 --- a/core/modules/user/lib/Drupal/user/AccountFormController.php +++ b/core/modules/user/lib/Drupal/user/AccountFormController.php @@ -157,7 +157,7 @@ public function form(array $form, array &$form_state, EntityInterface $account) // Signature. $form['signature_settings'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Signature settings'), '#weight' => 1, '#access' => (!$register && $config->get('signatures')), @@ -173,7 +173,7 @@ public function form(array $form, array &$form_state, EntityInterface $account) // Picture/avatar. $form['picture'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Picture'), '#weight' => 1, '#access' => (!$register && variable_get('user_pictures', 0)), @@ -212,7 +212,7 @@ public function form(array $form, array &$form_state, EntityInterface $account) include_once DRUPAL_ROOT . '/core/includes/language.inc'; $interface_language_is_default = language_negotiation_method_get_first(LANGUAGE_TYPE_INTERFACE) != LANGUAGE_NEGOTIATION_SELECTED; $form['language'] = array( - '#type' => language_multilingual() ? 'fieldset' : 'container', + '#type' => language_multilingual() ? 'details' : 'container', '#title' => t('Language settings'), // Display language selector when either creating a user on the admin // interface or editing a user account. diff --git a/core/modules/user/lib/Drupal/user/Tests/UserLanguageTest.php b/core/modules/user/lib/Drupal/user/Tests/UserLanguageTest.php index 7a3c7b5..407bd22 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserLanguageTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserLanguageTest.php @@ -59,7 +59,7 @@ function testUserLanguageConfiguration() { $this->drupalLogin($web_user); $path = 'user/' . $web_user->uid . '/edit'; $this->drupalGet($path); - // Ensure language settings fieldset is available. + // Ensure language settings widget is available. $this->assertText(t('Language'), 'Language selector available.'); // Ensure custom language is present. $this->assertText($name, 'Language present on form.'); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php index 9c518d7..c09e8d7 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php @@ -161,10 +161,10 @@ function testRegistrationDefaultValues() { variable_set('configurable_timezones', 1); variable_set('date_default_timezone', 'Europe/Brussels'); - // Check that the account information fieldset's options are not displayed - // is a fieldset if there is not more than one fieldset in the form. + // Check that the account information options are not displayed + // as a details element if there is not more than one details in the form. $this->drupalGet('user/register'); - $this->assertNoRaw('
Account information', 'Account settings fieldset was hidden.'); + $this->assertNoRaw('
Account information'); $edit = array(); $edit['name'] = $name = $this->randomName(); diff --git a/core/modules/user/user.admin.inc b/core/modules/user/user.admin.inc index 396f4c0..5247605 100644 --- a/core/modules/user/user.admin.inc +++ b/core/modules/user/user.admin.inc @@ -38,7 +38,7 @@ function user_filter_form() { $i = 0; $form['filters'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Show only users where'), '#theme' => 'exposed_filters__user', ); @@ -170,7 +170,7 @@ function user_admin_account() { $result = $query->execute(); $form['options'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Update options'), '#attributes' => array('class' => array('container-inline')), ); @@ -275,7 +275,7 @@ function user_admin_settings($form, &$form_state) { // Settings for anonymous users. $form['anonymous_settings'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Anonymous users'), ); $form['anonymous_settings']['anonymous'] = array( @@ -288,7 +288,7 @@ function user_admin_settings($form, &$form_state) { // Administrative role option. $form['admin_role'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Administrator role'), ); @@ -309,7 +309,7 @@ function user_admin_settings($form, &$form_state) { // User registration settings. $form['registration_cancellation'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Registration and cancellation'), ); $form['registration_cancellation']['user_register'] = array( @@ -349,7 +349,7 @@ function user_admin_settings($form, &$form_state) { // Account settings. $form['personalization'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Personalization'), ); $form['personalization']['user_signatures'] = array( @@ -442,7 +442,7 @@ function user_admin_settings($form, &$form_state) { $email_token_help = t('Available variables are: [site:name], [site:url], [user:name], [user:mail], [site:login-url], [site:url-brief], [user:edit-url], [user:one-time-login-url], [user:cancel-url].'); $form['email_admin_created'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Welcome (new user created by administrator)'), '#collapsible' => TRUE, '#collapsed' => ($config->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY), @@ -463,7 +463,7 @@ function user_admin_settings($form, &$form_state) { ); $form['email_pending_approval'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Welcome (awaiting approval)'), '#collapsible' => TRUE, '#collapsed' => ($config->get('register') != USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL), @@ -484,7 +484,7 @@ function user_admin_settings($form, &$form_state) { ); $form['email_no_approval_required'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Welcome (no approval required)'), '#collapsible' => TRUE, '#collapsed' => ($config->get('register') != USER_REGISTER_VISITORS), @@ -505,7 +505,7 @@ function user_admin_settings($form, &$form_state) { ); $form['email_password_reset'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Password recovery'), '#collapsible' => TRUE, '#collapsed' => TRUE, @@ -527,7 +527,7 @@ function user_admin_settings($form, &$form_state) { ); $form['email_activated'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Account activation'), '#collapsible' => TRUE, '#collapsed' => TRUE, @@ -562,7 +562,7 @@ function user_admin_settings($form, &$form_state) { ); $form['email_blocked'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Account blocked'), '#collapsible' => TRUE, '#collapsed' => TRUE, @@ -597,7 +597,7 @@ function user_admin_settings($form, &$form_state) { ); $form['email_cancel_confirm'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Account cancellation confirmation'), '#collapsible' => TRUE, '#collapsed' => TRUE, @@ -618,7 +618,7 @@ function user_admin_settings($form, &$form_state) { ); $form['email_canceled'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Account canceled'), '#collapsible' => TRUE, '#collapsed' => TRUE, diff --git a/core/modules/user/user.css b/core/modules/user/user.css index 866ee40..29b5aae 100644 --- a/core/modules/user/user.css +++ b/core/modules/user/user.css @@ -9,7 +9,7 @@ #permissions tr.even .form-item { white-space: normal; } -#user-admin-settings fieldset .fieldset-description { +#user-admin-settings .details-description { font-size: 0.85em; padding-bottom: .5em; } 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 e67614e..337f267 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php @@ -293,9 +293,9 @@ public function buildOptionsForm(&$form, &$form_state) { ); // This form is long and messy enough that the "Administrative title" option - // belongs in a "more options" fieldset at the bottom of the form. + // belongs in "more options" details at the bottom of the form. $form['more'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('More'), '#collapsible' => TRUE, '#collapsed' => TRUE, diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/area/Text.php b/core/modules/views/lib/Drupal/views/Plugin/views/area/Text.php index b696414..901f4a8 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/area/Text.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/area/Text.php @@ -75,7 +75,7 @@ public function buildOptionsForm(&$form, &$form_state) { } $form['token_help'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Replacement patterns'), '#collapsible' => TRUE, '#collapsed' => TRUE, 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 ef30140..43ea65b 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 @@ -172,10 +172,10 @@ public function buildOptionsForm(&$form, &$form_state) { ); $form['no_argument'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => $argument_text['filter value not present'], ); - // Everything in the fieldset is floated, so the last element needs to + // Everything in the details is floated, so the last element needs to // clear those floats. $form['no_argument']['clearfix'] = array( '#weight' => 1000, @@ -189,7 +189,7 @@ public function buildOptionsForm(&$form, &$form_state) { ); $form['exception'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Exceptions'), '#collapsible' => TRUE, '#collapsed' => TRUE, @@ -236,7 +236,7 @@ public function buildOptionsForm(&$form, &$form_state) { $form['default_action']['#options'] = $options; $form['argument_present'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => $argument_text['filter value present'], ); $form['title_enable'] = array( 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 b63ed69..6bb05ae 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 @@ -527,7 +527,7 @@ public function buildOptionsForm(&$form, &$form_state) { ); $form['style_settings'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Style settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, @@ -678,7 +678,7 @@ public function buildOptionsForm(&$form, &$form_state) { $form['alter'] = array( '#title' => t('Rewrite results'), - '#type' => 'fieldset', + '#type' => 'details', '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => 100, @@ -882,7 +882,7 @@ public function buildOptionsForm(&$form, &$form_state) { // the parent in situations like this, so we need a second div to // make this work. $form['alter']['help'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Replacement patterns'), '#collapsible' => TRUE, '#collapsed' => TRUE, @@ -1029,7 +1029,7 @@ public function buildOptionsForm(&$form, &$form_state) { } $form['empty_field_behavior'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('No results behavior'), '#collapsible' => TRUE, '#collapsed' => TRUE, diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/pager/Full.php b/core/modules/views/lib/Drupal/views/Plugin/views/pager/Full.php index f99eabe..9e34d27 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/pager/Full.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/pager/Full.php @@ -104,7 +104,7 @@ public function buildOptionsForm(&$form, &$form_state) { ); $form['tags'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#collapsible' => FALSE, '#collapsed' => FALSE, '#tree' => TRUE, @@ -142,7 +142,7 @@ public function buildOptionsForm(&$form, &$form_state) { ); $form['expose'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#collapsible' => FALSE, '#collapsed' => FALSE, '#tree' => 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 4a7a1e4..c140305 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 @@ -90,7 +90,7 @@ public function buildOptionsForm(&$form, &$form_state) { '#required' => TRUE, ); $form['guid_field_options'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('GUID settings'), '#collapsible' => FALSE, '#collapsed' => FALSE, diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php index 0219788..424d698 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php @@ -209,7 +209,7 @@ function build_form(array $form, array &$form_state) { $this->build_sorts($form, $form_state); $form['displays']['page'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#attributes' => array('class' => array('views-attachment', 'fieldset-no-legend')), '#tree' => TRUE, ); @@ -246,7 +246,7 @@ function build_form(array $form, array &$form_state) { '#field_prefix' => $path_prefix, ); $form['displays']['page']['options']['style'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#attributes' => array('class' => array('container-inline', 'fieldset-no-legend')), ); @@ -352,7 +352,7 @@ function build_form(array $form, array &$form_state) { } $form['displays']['block'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#attributes' => array('class' => array('views-attachment', 'fieldset-no-legend')), '#tree' => TRUE, ); @@ -383,7 +383,7 @@ function build_form(array $form, array &$form_state) { '#type' => 'textfield', ); $form['displays']['block']['options']['style'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#attributes' => array('class' => array('container-inline', 'fieldset-no-legend')), ); diff --git a/core/modules/views/views_ui/admin.inc b/core/modules/views/views_ui/admin.inc index eeadc0e..7c52685 100644 --- a/core/modules/views/views_ui/admin.inc +++ b/core/modules/views/views_ui/admin.inc @@ -503,7 +503,7 @@ function views_ui_build_preview(ViewUI $view, $display_id, $render = TRUE) { } /** - * Move form elements into fieldsets for presentation purposes. + * Move form elements into details for presentation purposes. * * Many views forms use #tree = TRUE to keep their values in a hierarchy for * easier storage. Moving the form elements into fieldsets during form building @@ -2245,7 +2245,7 @@ function views_ui_admin_settings_basic($form, &$form_state) { ); $form['live_preview'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Live preview settings'), ); @@ -2332,7 +2332,7 @@ function views_ui_admin_settings_advanced() { $config = config('views.settings'); $form['cache'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Caching'), ); @@ -2350,7 +2350,7 @@ function views_ui_admin_settings_advanced() { ); $form['debug'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Debugging'), ); @@ -2398,7 +2398,7 @@ function views_ui_admin_settings_advanced() { $options = views_fetch_plugin_names('display_extender'); if (!empty($options)) { $form['extenders'] = array( - '#type' => 'fieldset', + '#type' => 'details', ); ; $form['extenders']['display_extenders'] = array( diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewUI.php b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewUI.php index 7ac85c9..f340eeb 100644 --- a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewUI.php +++ b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewUI.php @@ -276,13 +276,13 @@ public function getDisplayDetails($display) { $build['columns']['second']['footer'] = array(); $build['columns']['second']['pager'] = array(); - // The third column buckets are wrapped in a fieldset. + // The third column buckets are wrapped in details. $build['columns']['third'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE, - '#theme_wrappers' => array('fieldset', 'container'), + '#theme_wrappers' => array('details', 'container'), '#attributes' => array( 'class' => array( 'views-display-column', @@ -291,7 +291,7 @@ public function getDisplayDetails($display) { ), ); - // Collapse the fieldset by default. + // Collapse the details by default. if (config('views.settings')->get('ui.show.advanced_column')) { $build['columns']['third']['#collapsed'] = FALSE; } @@ -1179,7 +1179,7 @@ public static function buildAddForm($form, &$form_state) { // Create the part of the form that allows the user to select the basic // properties of what the view will display. $form['displays']['show'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#tree' => TRUE, '#attributes' => array('class' => array('container-inline')), ); diff --git a/core/themes/bartik/css/style-rtl.css b/core/themes/bartik/css/style-rtl.css index 90638eb..a95c50e 100644 --- a/core/themes/bartik/css/style-rtl.css +++ b/core/themes/bartik/css/style-rtl.css @@ -210,9 +210,6 @@ ul.action-links li a { /* -------------- Form Elements ------------- */ -.fieldset-legend span.summary { - margin-left: 0; -} #user-profile-form input#edit-submit { margin-left: 0; } diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css index 6f4cb14..906aa00 100644 --- a/core/themes/bartik/css/style.css +++ b/core/themes/bartik/css/style.css @@ -1113,83 +1113,34 @@ a.button:active { /* -------------- Form Elements ------------- */ +details, fieldset { - background: #ffffff; - border: 1px solid #cccccc; - margin-top: 10px; - margin-bottom: 32px; - padding: 0 0 10px; - position: relative; - top: 12px; /* Offsets the negative margin of legends */ border-radius: 4px; } -.fieldset-wrapper { - margin-top: 25px; -} -.node-form .vertical-tabs .fieldset-wrapper { - margin-top: 0; -} .filter-wrapper { - top: 0; - padding: 1em 0 0.2em; border-top-left-radius: 0; border-top-right-radius: 0; } .filter-help a { font-size: 0.857em; - padding: 2px 20px 0; } .filter-wrapper .form-item label { margin-right: 10px; } -.filter-wrapper .form-item { - padding: 0 0 0.5em 0.5em; -} -.filter-guidelines { - padding: 0 1.5em 0 0.5em; -} -fieldset.collapsed { - background: transparent; - border-radius: 0; -} -fieldset legend { +summary { background: #dbdbdb; - border: 1px solid #ccc; - border-bottom: none; color: #3b3b3b; - display: block; - height: 2em; - left: -1px; /* LTR */ - font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; - line-height: 2; - padding: 0; - position: absolute; - text-indent: 10px; text-shadow: 0 1px 0 #fff; - top: -12px; - width: 100%; - border-top-left-radius: 4px; - border-top-right-radius: 4px; } -fieldset.collapsed legend { - border-radius: 4px; -} -fieldset legend a { +details summary a { color: #3b3b3b; } -fieldset legend a:hover, -fieldset legend a:focus, -fieldset legend a:active { +details summary a:hover, +details summary a:focus, +details summary a:active { color: #000; } -fieldset .fieldset-wrapper { - padding: 0 10px; -} -fieldset .fieldset-description { - margin-top: 5px; - margin-bottom: 1em; - line-height: 1.4; - color: #3c3c3c; +details .details-description { font-style: italic; } input { @@ -1225,10 +1176,6 @@ input.form-submit:focus { .password-suggestions ul li { margin-left: 1.2em; /* LTR */ } -.form-item { - margin-bottom: 1em; - margin-top: 2px; -} .form-item label { font-size: 0.929em; } @@ -1340,7 +1287,7 @@ input.form-button-disabled:active, border-top-left-radius: 4px; border-top-right-radius: 4px; } -.comment-form fieldset.filter-wrapper .fieldset-wrapper, +.comment-form details.filter-wrapper .details-wrapper, .comment-form .text-format-wrapper .form-item { margin-top: 0; margin-bottom: 0; @@ -1352,7 +1299,7 @@ input.form-button-disabled:active, .filter-wrapper .form-select { min-width: 120px; } -.comment-form fieldset.filter-wrapper .tips { +.comment-form details.filter-wrapper .tips { font-size: 0.786em; } #comment-body-add-more-wrapper .form-type-textarea label { @@ -1371,9 +1318,6 @@ div.password-suggestions { background: #222222; opacity: 0.7; } -div.vertical-tabs .vertical-tabs-panes fieldset.vertical-tabs-pane { - padding: 1em; -} #forum .name { font-size: 1.083em; } @@ -1491,10 +1435,10 @@ div.add-or-remove-shortcuts { margin: 0 5px; } /* Fix spacing when Seven is used in the overlay. */ -#system-theme-settings fieldset { +#system-theme-settings details { padding: 0; } -#system-theme-settings fieldset .fieldset-legend { +#system-theme-settings details summary { margin-top: 0; } /* Configuration. */ diff --git a/core/themes/seven/ie.css b/core/themes/seven/ie.css index d1a71ce..21252de 100644 --- a/core/themes/seven/ie.css +++ b/core/themes/seven/ie.css @@ -1,9 +1,3 @@ -/* IE renders absolute positioned legend where fieldset content starts. */ -fieldset .fieldset-legend { - left: 0; - top: 0; -} - /* IE renders monospace font too big. */ code, pre, diff --git a/core/themes/seven/reset.css b/core/themes/seven/reset.css index 507955e..936198f 100644 --- a/core/themes/seven/reset.css +++ b/core/themes/seven/reset.css @@ -56,13 +56,11 @@ dd, ol, ul, li, -fieldset, form, input, select, textarea, label, -legend, table, caption, tbody, diff --git a/core/themes/seven/style-rtl.css b/core/themes/seven/style-rtl.css index 788aa36..73cfbbc 100644 --- a/core/themes/seven/style-rtl.css +++ b/core/themes/seven/style-rtl.css @@ -111,26 +111,7 @@ tr td:last-child { border-right: none; } -/** - * Fieldsets. - */ -fieldset { - padding: 2.5em 0 0 0; -} -fieldset .fieldset-legend { - padding-right: 15px; - right: 0; -} -fieldset .fieldset-wrapper { - padding: 0 15px 13px 13px; -} - /* Filter */ -.filter-wrapper .form-item, -.filter-wrapper .filter-guidelines, -.filter-wrapper .filter-help { - padding: 2px 0 0 0; -} ul.tips li { margin: 0.25em 1.5em 0.25em 0; } diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css index 7b8ae1b..e07a693 100644 --- a/core/themes/seven/style.css +++ b/core/themes/seven/style.css @@ -20,8 +20,10 @@ hr { height: 1px; background: #cccccc; } +summary, legend { font-weight: bold; + text-transform: uppercase; } h1, h2, @@ -504,50 +506,21 @@ tr td:last-child { display: none; } } + /** - * Fieldsets. - * - * Fieldset legends are displayed like containers in Seven. However, several - * browsers do not support styling of LEGEND elements. To achieve the desired - * styling: - * - All fieldsets use 'position: relative'. - * - All legend labels are wrapped in a single span.fieldset-legend that uses - * 'position: absolute', which means that the LEGEND element itself is not - * rendered by browsers. - * - Due to using 'position: absolute', collapsed fieldsets do not have a - * height; the fieldset requires a 'padding-top' to make the absolute - * positioned .fieldset-legend appear as though it would have a height. - * - Various browsers are positioning the legend differently if there is a - * 'padding-left'/'padding-right' applied on a fieldset and inherit the - * positioning even to absolute positioned elements within; we therefore have - * to apply all padding to the inner .fieldset-wrapper instead. + * Collapsible details. */ -fieldset { - border: 1px solid #ccc; - padding: 2.5em 0 0 0; /* LTR */ - position: relative; - margin: 1em 0; -} -fieldset .fieldset-legend { - margin-top: 0.5em; - padding-left: 15px; /* LTR */ - position: absolute; - text-transform: uppercase; -} -fieldset .fieldset-wrapper { - padding: 0 13px 13px 15px; /* LTR */ +details { + line-height: 1.295em; } -fieldset.collapsed { - background-color: transparent; +details summary { + padding-top: 0.5em; + padding-bottom: 0.5em; } -.js fieldset.collapsed { - border-width: 1px; - height: auto; -} -fieldset fieldset { +details details { background-color: #fff; } -fieldset fieldset fieldset { +details details details { background-color: #f8f8f8; } @@ -555,22 +528,11 @@ fieldset fieldset fieldset { * Form elements. */ .form-item { - padding: 9px 0; - margin: 0 0 10px; -} -.filter-wrapper .form-item, -div.teaser-checkbox .form-item, -.form-item .form-item { - padding: 5px 0; - margin: 0; - border: 0; + margin: 1em 0; } .form-type-checkbox { padding: 0; } -.text-format-wrapper .form-item { - padding-bottom: 0; -} .form-item label { margin: 0; padding: 0; @@ -599,17 +561,7 @@ div.teaser-checkbox .form-item, /* Filter */ .filter-wrapper { - border-top: 0; - padding: 10px 2px; -} -.filter-wrapper .fieldset-wrapper { - padding: 0 6px; -} -.filter-wrapper .form-item, -.filter-wrapper .filter-guidelines, -.filter-wrapper .filter-help { font-size: 0.923em; - padding: 2px 0 0 0; /* LTR */ } ul.tips, div.description, @@ -788,7 +740,7 @@ ul.action-links a { margin-bottom: 2px; width: 100%; } - fieldset .fieldset-legend { + details summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/core/themes/seven/vertical-tabs-rtl.css b/core/themes/seven/vertical-tabs-rtl.css index a9598c3..cff18cb 100644 --- a/core/themes/seven/vertical-tabs-rtl.css +++ b/core/themes/seven/vertical-tabs-rtl.css @@ -16,6 +16,5 @@ div.vertical-tabs ul li.selected a:active { border-left-color: #fff; } div.vertical-tabs .vertical-tabs-panes { - margin: 0 265px 0 0; - padding: 10px 0 10px 15px; + margin: 0 245px 0 0; } diff --git a/core/themes/seven/vertical-tabs.css b/core/themes/seven/vertical-tabs.css index e89f3f5..fa265ab 100644 --- a/core/themes/seven/vertical-tabs.css +++ b/core/themes/seven/vertical-tabs.css @@ -8,7 +8,7 @@ div.vertical-tabs { margin: 10px 0; position: relative; } -fieldset.vertical-tabs-pane { +.vertical-tabs-pane { border: 0; padding: 0; margin: 0; @@ -66,15 +66,11 @@ div.vertical-tabs ul li.selected a:focus strong { text-decoration: underline; } div.vertical-tabs .vertical-tabs-panes { - margin: 0 0 0 265px; /* LTR */ - padding: 10px 15px 10px 0; /* LTR */ + margin: 0 0 0 245px; /* LTR */ } -fieldset.vertical-tabs-pane > legend { +.vertical-tabs-pane > summary { display: none; } -.vertical-tabs-pane .fieldset-wrapper > div:first-child { - padding-top: 5px; -} /** * Prevent text inputs from overflowing when container is too narrow. "width" is