Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.246 diff -u -F^f -r1.246 theme.inc --- includes/theme.inc 23 Jul 2005 05:57:27 -0000 1.246 +++ includes/theme.inc 23 Jul 2005 12:30:47 -0000 @@ -745,19 +745,30 @@ function theme_tablesort_indicator($styl } /** - * Return a themed box. + * Return a string wrapped in HTML, often referred to as a box. * - * @param $title - * The subject of the box. * @param $content - * The content of the box. - * @param $region - * The region in which the box is displayed. + * The content of wrapper, mandatory. + * @param $id + * The ID of the wrapper. This must be defined in the following way: + * modulename-uniquename or filename-uniquename. For example 'comment-preview' + * @param $class + * The class of the wrapper, optional. Please look at http://drupal.org/node/27316, and use a class from there. + * @param $title + * The subject of the wrapper, optional. Will render as a title. * @return - * A string containing the box output. + * A string containing the wrapped output. */ -function theme_box($title, $content, $region = 'main') { - $output = '

'. $title .'

'. $content .'
'; +function theme_wrapper($content, $id, $class = NULL, $title = NULL) { + if ($class) { + $class = ' ' . $class; //add a space, so that we get class="wrapper foo" + } + $output = "
\n"; + if ($title) { + $output .= "

$title

\n"; + } + $output .= $content; + $output .= "\n
\n"; return $output; } Index: modules/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment.module,v retrieving revision 1.360 diff -u -F^f -r1.360 comment.module --- modules/comment.module 20 Jul 2005 15:13:12 -0000 1.360 +++ modules/comment.module 23 Jul 2005 12:30:49 -0000 @@ -1436,14 +1436,12 @@ function theme_comment_form($edit, $titl } $destination = $_REQUEST['destination'] ? 'destination='. $_REQUEST['destination'] : ''; - return theme('box', $title, form($form, 'post', url('comment/reply/'. $edit['nid'], $destination))); + + return theme('wrapper', form($form, 'post', url('comment/reply/'.$edit['nid'])), 'comment-reply', 'comment', $title); } function theme_comment_preview($comment, $links = '', $visible = 1) { - $output = '
'; - $output .= theme('comment_view', $comment, $links, $visible); - $output .= '
'; - return $output; + return theme('wrapper', theme('comment_view', $comment, $links, $visible), 'comment-preview', 'preview'); }; function theme_comment_view($comment, $links = '', $visible = 1) { @@ -1524,7 +1522,7 @@ function theme_comment_controls($thresho $output = form_item(NULL, $output, t('Select your preferred way to display the comments and click "Save settings" to activate your changes.')); } - return theme('box', t('Comment viewing options'), $output); + return theme('wrapper', $output, 'comment-options', 'comment', t('Comment viewing options')); } function comment_moderation_form($comment) { Index: modules/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu.module,v retrieving revision 1.32 diff -u -F^f -r1.32 menu.module --- modules/menu.module 18 Jul 2005 16:46:28 -0000 1.32 +++ modules/menu.module 23 Jul 2005 12:30:49 -0000 @@ -414,7 +414,7 @@ function menu_overview_tree() { } $table = theme('item_list', $operations); $table .= theme('table', $header, menu_overview_tree_rows($mid)); - $output .= theme('box', $menu['items'][$mid]['title'], $table); + $output .= theme('wrapper', $table, 'menu-table', 'admin-table', $menu['items'][$mid]['title']); } return $output; } Index: modules/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search.module,v retrieving revision 1.128 diff -u -F^f -r1.128 search.module --- modules/search.module 27 Jun 2005 18:33:32 -0000 1.128 +++ modules/search.module 23 Jul 2005 12:30:50 -0000 @@ -578,11 +578,11 @@ function search_view() { $results = search_data($keys, $type); if ($results) { - $results = theme('box', t('Search results'), $results); + $results = theme('wrapper', $results, 'search-results', 'search-results', t('Search results')); } else { - $results = theme('box', t('Your search yielded no results'), search_help('search#noresults')); - } + $results = theme('wrapper', search_help('search#noresults'), 'search-results', 'message', t('Your search yielded no results')); + } } else if (isset($_POST['edit'])) { form_set_error('keys', t('Please enter some keywords.')); Index: modules/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user.module,v retrieving revision 1.491 diff -u -F^f -r1.491 user.module --- modules/user.module 23 Jul 2005 05:53:43 -0000 1.491 +++ modules/user.module 23 Jul 2005 12:30:54 -0000 @@ -613,7 +613,7 @@ function theme_user_profile($account, $f $output = "
\n"; $output .= theme('user_picture', $account); foreach ($fields as $category => $value) { - $output .= theme('box', $category, $value); + $output .= theme('wrapper', $value, "user-profile-".$id++,"user-profile", $category); } $output .= "
\n";