Commit 715a2d65 authored by Dries's avatar Dries

- Patch #511748 by moshe weitzman: pushing rending to later in the cycle so...

- Patch #511748 by moshe weitzman: pushing rending to later in the cycle so there is more room for customization.
parent 40c8986a
......@@ -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(),
......
......@@ -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,
);
}
......
......@@ -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;
}
......
......@@ -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;
}
/**
......
......@@ -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) {
......
......@@ -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('');
......
......@@ -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;
}
/**
......
......@@ -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;
}
......
......@@ -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;
}
/**
......
......@@ -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;
}
/**
......
......@@ -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);
......
......@@ -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.
......
......@@ -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();
......
......@@ -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();
......
......@@ -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;
}
......
......@@ -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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment