Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.922 diff -u -p -r1.922 common.inc --- includes/common.inc 13 Jun 2009 19:28:57 -0000 1.922 +++ includes/common.inc 16 Jun 2009 02:49:32 -0000 @@ -3591,7 +3591,7 @@ function drupal_render_page($page) { * Recursively iterates over each of the array elements, generating HTML code. * * HTML generation is controlled by two properties containing theme functions, - * #theme and #theme_wrapper. + * #theme and #theme_wrappers. * * #theme is the theme function called first. If it is set and the element has * any children, they have to be rendered there. For elements that are not @@ -3600,21 +3600,22 @@ function drupal_render_page($page) { * children, they are rendered and concatenated into a string by * drupal_render_children(). * - * The theme function in #theme_wrapper will be called after #theme has run. - * It 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. A wrapper theme function always has to include the - * element's #children property in its output, as this contains the rendered + * 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 + * 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. * - * For example, for the form element type, by default only the #theme_wrapper + * For example, for the form element type, by default only the #theme_wrappers * property is set, which adds the form markup around the rendered child * elements of the form. This allows you to set the #theme property on a * specific form to a custom theme function, giving you complete control over * the placement of the form's children while not at all having to deal with * the form markup itself. * - * This function is usually called from within a another function, like + * This function is usually called from within another function, like * drupal_get_form() or a theme function. Elements are sorted internally * using uasort(). Since this is expensive, when passing already sorted * elements to drupal_render(), for example from a database query, set @@ -3699,10 +3700,12 @@ function drupal_render(&$elements) { $elements['#children'] = drupal_render_children($elements, $children); } - // Let the theme function in #theme_wrapper add markup around the rendered + // Let the theme functions in #theme_wrappers add markup around the rendered // children. - if (!empty($elements['#theme_wrapper'])) { - $elements['#children'] = theme($elements['#theme_wrapper'], $elements); + if (isset($elements['#theme_wrappers'])) { + foreach ($elements['#theme_wrappers'] as $theme_wrapper) { + $elements['#children'] = theme($theme_wrapper, $elements); + } } // Filter the outputted content and make any last changes before the Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.341 diff -u -p -r1.341 form.inc --- includes/form.inc 15 Jun 2009 09:51:49 -0000 1.341 +++ includes/form.inc 16 Jun 2009 02:49:43 -0000 @@ -1917,7 +1917,7 @@ function form_process_text_format($eleme unset($element['value']['#description']); $element['#type'] = 'markup'; $element['#theme'] = NULL; - $element['#theme_wrapper'] = 'text_format_wrapper'; + $element['#theme_wrappers'] = array('text_format_wrapper'); $element['format'] = filter_form($element['#text_format'], 1, $element_parents); // We need to clear the #text_format from the new child otherwise we @@ -2086,14 +2086,14 @@ function theme_checkboxes($element) { } /** - * Add form_element theming to an element if title or desription is set. + * Add form_element theming to an element if title or description is set. * * This is used as a pre render function for checkboxes and radios. */ function form_pre_render_conditional_form_element($element) { if ($element['#title'] || $element['#description']) { unset($element['#id']); - $element['#theme_wrapper'] = 'form_element'; + $element['#theme_wrappers'][] = 'form_element'; } return $element; } @@ -2331,7 +2331,7 @@ function form_process_vertical_tabs($ele // that manually. $element['group'] = array( '#type' => 'fieldset', - '#theme_wrapper' => '', + '#theme_wrappers' => array(), '#parents' => $element['#parents'], ); Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.345 diff -u -p -r1.345 block.module --- modules/block/block.module 12 Jun 2009 09:02:55 -0000 1.345 +++ modules/block/block.module 16 Jun 2009 02:51:33 -0000 @@ -274,7 +274,7 @@ function block_get_blocks_by_region($reg $build[$key] = $block->content; unset($block->content); $build[$key] += array( - '#theme_wrapper' => 'block', + '#theme_wrappers' => array('block'), '#block' => $block, '#weight' => ++$weight, ); Index: modules/field/modules/text/text.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/text/text.module,v retrieving revision 1.12 diff -u -p -r1.12 text.module --- modules/field/modules/text/text.module 12 Jun 2009 08:39:37 -0000 1.12 +++ modules/field/modules/text/text.module 16 Jun 2009 02:51:56 -0000 @@ -511,21 +511,21 @@ function text_elements() { '#input' => TRUE, '#columns' => array('value'), '#delta' => 0, '#process' => array('text_textfield_elements_process'), - '#theme_wrapper' => 'text_textfield', + '#theme_wrappers' => array('text_textfield'), '#autocomplete_path' => FALSE, ), 'text_textarea' => array( '#input' => TRUE, '#columns' => array('value', 'format'), '#delta' => 0, '#process' => array('text_textarea_elements_process'), - '#theme_wrapper' => 'text_textarea', + '#theme_wrappers' => array('text_textarea'), '#filter_value' => FILTER_FORMAT_DEFAULT, ), 'text_textarea_with_summary' => array( '#input' => TRUE, '#columns' => array('value', 'format', 'summary'), '#delta' => 0, '#process' => array('text_textarea_with_summary_process'), - '#theme_wrapper' => 'text_textarea_with_summary', + '#theme_wrappers' => array('text_textarea_with_summary'), '#filter_value' => FILTER_FORMAT_DEFAULT, ), ); Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.711 diff -u -p -r1.711 system.module --- modules/system/system.module 11 Jun 2009 04:36:22 -0000 1.711 +++ modules/system/system.module 16 Jun 2009 02:53:57 -0000 @@ -250,7 +250,7 @@ function system_elements() { $type['form'] = array( '#method' => 'post', '#action' => request_uri(), - '#theme_wrapper' => 'form', + '#theme_wrappers' => array('form'), ); $type['page'] = array( @@ -275,7 +275,7 @@ function system_elements() { '#button_type' => 'submit', '#executes_submit_callback' => TRUE, '#process' => array('form_process_ahah'), - '#theme_wrapper' => 'button', + '#theme_wrappers' => array('button'), ); $type['button'] = array( @@ -284,7 +284,7 @@ function system_elements() { '#button_type' => 'submit', '#executes_submit_callback' => FALSE, '#process' => array('form_process_ahah'), - '#theme_wrapper' => 'button', + '#theme_wrappers' => array('button'), ); $type['image_button'] = array( @@ -295,7 +295,7 @@ function system_elements() { '#return_value' => TRUE, '#has_garbage_value' => TRUE, '#src' => NULL, - '#theme_wrapper' => 'image_button', + '#theme_wrappers' => array('image_button'), ); $type['textfield'] = array( @@ -305,7 +305,7 @@ function system_elements() { '#autocomplete_path' => FALSE, '#process' => array('form_process_text_format', 'form_process_ahah'), '#theme' => 'textfield', - '#theme_wrapper' => 'form_element', + '#theme_wrappers' => array('form_element'), ); $type['password'] = array( @@ -314,13 +314,13 @@ function system_elements() { '#maxlength' => 128, '#process' => array('form_process_ahah'), '#theme' => 'password', - '#theme_wrapper' => 'form_element', + '#theme_wrappers' => array('form_element'), ); $type['password_confirm'] = array( '#input' => TRUE, '#process' => array('form_process_password_confirm'), - '#theme_wrapper' => 'form_element', + '#theme_wrappers' => array('form_element'), ); $type['textarea'] = array( @@ -330,13 +330,13 @@ function system_elements() { '#resizable' => TRUE, '#process' => array('form_process_text_format', 'form_process_ahah'), '#theme' => 'textarea', - '#theme_wrapper' => 'form_element', + '#theme_wrappers' => array('form_element'), ); $type['radios'] = array( '#input' => TRUE, '#process' => array('form_process_radios'), - '#theme_wrapper' => 'radios', + '#theme_wrappers' => array('radios'), '#pre_render' => array('form_pre_render_conditional_form_element'), ); @@ -345,7 +345,7 @@ function system_elements() { '#default_value' => NULL, '#process' => array('form_process_ahah'), '#theme' => 'radio', - '#theme_wrapper' => 'form_element', + '#theme_wrappers' => array('form_element'), '#form_element_skip_title' => TRUE, ); @@ -353,7 +353,7 @@ function system_elements() { '#input' => TRUE, '#tree' => TRUE, '#process' => array('form_process_checkboxes'), - '#theme_wrapper' => 'checkboxes', + '#theme_wrappers' => array('checkboxes'), '#pre_render' => array('form_pre_render_conditional_form_element'), ); @@ -362,7 +362,7 @@ function system_elements() { '#return_value' => 1, '#process' => array('form_process_ahah'), '#theme' => 'checkbox', - '#theme_wrapper' => 'form_element', + '#theme_wrappers' => array('form_element'), '#form_element_skip_title' => TRUE, ); @@ -372,7 +372,7 @@ function system_elements() { '#multiple' => FALSE, '#process' => array('form_process_ahah'), '#theme' => 'select', - '#theme_wrapper' => 'form_element', + '#theme_wrappers' => array('form_element'), ); $type['weight'] = array( @@ -387,14 +387,14 @@ function system_elements() { '#element_validate' => array('date_validate'), '#process' => array('form_process_date'), '#theme' => 'date', - '#theme_wrapper' => 'form_element', + '#theme_wrappers' => array('form_element'), ); $type['file'] = array( '#input' => TRUE, '#size' => 60, '#theme' => 'file', - '#theme_wrapper' => 'form_element', + '#theme_wrappers' => array('form_element'), ); $type['tableselect'] = array( @@ -413,7 +413,7 @@ function system_elements() { $type['item'] = array( '#markup' => '', '#theme' => 'markup', - '#theme_wrapper' => 'form_element', + '#theme_wrappers' => array('form_element'), ); $type['hidden'] = array( @@ -437,11 +437,11 @@ function system_elements() { '#value' => NULL, '#process' => array('form_process_fieldset', 'form_process_ahah'), '#pre_render' => array('form_pre_render_fieldset'), - '#theme_wrapper' => 'fieldset', + '#theme_wrappers' => array('fieldset'), ); $type['vertical_tabs'] = array( - '#theme_wrapper' => 'vertical_tabs', + '#theme_wrappers' => array('vertical_tabs'), '#default_tab' => '', '#process' => array('form_process_vertical_tabs'), ); Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.1001 diff -u -p -r1.1001 user.module --- modules/user/user.module 13 Jun 2009 20:40:09 -0000 1.1001 +++ modules/user/user.module 16 Jun 2009 02:54:32 -0000 @@ -892,7 +892,7 @@ function user_search($op = 'search', $ke function user_elements() { return array( 'user_profile_category' => array( - '#theme_wrapper' => 'user_profile_category' + '#theme_wrappers' => array('user_profile_category') ), 'user_profile_item' => array( '#theme' => 'user_profile_item'