? files
? theme_wrapper_2.patch
? theme_wrapper_3.patch
? modules/devel
? sites/webschuur.dyndns.org.DPL
? themes/engines/phptemplate/wrapper.tpl.php
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.254
diff -u -F^f -u -F^f -r1.254 theme.inc
--- includes/theme.inc 18 Aug 2005 22:07:14 -0000 1.254
+++ includes/theme.inc 22 Aug 2005 07:45:25 -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.365
diff -u -F^f -u -F^f -r1.365 comment.module
--- modules/comment.module 17 Aug 2005 20:07:35 -0000 1.365
+++ modules/comment.module 22 Aug 2005 07:45:27 -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.33
diff -u -F^f -u -F^f -r1.33 menu.module
--- modules/menu.module 9 Aug 2005 00:37:02 -0000 1.33
+++ modules/menu.module 22 Aug 2005 07:45:27 -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.132
diff -u -F^f -u -F^f -r1.132 search.module
--- modules/search.module 29 Jul 2005 08:18:20 -0000 1.132
+++ modules/search.module 22 Aug 2005 07:45:28 -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.501
diff -u -F^f -u -F^f -r1.501 user.module
--- modules/user.module 11 Aug 2005 13:52:44 -0000 1.501
+++ modules/user.module 22 Aug 2005 07:45:32 -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/engines/phptemplate/phptemplate.engine
===================================================================
RCS file: /cvs/drupal/drupal/themes/engines/phptemplate/phptemplate.engine,v
retrieving revision 1.13
diff -u -F^f -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 22 Aug 2005 07:45:32 -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 {