summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-07-29 06:39:35 +0000
committerDries Buytaert <dries@buytaert.net>2009-07-29 06:39:35 +0000
commit715a2d655f70675f3bec8a320a864865d6d02d47 (patch)
treefffff07032e77f118a4290fc62f290d91cf831f0
parent40c8986ac74b0ab15f0571c24052d1be06bd2ccb (diff)
downloadbrdo-715a2d655f70675f3bec8a320a864865d6d02d47.tar.gz
brdo-715a2d655f70675f3bec8a320a864865d6d02d47.tar.bz2
- Patch #511748 by moshe weitzman: pushing rending to later in the cycle so there is more room for customization.
-rw-r--r--includes/common.inc2
-rw-r--r--modules/blog/blog.pages.inc4
-rw-r--r--modules/comment/comment.admin.inc4
-rw-r--r--modules/dblog/dblog.admin.inc32
-rw-r--r--modules/node/content_types.inc8
-rw-r--r--modules/node/node.module2
-rw-r--r--modules/node/node.pages.inc8
-rw-r--r--modules/openid/openid.pages.inc6
-rw-r--r--modules/path/path.admin.inc12
-rw-r--r--modules/poll/poll.pages.inc12
-rw-r--r--modules/search/search.pages.inc21
-rw-r--r--modules/simpletest/simpletest.pages.inc4
-rw-r--r--modules/statistics/statistics.admin.inc46
-rw-r--r--modules/statistics/statistics.pages.inc20
-rw-r--r--modules/system/system.admin.inc6
-rw-r--r--modules/translation/translation.pages.inc9
16 files changed, 135 insertions, 61 deletions
diff --git a/includes/common.inc b/includes/common.inc
index cb69c9548..41399f8e2 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -4131,7 +4131,7 @@ function drupal_common_theme() {
'arguments' => array('links' => NULL),
),
'table' => array(
- 'arguments' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL),
+ 'arguments' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'sticky' => TRUE),
),
'table_select_header_cell' => array(
'arguments' => array(),
diff --git a/modules/blog/blog.pages.inc b/modules/blog/blog.pages.inc
index c8596fd40..e36f3ef12 100644
--- a/modules/blog/blog.pages.inc
+++ b/modules/blog/blog.pages.inc
@@ -46,7 +46,7 @@ function blog_page_user($account) {
$nodes = node_load_multiple($nids);
$build += node_build_multiple($nodes);
$build['pager'] = array(
- '#markup' => theme('pager', NULL),
+ '#theme' => 'pager',
'#weight' => 5,
);
}
@@ -95,7 +95,7 @@ function blog_page_last() {
$nodes = node_load_multiple($nids);
$build += node_build_multiple($nodes);
$build['pager'] = array(
- '#markup' => theme('pager', NULL),
+ '#theme' => 'pager',
'#weight' => 5,
);
}
diff --git a/modules/comment/comment.admin.inc b/modules/comment/comment.admin.inc
index fba703d2e..1f90a64b9 100644
--- a/modules/comment/comment.admin.inc
+++ b/modules/comment/comment.admin.inc
@@ -101,9 +101,7 @@ function comment_admin_overview($type = 'new', $arg) {
'#empty' => t('No comments available.'),
);
- $form['pager'] = array(
- '#markup' => theme('pager', NULL)
- );
+ $form['pager'] = array('#theme' => 'pager');
return $form;
}
diff --git a/modules/dblog/dblog.admin.inc b/modules/dblog/dblog.admin.inc
index 9e045acbb..1eab21f66 100644
--- a/modules/dblog/dblog.admin.inc
+++ b/modules/dblog/dblog.admin.inc
@@ -92,8 +92,13 @@ function dblog_overview() {
$rows[] = array(array('data' => t('No log messages available.'), 'colspan' => 6));
}
- $build['dblog_table'] = array('#markup' => theme('table', $header, $rows, array('id' => 'admin-dblog')));
- $build['dblog_pager'] = array('#markup' => theme('pager', NULL));
+ $build['dblog_table'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ '#attributes' => array('id' => 'admin-dblog'),
+ );
+ $build['dblog_pager'] = array('#theme' => 'pager');
return $build;
}
@@ -133,10 +138,14 @@ function dblog_top($type) {
$rows[] = array(array('data' => t('No log messages available.'), 'colspan' => 2));
}
- $output = theme('table', $header, $rows);
- $output .= theme('pager', NULL);
+ $build['dblog_top_table'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ );
+ $build['dblog_top_pager'] = array('#theme' => 'pager');
- return $output;
+ return $build;
}
/**
@@ -144,7 +153,6 @@ function dblog_top($type) {
*/
function dblog_event($id) {
$severity = watchdog_severity_levels();
- $output = '';
$result = db_query('SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid WHERE w.wid = :id', array(':id' => $id))->fetchObject();
if ($dblog = $result) {
$rows = array(
@@ -185,10 +193,16 @@ function dblog_event($id) {
$dblog->link,
),
);
- $attributes = array('class' => 'dblog-event');
- $output = theme('table', array(), $rows, $attributes);
+ $build['dblog_table'] = array(
+ '#theme' => 'table',
+ '#rows' => $rows,
+ '#attributes' => array('class' => 'dblog-event'),
+ );
+ return $build;
+ }
+ else {
+ return '';
}
- return $output;
}
/**
diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc
index d869153de..597576021 100644
--- a/modules/node/content_types.inc
+++ b/modules/node/content_types.inc
@@ -37,8 +37,14 @@ function node_overview_types() {
if (empty($rows)) {
$rows[] = array(array('data' => t('No content types available. <a href="@link">Add content type</a>.', array('@link' => url('admin/structure/types/add'))), 'colspan' => '5', 'class' => 'message'));
}
+
+ $build['node_table'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows
+ );
- return theme('table', $header, $rows);
+ return $build;
}
function theme_node_admin_overview($name, $type) {
diff --git a/modules/node/node.module b/modules/node/node.module
index 5e13be9e0..5f8e30f5a 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1991,7 +1991,7 @@ function node_page_default() {
$feed_url = url('rss.xml', array('absolute' => TRUE));
drupal_add_feed($feed_url, variable_get('site_name', 'Drupal') . ' ' . t('RSS'));
$build['pager'] = array(
- '#markup' => theme('pager', NULL),
+ '#theme' => 'pager',
'#weight' => 5,
);
drupal_set_title('');
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 6990d6c19..42fd59b8e 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -512,8 +512,14 @@ function node_revision_overview($node) {
}
$rows[] = array_merge($row, $operations);
}
+
+ $build['node_revisions_table'] = array(
+ '#theme' => 'table',
+ '#rows' => $rows,
+ '#header' => $header,
+ );
- return theme('table', $header, $rows);
+ return $build;
}
/**
diff --git a/modules/openid/openid.pages.inc b/modules/openid/openid.pages.inc
index 789b026bb..d189ac982 100644
--- a/modules/openid/openid.pages.inc
+++ b/modules/openid/openid.pages.inc
@@ -53,7 +53,11 @@ function openid_user_identities($account) {
$rows[] = array(check_plain($identity->authname), l(t('Delete'), 'user/' . $account->uid . '/openid/delete/' . $identity->aid));
}
- $build['openid_table'] = array('#markup' => theme('table', $header, $rows));
+ $build['openid_table'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ );
$build['openid_user_add'] = drupal_get_form('openid_user_add');
return $build;
}
diff --git a/modules/path/path.admin.inc b/modules/path/path.admin.inc
index 5276452ef..2809b7090 100644
--- a/modules/path/path.admin.inc
+++ b/modules/path/path.admin.inc
@@ -13,7 +13,7 @@
*/
function path_admin_overview($keys = NULL) {
// Add the filter form above the overview table.
- $output = drupal_get_form('path_admin_filter_form', $keys);
+ $build['path_admin_filter_form'] = drupal_get_form('path_admin_filter_form', $keys);
// Enable language column if locale is enabled or if we have any alias with language
$alias_exists = (bool) db_query_range('SELECT 1 FROM {url_alias} WHERE language <> :language', array(':language' => ''), 0, 1)->fetchField();
$multilanguage = (module_exists('locale') || $alias_exists);
@@ -63,10 +63,14 @@ function path_admin_overview($keys = NULL) {
$rows[] = array(array('data' => $empty_message, 'colspan' => ($multilanguage ? 5 : 4)));
}
- $output .= theme('table', $header, $rows);
- $output .= theme('pager', NULL);
+ $build['path_table'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows
+ );
+ $build['path_pager'] = array('#theme' => 'pager');
- return $output;
+ return $build;
}
/**
diff --git a/modules/poll/poll.pages.inc b/modules/poll/poll.pages.inc
index 7a23597b6..1db257620 100644
--- a/modules/poll/poll.pages.inc
+++ b/modules/poll/poll.pages.inc
@@ -52,7 +52,6 @@ function poll_page() {
function poll_votes($node) {
$votes_per_page = 20;
drupal_set_title($node->title);
- $output = t('This table lists all the recorded votes for this poll. If anonymous users are allowed to vote, they will be identified by the IP address of the computer they used when they voted.');
$header[] = array('data' => t('Visitor'), 'field' => 'u.name');
$header[] = array('data' => t('Vote'), 'field' => 'pc.chtext');
@@ -78,9 +77,14 @@ function poll_votes($node) {
format_date($vote->timestamp),
);
}
- $output .= theme('table', $header, $rows);
- $output .= theme('pager', NULL);
- return $output;
+ $build['poll_votes_table'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ '#prefix' => t('This table lists all the recorded votes for this poll. If anonymous users are allowed to vote, they will be identified by the IP address of the computer they used when they voted.'),
+ );
+ $build['poll_votes_pager'] = array('#theme' => 'pager');
+ return $build;
}
/**
diff --git a/modules/search/search.pages.inc b/modules/search/search.pages.inc
index 424619e23..da634f590 100644
--- a/modules/search/search.pages.inc
+++ b/modules/search/search.pages.inc
@@ -31,19 +31,16 @@ function search_view($type = 'node') {
// Collect the search results:
$results = search_data($keys, $type);
- if ($results) {
- $results = theme('search_results_listing', t('Search results'), $results);
- }
- else {
- $results = theme('search_results_listing', t('Your search yielded no results'), search_help('search#noresults', drupal_help_arg()));
- }
- }
-
- // Construct the search form.
- $build['search_form'] = drupal_get_form('search_form', NULL, $keys, $type);
- $build['search_results'] = array('#markup' => $results);
+ // Construct the search form.
+ $build['search_form'] = drupal_get_form('search_form', NULL, $keys, $type);
+ $build['search_results'] = array(
+ '#theme' => 'search_results_listing',
+ '#title' => empty($results) ? t('Your search yielded no results') : t('Search results'),
+ '#content' => empty($results) ? search_help('search#noresults', drupal_help_arg()) : $results,
+ );
- return $build;
+ return $build;
+ }
}
return drupal_get_form('search_form', NULL, empty($keys) ? '' : $keys, $type);
diff --git a/modules/simpletest/simpletest.pages.inc b/modules/simpletest/simpletest.pages.inc
index b1875c264..1d208cf6e 100644
--- a/modules/simpletest/simpletest.pages.inc
+++ b/modules/simpletest/simpletest.pages.inc
@@ -260,7 +260,9 @@ function simpletest_result_form(&$form_state, $test_id) {
$form['result']['summary']['#' . $assertion->status]++;
}
$form['result']['results'][$group]['table'] = array(
- '#markup' => theme('table', $header, $rows),
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
);
// Set summary information.
diff --git a/modules/statistics/statistics.admin.inc b/modules/statistics/statistics.admin.inc
index 0e4cff77e..80ef997cf 100644
--- a/modules/statistics/statistics.admin.inc
+++ b/modules/statistics/statistics.admin.inc
@@ -39,9 +39,13 @@ function statistics_recent_hits() {
$rows[] = array(array('data' => t('No statistics available.'), 'colspan' => 4));
}
- $output = theme('table', $header, $rows);
- $output .= theme('pager', NULL);
- return $output;
+ $build['statistics_table'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ );
+ $build['statistics_pager'] = array('#theme' => 'pager');
+ return $build;
}
/**
@@ -83,9 +87,13 @@ function statistics_top_pages() {
}
drupal_set_title(t('Top pages in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))), PASS_THROUGH);
- $output = theme('table', $header, $rows);
- $output .= theme('pager', NULL);
- return $output;
+ $build['statistics_top_pages_table'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ );
+ $build['statistics_top_pages_pager'] = array('#theme' => 'pager');
+ return $build;
}
/**
@@ -133,9 +141,13 @@ function statistics_top_visitors() {
}
drupal_set_title(t('Top visitors in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))), PASS_THROUGH);
- $output = theme('table', $header, $rows);
- $output .= theme('pager', NULL);
- return $output;
+ $build['statistics_top_visitors_table'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ );
+ $build['statistics_top_visitors_pager'] = array('#theme' => 'pager');
+ return $build;
}
/**
@@ -178,9 +190,13 @@ function statistics_top_referrers() {
$rows[] = array(array('data' => t('No statistics available.'), 'colspan' => 3));
}
- $output = theme('table', $header, $rows);
- $output .= theme('pager', NULL);
- return $output;
+ $build['statistics_top_referrers_table'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ );
+ $build['statistics_top_referrers_pager'] = array('#theme' => 'pager');
+ return $build;
}
/**
@@ -216,7 +232,11 @@ function statistics_access_log($aid) {
check_plain($access->hostname)
);
- return theme('table', array(), $rows);
+ $build['statistics_table'] = array(
+ '#theme' => 'table',
+ '#rows' => $rows,
+ );
+ return $build;
}
else {
drupal_not_found();
diff --git a/modules/statistics/statistics.pages.inc b/modules/statistics/statistics.pages.inc
index e0c3b5ac3..d51da7456 100644
--- a/modules/statistics/statistics.pages.inc
+++ b/modules/statistics/statistics.pages.inc
@@ -43,9 +43,13 @@ function statistics_node_tracker() {
}
drupal_set_title($node->title);
- $output = theme('table', $header, $rows);
- $output .= theme('pager', NULL);
- return $output;
+ $build['statistics_table'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows
+ );
+ $build['statistics_pager'] = array('#theme' => 'pager');
+ return $build;
}
else {
drupal_not_found();
@@ -80,9 +84,13 @@ function statistics_user_tracker() {
}
drupal_set_title($account->name);
- $output = theme('table', $header, $rows);
- $output .= theme('pager', NULL);
- return $output;
+ $build['statistics_table'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows
+ );
+ $build['statistics_pager'] = array('#theme' => 'pager');
+ return $build;
}
else {
drupal_not_found();
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 284d02eec..2b569dee4 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -1107,7 +1107,11 @@ function system_ip_blocking() {
$build['system_ip_blocking_form'] = drupal_get_form('system_ip_blocking_form');
- $build['system_ip_blocking_table'] = array('#markup' => theme('table', $header, $rows));
+ $build['system_ip_blocking_table'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ );
return $build;
}
diff --git a/modules/translation/translation.pages.inc b/modules/translation/translation.pages.inc
index 09c82800f..e80a301bb 100644
--- a/modules/translation/translation.pages.inc
+++ b/modules/translation/translation.pages.inc
@@ -55,5 +55,12 @@ function translation_node_overview($node) {
}
drupal_set_title(t('Translations of %title', array('%title' => $node->title)), PASS_THROUGH);
- return theme('table', $header, $rows);
+
+ $build['translation_node_overview'] = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ );
+
+ return $build;
}