';
$output .= $element['#children'];
if (!empty($element['#description'])) {
$output .= '
' . $element['#description'] . '
';
diff --git a/core/modules/system/tests/modules/design_test/design_test.module b/core/modules/system/tests/modules/design_test/design_test.module
index b0dc5a1..b8a1a80 100644
--- a/core/modules/system/tests/modules/design_test/design_test.module
+++ b/core/modules/system/tests/modules/design_test/design_test.module
@@ -57,6 +57,7 @@ function design_test_menu() {
$items["design_test/{$category}/{$path}"] = array(
'title' => drupal_ucfirst($name),
+ 'theme callback' => 'design_test_menu_theme_callback',
'page callback' => $page_callback,
'page arguments' => array($callback),
'file' => $filepath,
@@ -65,26 +66,6 @@ function design_test_menu() {
);
}
- // 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',
@@ -111,6 +92,50 @@ function design_test_menu() {
}
/**
+ * Implements hook_menu_local_tasks_alter().
+ */
+function design_test_menu_local_tasks_alter(&$data, $router_item, $root_path) {
+ if ($router_item['number_parts'] > 2 && strpos($root_path, 'design_test/') === 0) {
+ $actions = &$data['actions']['output'];
+ // Determine the currently selected theme, if any.
+ $selected_theme = drupal_container()->get('request')->query->get('theme');
+ $default_theme = variable_get('theme_default', 'stark');
+
+ // Expand all enabled themes into action links.
+ $themes = list_themes();
+ foreach ($themes as $name => $theme) {
+ $action = array(
+ '#theme' => 'menu_local_action',
+ '#link' => array(
+ 'title' => $theme->info['name'],
+ 'href' => $router_item['href'],
+ 'localized_options' => array('html' => FALSE),
+ ),
+ '#active' => $selected_theme == $name,
+ );
+ // Only add the theme-switcher query parameter for all non-default themes.
+ if ($name != $default_theme) {
+ $action['#link']['localized_options']['query']['theme'] = $name;
+ }
+ $actions[] = $action;
+ }
+ if ($themes > 1) {
+ $data['actions']['count']++;
+ }
+ }
+}
+
+/**
+ * Menu theme callback for design_test pages.
+ *
+ * Returns whichever theme name that has been passed via the 'theme' request
+ * query parameter. The returned value is validated by the menu system already.
+ */
+function design_test_menu_theme_callback() {
+ return drupal_container()->get('request')->query->get('theme');
+}
+
+/**
* Menu page callback for a category listing page.
*
* This is a specialized version of system_admin_menu_block_page(), which
diff --git a/core/modules/system/tests/modules/design_test/form/details.inc b/core/modules/system/tests/modules/design_test/form/details.inc
index febcda3..186945f 100644
--- a/core/modules/system/tests/modules/design_test/form/details.inc
+++ b/core/modules/system/tests/modules/design_test/form/details.inc
@@ -104,6 +104,11 @@ function design_test_form_details($form, &$form_state) {
'#value' => 'Reset',
);
+ $form['body'] = array(
+ '#type' => 'text_format',
+ '#title' => 'Body',
+ );
+
// Vertical tabs.
// Replicate the entire form; some more black magic.
$subform = array_diff_key($form, array('group' => 0, 'tabs' => 0));
diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css
index 545795f..a748fd4 100644
--- a/core/themes/bartik/css/style.css
+++ b/core/themes/bartik/css/style.css
@@ -1117,7 +1117,8 @@ a.button:active {
/* -------------- Form Elements ------------- */
details,
-fieldset {
+fieldset,
+.filter-wrapper {
border-radius: 4px;
}
.filter-wrapper {
diff --git a/core/themes/seven/vertical-tabs.css b/core/themes/seven/vertical-tabs.css
index fa265ab..6a1ee7f 100644
--- a/core/themes/seven/vertical-tabs.css
+++ b/core/themes/seven/vertical-tabs.css
@@ -78,7 +78,7 @@ div.vertical-tabs .vertical-tabs-panes {
* with "box-sizing" to prevent box model issues from occurring in most browsers.
*/
.vertical-tabs .form-type-textfield input {
- width: 100%;
+ max-width: 100%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;