? theme_wrapper_3.patch ? theme_wrapper_4.patch ? sites/localhost.DPL ? sites/webschuur.dyndns.org.DPL Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.256 diff -u -F^f -r1.256 theme.inc --- includes/theme.inc 28 Aug 2005 15:29:34 -0000 1.256 +++ includes/theme.inc 29 Aug 2005 16:51:21 -0000 @@ -772,19 +772,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.367 diff -u -F^f -r1.367 comment.module --- modules/comment.module 28 Aug 2005 15:16:58 -0000 1.367 +++ modules/comment.module 29 Aug 2005 16:51:23 -0000 @@ -1435,14 +1435,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) { @@ -1501,7 +1499,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.34 diff -u -F^f -r1.34 menu.module --- modules/menu.module 25 Aug 2005 21:14:16 -0000 1.34 +++ modules/menu.module 29 Aug 2005 16:51:23 -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.133 diff -u -F^f -r1.133 search.module --- modules/search.module 25 Aug 2005 21:14:17 -0000 1.133 +++ modules/search.module 29 Aug 2005 16:51:24 -0000 @@ -576,11 +576,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.502 diff -u -F^f -r1.502 user.module --- modules/user.module 25 Aug 2005 21:14:17 -0000 1.502 +++ modules/user.module 29 Aug 2005 16:51:26 -0000 @@ -625,7 +625,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"; Index: themes/bluemarine/style.css =================================================================== RCS file: /cvs/drupal/drupal/themes/bluemarine/style.css,v retrieving revision 1.10 diff -u -F^f -r1.10 style.css --- themes/bluemarine/style.css 19 Jun 2005 08:50:46 -0000 1.10 +++ themes/bluemarine/style.css 29 Aug 2005 16:51:26 -0000 @@ -212,7 +212,7 @@ fieldset { .links a { font-weight: bold; } -.block, .box { +.block, .wrapper { padding: 0 0 1.5em 0; } .block { @@ -223,7 +223,7 @@ fieldset { .block .title { margin-bottom: .25em; } -.box .title { +.wrapper .title { font-size: 1.1em; } .node { Index: themes/engines/phptemplate/phptemplate.engine =================================================================== RCS file: /cvs/drupal/drupal/themes/engines/phptemplate/phptemplate.engine,v retrieving revision 1.13 diff -u -F^f -r1.13 phptemplate.engine --- themes/engines/phptemplate/phptemplate.engine 16 Aug 2005 18:06:18 -0000 1.13 +++ themes/engines/phptemplate/phptemplate.engine 29 Aug 2005 16:51:26 -0000 @@ -284,13 +284,17 @@ function phptemplate_block($block) { } /** - * Prepare the values passed to the theme_box function to be passed + * Prepare the values passed to the theme_wrapper function to be passed * into a pluggable template engine. */ -function phptemplate_box($title, $content, $region = 'main') { - return _phptemplate_callback('box', array( +function phptemplate_wrapper($content, $id, $class = NULL, $title = NULL) { + if ($class) { + $class = ' ' . $class; //add a space, so that we get class="wrapper foo" + } + return _phptemplate_callback('wrapper', array( 'content' => $content, - 'region' => $region, + 'id' => $id, + 'class' => $class, 'title' => $title )); } @@ -319,7 +323,7 @@ function _phptemplate_default($hook, $va $file = path_to_theme() . "/$hook.tpl.php"; } else { - if (in_array($hook, array('node', 'block', 'box', 'comment'))) { + if (in_array($hook, array('node', 'block', 'wrapper', 'comment'))) { $file = "themes/engines/phptemplate/$hook.tpl.php"; } else { Index: themes/pushbutton/style.css =================================================================== RCS file: /cvs/drupal/drupal/themes/pushbutton/style.css,v retrieving revision 1.11 diff -u -F^f -r1.11 style.css --- themes/pushbutton/style.css 19 Jun 2005 08:50:46 -0000 1.11 +++ themes/pushbutton/style.css 29 Aug 2005 16:51:27 -0000 @@ -372,14 +372,14 @@ fieldset { .links a { font-weight: bold; } -.box { +.wrapper { padding: 0 0 1.5em 0; } -.box { +.wrapper { padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; } -.box h2 { +.wrapper h2 { font-size: 9px; } .block .title h3 { @@ -397,7 +397,7 @@ fieldset { .block { margin-bottom: 1.5em; } -.box .title { +.wrapper .title { font-size: 1.1em; } .node {