Commit 76957a25 authored by Dries's avatar Dries

- Patch #470594 by Moshe: convert more pages and blocks to return arrays.

parent 12024dbc
......@@ -13,10 +13,10 @@ function comment_admin($type = 'new') {
$edit = $_POST;
if (isset($edit['operation']) && ($edit['operation'] == 'delete') && isset($edit['comments']) && $edit['comments']) {
return drupal_render(drupal_get_form('comment_multiple_delete_confirm'));
return drupal_get_form('comment_multiple_delete_confirm');
}
else {
return drupal_render(drupal_get_form('comment_admin_overview', $type, arg(4)));
return drupal_get_form('comment_admin_overview', $type, arg(4));
}
}
......
......@@ -47,8 +47,8 @@ function dblog_overview() {
WATCHDOG_EMERG => 'dblog-emerg',
);
$output = drupal_render(drupal_get_form('dblog_filter_form'));
$output .= drupal_render(drupal_get_form('dblog_clear_log_form'));
$build['dblog_filter_form'] = drupal_get_form('dblog_filter_form');
$build['dblog_clear_log_form'] = drupal_get_form('dblog_clear_log_form');
$header = array(
' ',
......@@ -100,10 +100,10 @@ function dblog_overview() {
$rows[] = array(array('data' => t('No log messages available.'), 'colspan' => 6));
}
$output .= theme('table', $header, $rows, array('id' => 'admin-dblog'));
$output .= theme('pager', NULL);
$build['dblog_table'] = array('#markup' => theme('table', $header, $rows, array('id' => 'admin-dblog')));
$build['dblog_pager'] = array('#markup' => theme('pager', NULL));
return $output;
return $build;
}
/**
......
......@@ -453,7 +453,7 @@ function field_format($obj_type, $object, $field, $item, $formatter_name = NULL,
}
/**
* Render a single field, fully themed with label and multiple values.
* Return a single field, fully themed with label and multiple values.
*
* To be used by third-party code (Views, Panels...) that needs to output
* an isolated field. Do *not* use inside node templates, use the
......@@ -494,8 +494,8 @@ function field_view_field($obj_type, $object, $field, $instance, $teaser = FALSE
// TODO : what about hook_field_attach_view ?
// field_default_view() adds a wrapper to handle variables and 'excluded'
// fields for node templates. We bypass it and render the actual field.
$output = drupal_render($view[$field['field_name']]['field']);
// fields for node templates. We bypass it and return the actual field.
$output = $view[$field['field_name']]['field'];
}
return $output;
}
......
......@@ -53,9 +53,9 @@ function openid_user_identities($account) {
$rows[] = array(check_plain($identity->authname), l(t('Delete'), 'user/' . $account->uid . '/openid/delete/' . $identity->aid));
}
$output = theme('table', $header, $rows);
$output .= drupal_render(drupal_get_form('openid_user_add'));
return $output;
$build['openid_table'] = array('#markup' => theme('table', $header, $rows));
$build['openid_user_add'] = drupal_get_form('openid_user_add');
return $build;
}
/**
......
......@@ -161,7 +161,7 @@ function poll_block_view($delta = '') {
if ($poll->nid) {
$poll = poll_view($poll, TRUE, FALSE, TRUE);
$block['subject'] = t('Poll');
$block['content'] = drupal_render($poll->content);
$block['content'] = $poll->content;
return $block;
}
}
......
......@@ -175,7 +175,7 @@ function search_block_list() {
*/
function search_block_view($delta = '') {
if (user_access('search content')) {
$block['content'] = drupal_render(drupal_get_form('search_block_form'));
$block['content'] = drupal_get_form('search_block_form');
$block['subject'] = t('Search');
return $block;
}
......
......@@ -40,10 +40,10 @@ function search_view($type = 'node') {
}
// Construct the search form.
$output = drupal_render(drupal_get_form('search_form', NULL, $keys, $type));
$output .= $results;
$build['search_form'] = drupal_get_form('search_form', NULL, $keys, $type);
$build['search_results'] = array('#markup' => $results);
return $output;
return $build;
}
return drupal_get_form('search_form', NULL, empty($keys) ? '' : $keys, $type);
......
......@@ -1686,7 +1686,6 @@ function system_action_info() {
* Menu callback. Display an overview of available and configured actions.
*/
function system_actions_manage() {
$output = '';
actions_synchronize();
$actions = actions_list();
$actions_map = actions_actions_map($actions);
......@@ -1730,15 +1729,15 @@ function system_actions_manage() {
if (!empty($pager)) {
$row[] = array(array('data' => $pager, 'colspan' => '3'));
}
$output .= '<h3>' . t('Actions available to Drupal:') . '</h3>';
$output .= theme('table', $header, $row);
$build['system_actions_header'] = array('#markup' => '<h3>' . t('Actions available to Drupal:') . '</h3>');
$build['system_actions_table'] = array('#markup' => theme('table', $header, $row));
}
if ($actions_map) {
$output .= drupal_render(drupal_get_form('system_actions_manage_form', $options));
$build['system_actions_manage_form'] = drupal_get_form('system_actions_manage_form', $options);
}
return $output;
return $build;
}
/**
......
......@@ -1110,7 +1110,7 @@ function user_block_view($delta = '') {
if (!$user->uid && !(arg(0) == 'user' && !is_numeric(arg(1)))) {
$block['subject'] = t('User login');
$block['content'] = drupal_render(drupal_get_form('user_login_block'));
$block['content'] = drupal_get_form('user_login_block');
}
return $block;
......
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