summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-02-03 18:55:32 +0000
committerDries Buytaert <dries@buytaert.net>2009-02-03 18:55:32 +0000
commit29c8e40e912f8975011224f824977b2353fe07b5 (patch)
treebb6a3341259232340b88ca120cf349c57404c13b /modules
parent607e9626d5af265b18e8319b156bb0fda3445cd4 (diff)
downloadbrdo-29c8e40e912f8975011224f824977b2353fe07b5.tar.gz
brdo-29c8e40e912f8975011224f824977b2353fe07b5.tar.bz2
- Patch #355236 by Frando: refactor drupal_render() theming.
Diffstat (limited to 'modules')
-rw-r--r--modules/aggregator/aggregator.pages.inc2
-rw-r--r--modules/block/block.admin.inc2
-rw-r--r--modules/color/color.module2
-rw-r--r--modules/filter/filter.admin.inc4
-rw-r--r--modules/menu/menu.admin.inc2
-rw-r--r--modules/node/node.admin.inc4
-rw-r--r--modules/node/node.module4
-rw-r--r--modules/node/node.pages.inc2
-rw-r--r--modules/poll/poll.module4
-rw-r--r--modules/profile/profile.admin.inc2
-rw-r--r--modules/system/system.admin.inc4
-rw-r--r--modules/system/system.module37
-rw-r--r--modules/taxonomy/taxonomy.admin.inc4
-rw-r--r--modules/trigger/trigger.admin.inc4
-rw-r--r--modules/upload/upload.module4
-rw-r--r--modules/user/user.admin.inc8
-rw-r--r--modules/user/user.module8
17 files changed, 67 insertions, 30 deletions
diff --git a/modules/aggregator/aggregator.pages.inc b/modules/aggregator/aggregator.pages.inc
index 99dec6037..c311dab14 100644
--- a/modules/aggregator/aggregator.pages.inc
+++ b/modules/aggregator/aggregator.pages.inc
@@ -250,7 +250,7 @@ function theme_aggregator_categorize_items($form) {
}
$output .= theme('table', array('', t('Categorize')), $rows);
$output .= drupal_render($form['submit']);
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
return theme('aggregator_wrapper', $output);
}
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc
index 00afc9bd8..6dd17f308 100644
--- a/modules/block/block.admin.inc
+++ b/modules/block/block.admin.inc
@@ -403,5 +403,5 @@ function template_preprocess_block_admin_display_form(&$variables) {
}
}
- $variables['form_submit'] = drupal_render($variables['form']);
+ $variables['form_submit'] = drupal_render_children($variables['form']);
}
diff --git a/modules/color/color.module b/modules/color/color.module
index d64a64b64..b9e30f67b 100644
--- a/modules/color/color.module
+++ b/modules/color/color.module
@@ -239,7 +239,7 @@ function theme_color_scheme_form($form) {
}
$output .= '</div>';
// Preview
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
$output .= '<h2>' . t('Preview') . '</h2>';
$output .= '<div id="preview"><div id="text"><h2>Lorem ipsum dolor</h2><p>Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud <a href="#">exercitation ullamco</a> laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p></div><div id="img" style="background-image: url(' . base_path() . $path . $info['preview_image'] . ')"></div></div>';
// Close the wrapper div.
diff --git a/modules/filter/filter.admin.inc b/modules/filter/filter.admin.inc
index 24879538d..894533132 100644
--- a/modules/filter/filter.admin.inc
+++ b/modules/filter/filter.admin.inc
@@ -82,7 +82,7 @@ function theme_filter_admin_overview($form) {
}
$header = array(t('Name'), t('Roles'), t('Default'), t('Weight'), array('data' => t('Operations'), 'colspan' => 2));
$output = theme('table', $header, $rows, array('id' => 'input-format-order'));
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
drupal_add_tabledrag('input-format-order', 'order', 'sibling', 'input-format-order-weight');
@@ -391,7 +391,7 @@ function theme_filter_admin_order($form) {
}
$output = theme('table', $header, $rows, array('id' => 'filter-order'));
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
drupal_add_tabledrag('filter-order', 'order', 'sibling', 'filter-order-weight', NULL, NULL, FALSE);
diff --git a/modules/menu/menu.admin.inc b/modules/menu/menu.admin.inc
index 8d6db3c44..d793c88f7 100644
--- a/modules/menu/menu.admin.inc
+++ b/modules/menu/menu.admin.inc
@@ -216,7 +216,7 @@ function theme_menu_overview_form($form) {
if ($rows) {
$output .= theme('table', $header, $rows, array('id' => 'menu-overview'));
}
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
return $output;
}
diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc
index 4ae27118b..9fabbf689 100644
--- a/modules/node/node.admin.inc
+++ b/modules/node/node.admin.inc
@@ -269,7 +269,7 @@ function theme_node_filter_form($form) {
$output .= '<div id="node-admin-filter">';
$output .= drupal_render($form['filters']);
$output .= '</div>';
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
return $output;
}
@@ -616,7 +616,7 @@ function theme_node_admin_nodes($form) {
$output .= drupal_render($form['pager']);
}
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
return $output;
}
diff --git a/modules/node/node.module b/modules/node/node.module
index e25e86bc9..1e73c1958 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1612,7 +1612,7 @@ function theme_node_search_admin($form) {
}
$output .= theme('table', $header, $rows);
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
return $output;
}
@@ -3138,7 +3138,7 @@ function node_list_permissions($type) {
* Implementation of hook_elements().
*/
function node_elements() {
- $type['node_links'] = array();
+ $type['node_links'] = array('#theme' => 'node_links');
return $type;
}
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 87106deed..03866ec8b 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -335,7 +335,7 @@ function theme_node_form($form) {
$output = "\n<div class=\"node-form\">\n";
$output .= " <div class=\"standard\">\n";
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
$output .= " </div>\n";
$output .= "</div>\n";
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index 45de98605..fe82f98b4 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -624,7 +624,7 @@ function template_preprocess_poll_vote(&$variables) {
$variables['choice'] = drupal_render($form['choice']);
$variables['title'] = check_plain($form['#node']->title);
$variables['vote'] = drupal_render($form['vote']);
- $variables['rest'] = drupal_render($form);
+ $variables['rest'] = drupal_render_children($form);
$variables['block'] = $form['#block'];
// If this is a block, allow a different tpl.php to be used.
if ($variables['block']) {
@@ -698,7 +698,7 @@ function theme_poll_choices($form) {
}
$output = theme('table', $headers, $rows, array('id' => 'poll-choice-table'));
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
return $output;
}
diff --git a/modules/profile/profile.admin.inc b/modules/profile/profile.admin.inc
index 67e1d0b8e..e0252ce10 100644
--- a/modules/profile/profile.admin.inc
+++ b/modules/profile/profile.admin.inc
@@ -152,7 +152,7 @@ function theme_profile_admin_overview($form) {
$header[] = array('data' => t('Operations'), 'colspan' => 2);
$output = theme('table', $header, $rows, array('id' => 'profile-fields'));
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
return $output;
}
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index be461d727..740214783 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -2174,7 +2174,7 @@ function theme_system_modules_uninstall($form) {
}
$output = theme('table', $header, $rows);
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
return $output;
}
@@ -2256,6 +2256,6 @@ function theme_system_themes_form($form) {
$header = array(t('Screenshot'), t('Name'), t('Version'), t('Enabled'), t('Default'), t('Operations'));
$output = theme('table', $header, $rows);
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
return $output;
}
diff --git a/modules/system/system.module b/modules/system/system.module
index 0db103ae3..33386da6d 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -235,6 +235,7 @@ function system_elements() {
$type['form'] = array(
'#method' => 'post',
'#action' => request_uri(),
+ '#theme_wrapper' => 'form',
);
$type['page'] = array(
@@ -259,6 +260,7 @@ function system_elements() {
'#button_type' => 'submit',
'#executes_submit_callback' => TRUE,
'#process' => array('form_process_ahah'),
+ '#theme_wrapper' => 'button',
);
$type['button'] = array(
@@ -267,6 +269,7 @@ function system_elements() {
'#button_type' => 'submit',
'#executes_submit_callback' => FALSE,
'#process' => array('form_process_ahah'),
+ '#theme_wrapper' => 'button',
);
$type['image_button'] = array(
@@ -277,6 +280,7 @@ function system_elements() {
'#return_value' => TRUE,
'#has_garbage_value' => TRUE,
'#src' => NULL,
+ '#theme_wrapper' => 'image_button',
);
$type['textfield'] = array(
@@ -285,6 +289,8 @@ function system_elements() {
'#maxlength' => 128,
'#autocomplete_path' => FALSE,
'#process' => array('form_process_input_format', 'form_process_ahah'),
+ '#theme' => 'textfield',
+ '#theme_wrapper' => 'form_element',
);
$type['password'] = array(
@@ -292,11 +298,14 @@ function system_elements() {
'#size' => 60,
'#maxlength' => 128,
'#process' => array('form_process_ahah'),
+ '#theme' => 'password',
+ '#theme_wrapper' => 'form_element',
);
$type['password_confirm'] = array(
'#input' => TRUE,
'#process' => array('form_process_password_confirm'),
+ '#theme_wrapper' => 'form_element',
);
$type['textarea'] = array(
@@ -305,29 +314,41 @@ function system_elements() {
'#rows' => 5,
'#resizable' => TRUE,
'#process' => array('form_process_input_format', 'form_process_ahah'),
+ '#theme' => 'textarea',
+ '#theme_wrapper' => 'form_element',
);
$type['radios'] = array(
'#input' => TRUE,
'#process' => array('form_process_radios'),
+ '#theme_wrapper' => 'radios',
+ '#pre_render' => array('form_pre_render_conditional_form_element'),
);
$type['radio'] = array(
'#input' => TRUE,
'#default_value' => NULL,
'#process' => array('form_process_ahah'),
+ '#theme' => 'radio',
+ '#theme_wrapper' => 'form_element',
+ '#form_element_skip_title' => TRUE,
);
$type['checkboxes'] = array(
'#input' => TRUE,
'#tree' => TRUE,
'#process' => array('form_process_checkboxes'),
+ '#theme_wrapper' => 'checkboxes',
+ '#pre_render' => array('form_pre_render_conditional_form_element'),
);
$type['checkbox'] = array(
'#input' => TRUE,
'#return_value' => 1,
'#process' => array('form_process_ahah'),
+ '#theme' => 'checkbox',
+ '#theme_wrapper' => 'form_element',
+ '#form_element_skip_title' => TRUE,
);
$type['select'] = array(
@@ -335,6 +356,8 @@ function system_elements() {
'#size' => 0,
'#multiple' => FALSE,
'#process' => array('form_process_ahah'),
+ '#theme' => 'select',
+ '#theme_wrapper' => 'form_element',
);
$type['weight'] = array(
@@ -348,11 +371,15 @@ function system_elements() {
'#input' => TRUE,
'#element_validate' => array('date_validate'),
'#process' => array('form_process_date'),
+ '#theme' => 'date',
+ '#theme_wrapper' => 'form_element',
);
$type['file'] = array(
'#input' => TRUE,
'#size' => 60,
+ '#theme' => 'file',
+ '#theme_wrapper' => 'form_element',
);
$type['tableselect'] = array(
'#input' => TRUE,
@@ -361,6 +388,7 @@ function system_elements() {
'#process' => array('form_process_tableselect'),
'#options' => array(),
'#empty' => '',
+ '#theme' => 'tableselect'
);
/**
@@ -368,11 +396,14 @@ function system_elements() {
*/
$type['item'] = array(
'#markup' => '',
+ '#theme' => 'markup',
+ '#theme_wrapper' => 'form_element',
);
$type['hidden'] = array(
'#input' => TRUE,
'#process' => array('form_process_ahah'),
+ '#theme' => 'hidden',
);
$type['value'] = array(
@@ -380,8 +411,8 @@ function system_elements() {
);
$type['markup'] = array(
- '#prefix' => '',
- '#suffix' => '',
+ '#markup' => '',
+ '#theme' => 'markup',
);
$type['fieldset'] = array(
@@ -389,10 +420,12 @@ function system_elements() {
'#collapsed' => FALSE,
'#value' => NULL,
'#process' => array('form_process_ahah'),
+ '#theme_wrapper' => 'fieldset',
);
$type['token'] = array(
'#input' => TRUE,
+ '#theme' => array('hidden'),
);
return $type;
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc
index 3d9bd5092..1129e33c9 100644
--- a/modules/taxonomy/taxonomy.admin.inc
+++ b/modules/taxonomy/taxonomy.admin.inc
@@ -91,7 +91,7 @@ function theme_taxonomy_overview_vocabularies($form) {
drupal_add_tabledrag('taxonomy', 'order', 'sibling', 'vocabulary-weight');
}
$header[] = array('data' => t('Operations'), 'colspan' => '3');
- return theme('table', $header, $rows, array('id' => 'taxonomy')) . drupal_render($form);
+ return theme('table', $header, $rows, array('id' => 'taxonomy')) . drupal_render_children($form);
}
/**
@@ -605,7 +605,7 @@ function theme_taxonomy_overview_terms($form) {
$header = array(t('Name'), t('Operations'));
$output = theme('table', $header, $rows, array('id' => 'taxonomy'));
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
$output .= theme('pager', NULL, $page_increment);
return $output;
diff --git a/modules/trigger/trigger.admin.inc b/modules/trigger/trigger.admin.inc
index 9d647db7c..5a33b6249 100644
--- a/modules/trigger/trigger.admin.inc
+++ b/modules/trigger/trigger.admin.inc
@@ -246,10 +246,10 @@ function theme_trigger_display($element) {
}
if (count($rows)) {
- $output = theme('table', $header, $rows) . drupal_render($element);
+ $output = theme('table', $header, $rows) . drupal_render_children($element);
}
else {
- $output = drupal_render($element);
+ $output = drupal_render_children($element);
}
return $output;
}
diff --git a/modules/upload/upload.module b/modules/upload/upload.module
index 0971c978b..d61433aac 100644
--- a/modules/upload/upload.module
+++ b/modules/upload/upload.module
@@ -621,7 +621,7 @@ function theme_upload_form_current($form) {
$rows[] = array('data' => $row, 'class' => 'draggable');
}
$output = theme('table', $header, $rows, array('id' => 'upload-attachments'));
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
return $output;
}
@@ -633,7 +633,7 @@ function theme_upload_form_current($form) {
*/
function theme_upload_form_new($form) {
drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight');
- $output = drupal_render($form);
+ $output = drupal_render_children($form);
return $output;
}
diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc
index 6a2b05136..b0e8d50a5 100644
--- a/modules/user/user.admin.inc
+++ b/modules/user/user.admin.inc
@@ -651,7 +651,7 @@ function theme_user_admin_perm($form) {
}
$output = theme('system_compact_link');
$output .= theme('table', $header, $rows, array('id' => 'permissions'));
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
return $output;
}
@@ -788,7 +788,7 @@ function theme_user_admin_account($form) {
$output .= drupal_render($form['pager']);
}
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
return $output;
}
@@ -811,7 +811,7 @@ function theme_user_admin_new_role($form) {
}
$rows[] = array(drupal_render($form['name']), array('data' => drupal_render($form['submit']), 'colspan' => 2));
- $output = drupal_render($form);
+ $output = drupal_render_children($form);
$output .= theme('table', $header, $rows);
return $output;
@@ -826,7 +826,7 @@ function theme_user_filter_form($form) {
$output = '<div id="user-admin-filter">';
$output .= drupal_render($form['filters']);
$output .= '</div>';
- $output .= drupal_render($form);
+ $output .= drupal_render_children($form);
return $output;
}
diff --git a/modules/user/user.module b/modules/user/user.module
index 39e98e8e8..b430121d4 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -753,8 +753,12 @@ function user_search($op = 'search', $keys = NULL, $skip_access_check = FALSE) {
*/
function user_elements() {
return array(
- 'user_profile_category' => array(),
- 'user_profile_item' => array(),
+ 'user_profile_category' => array(
+ '#theme_wrapper' => 'user_profile_category'
+ ),
+ 'user_profile_item' => array(
+ '#theme' => 'user_profile_item'
+ ),
);
}