diff --git a/core/authorize.php b/core/authorize.php index fe39394..5797188 100644 --- a/core/authorize.php +++ b/core/authorize.php @@ -118,7 +118,11 @@ function authorize_access_allowed() { drupal_set_message($results['page_message']['message'], $results['page_message']['type']); } - $output = theme('authorize_report', array('messages' => $results['messages'])); + $authorize_report = array( + '#theme' => 'authorize_report', + '#messages' => $results['messages'], + ); + $output = drupal_render($authorize_report); $links = array(); if (is_array($results['tasks'])) { @@ -131,7 +135,12 @@ function authorize_access_allowed() { )); } - $output .= theme('item_list', array('items' => $links, 'title' => t('Next steps'))); + $item_list = array( + '#theme' => 'item_list', + '#items' => $links, + '#title' => t('Next steps'), + ); + $output .= drupal_render($item_list); } // If a batch is running, let it run. elseif (isset($_GET['batch'])) { @@ -156,5 +165,10 @@ function authorize_access_allowed() { if (!empty($output)) { drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); - print theme('maintenance_page', array('content' => $output, 'show_messages' => $show_messages)); + $maintenance_page = array( + '#theme' => 'maintenance_page', + '#content' => $output, + '#show_messages' => $show_messages, + ); + print drupal_render($maintenance_page); } diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc index 8e024a8..5f70734 100644 --- a/core/includes/ajax.inc +++ b/core/includes/ajax.inc @@ -479,7 +479,8 @@ function ajax_prepare_response($page_callback_result) { $commands[] = ajax_command_insert(NULL, $html); // Add the status messages inside the new content's wrapper element, so that // on subsequent Ajax requests, it is treated as old content. - $commands[] = ajax_command_prepend(NULL, theme('status_messages')); + $status_messages = array('#theme' => 'status_messages'); + $commands[] = ajax_command_prepend(NULL, drupal_render($status_messages)); } return $commands; diff --git a/core/includes/batch.inc b/core/includes/batch.inc index 569ce58..b70d2d5 100644 --- a/core/includes/batch.inc +++ b/core/includes/batch.inc @@ -119,7 +119,12 @@ function _batch_progress_page() { // the error message. ob_start(); $fallback = $current_set['error_message'] . '
' . $batch['error_message']; - $fallback = theme('maintenance_page', array('content' => $fallback, 'show_messages' => FALSE)); + $maintenance_page = array( + '#theme' => 'maintenance_page', + '#content' => $fallback, + '#show_messages' => FALSE, + ); + $fallback = drupal_render($maintenance_page); // We strip the end of the page using a marker in the template, so any // additional HTML output by PHP shows up inside the page rather than below @@ -167,7 +172,13 @@ function _batch_progress_page() { drupal_add_js($js_setting, 'setting'); drupal_add_library('system', 'drupal.batch'); - return theme('progress_bar', array('percent' => $percentage, 'message' => $message, 'label' => $label)); + $progress_bar = array( + '#theme' => 'progress_bar', + '#percent' => $percentage, + '#message' => $message, + '#label' => $label, + ); + return drupal_render($progress_bar); } /** diff --git a/core/includes/common.inc b/core/includes/common.inc index a4805c0..6e299fb 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -390,7 +390,12 @@ function drupal_add_feed($url = NULL, $title = '') { $stored_feed_links = &drupal_static(__FUNCTION__, array()); if (isset($url)) { - $stored_feed_links[$url] = theme('feed_icon', array('url' => $url, 'title' => $title)); + $feed_icon = array( + '#theme' => 'feed_icon', + '#url' => $url, + '#title' => $title, + ); + $stored_feed_links[$url] = drupal_render($feed_icon); drupal_add_html_head_link(array( 'rel' => 'alternate', diff --git a/core/includes/errors.inc b/core/includes/errors.inc index 3fe23b7..a8257f2 100644 --- a/core/includes/errors.inc +++ b/core/includes/errors.inc @@ -276,7 +276,11 @@ function _drupal_log_error($error, $fatal = FALSE) { // We fallback to a maintenance page at this point, because the page generation // itself can generate errors. // Should not translate the string to avoid errors producing more errors. - $output = theme('maintenance_page', array('content' => 'The website has encountered an error. Please try again later.')); + $maintenance_page = array( + '#theme' => 'maintenance_page', + '#content' => 'The website has encountered an error. Please try again later.', + ); + $output = drupal_render($maintenance_page); $response = new Response($output, 500); if ($fatal) { diff --git a/core/includes/file.inc b/core/includes/file.inc index e70fa98..d2ee9e1 100644 --- a/core/includes/file.inc +++ b/core/includes/file.inc @@ -1209,7 +1209,11 @@ function file_save_upload($form_field_name, $validators = array(), $destination if (!empty($errors)) { $message = t('The specified file %name could not be uploaded.', array('%name' => $file->getFilename())); if (count($errors) > 1) { - $message .= theme('item_list', array('items' => $errors)); + $item_list = array( + '#theme' => 'item_list', + '#items' => $errors, + ); + $message .= drupal_render($item_list); } else { $message .= ' ' . array_pop($errors); diff --git a/core/includes/form.inc b/core/includes/form.inc index 5abf669..fb5f897 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -3521,7 +3521,14 @@ function theme_tableselect($variables) { array_unshift($header, ''); } } - return theme('table', array('header' => $header, 'rows' => $rows, 'empty' => $element['#empty'], 'attributes' => $element['#attributes'])); + $table = array( + '#theme' => 'table', + '#header' => $header, + '#rows' => $rows, + '#empty' => $element['#empty'], + '#attributes' => $element['#attributes'], + ); + return drupal_render($table); } /** @@ -4714,13 +4721,13 @@ function theme_form_element($variables) { switch ($element['#title_display']) { case 'before': case 'invisible': - $output .= ' ' . theme('form_element_label', $variables); + $output .= ' ' . theme('form_element_label', array('element' => $variables['element'])); $output .= ' ' . $prefix . $element['#children'] . $suffix . "\n"; break; case 'after': $output .= ' ' . $prefix . $element['#children'] . $suffix; - $output .= ' ' . theme('form_element_label', $variables) . "\n"; + $output .= ' ' . theme('form_element_label', array('element' => $variables['element'])) . "\n"; break; case 'none': @@ -4792,7 +4799,11 @@ function theme_form_element_label($variables) { } // If the element is required, a required marker is appended to the label. - $required = !empty($element['#required']) ? theme('form_required_marker', array('element' => $element)) : ''; + $form_required_marker = array( + '#theme' => 'form_required_marker', + '#element' => $element, + ); + $required = !empty($element['#required']) ? drupal_render($form_required_marker) : ''; $title = filter_xss_admin($element['#title']); diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 5217e37..2bac73c 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -949,9 +949,19 @@ function install_display_output($output, $install_state) { // Let the theming function know when every step of the installation has // been completed. $active_task = $install_state['installation_finished'] ? NULL : $install_state['active_task']; - drupal_add_region_content('sidebar_first', theme('task_list', array('items' => install_tasks_to_display($install_state), 'active' => $active_task, 'variant' => 'install'))); + $task_list = array( + '#theme' => 'task_list', + '#items' => install_tasks_to_display($install_state), + '#active' => $active_task, + '#variant' => 'install', + ); + drupal_add_region_content('sidebar_first', drupal_render($task_list)); } - print theme('install_page', array('content' => $output)); + $install_page = array( + '#theme' => 'install_page', + '#content' => $output, + ); + print drupal_render($install_page); exit; } @@ -2352,9 +2362,13 @@ function install_display_requirements($install_state, $requirements) { if ($severity == REQUIREMENT_ERROR || ($severity == REQUIREMENT_WARNING && empty($install_state['parameters']['continue']))) { if ($install_state['interactive']) { drupal_set_title(t('Requirements problem')); - $status_report = theme('status_report', array('requirements' => $requirements)); - $status_report .= t('Check the messages and try again.', array('!url' => check_url(drupal_requirements_url($severity)))); - return $status_report; + $status_report = array( + '#theme' => 'status_report', + '#requirements' => $requirements, + ); + $output = drupal_render($status_report); + $output .= t('Check the messages and try again.', array('!url' => check_url(drupal_requirements_url($severity)))); + return $output; } else { // Throw an exception showing any unmet requirements. diff --git a/core/includes/tablesort.inc b/core/includes/tablesort.inc index c42b1f4..a9bbc56 100644 --- a/core/includes/tablesort.inc +++ b/core/includes/tablesort.inc @@ -49,7 +49,11 @@ function tablesort_header($cell, $header, $ts) { $cell['aria-sort'] = ($ts['sort'] == 'asc') ? 'ascending' : 'descending'; $ts['sort'] = (($ts['sort'] == 'asc') ? 'desc' : 'asc'); $cell['class'][] = 'active'; - $image = theme('tablesort_indicator', array('style' => $ts['sort'])); + $tablesort_indicator = array( + '#theme' => 'tablesort_indicator', + '#style' => $ts['sort'], + ); + $image = drupal_render($tablesort_indicator); } else { // If the user clicks a different header, we want to sort ascending initially. diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 7bff76e..af38465 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2356,7 +2356,14 @@ function theme_item_list($variables) { */ function theme_feed_icon($variables) { $text = t('Subscribe to !feed-title', array('!feed-title' => $variables['title'])); - if ($image = theme('image', array('uri' => 'core/misc/feed.png', 'width' => 16, 'height' => 16, 'alt' => $text))) { + $build = array( + '#theme' => 'image', + '#uri' => 'core/misc/feed.png', + '#width' => 16, + '#height' => 16, + '#alt' => $text, + ); + if ($image = drupal_render($build)) { return l($image, $variables['url'], array('html' => TRUE, 'attributes' => array('class' => array('feed-icon'), 'title' => $text))); } } @@ -2962,6 +2969,7 @@ function template_preprocess_maintenance_page(&$variables) { ); drupal_render($default_css); + $status_messages = array('#theme' => 'status_messages'); $variables['head_title_array'] = $head_title; $variables['head_title'] = implode(' | ', $head_title); $variables['base_path'] = base_path(); @@ -2972,7 +2980,7 @@ function template_preprocess_maintenance_page(&$variables) { $variables['language'] = $language_interface; $variables['language']->dir = $language_interface->direction ? 'rtl' : 'ltr'; $variables['logo'] = theme_get_setting('logo.url'); - $variables['messages'] = $variables['show_messages'] ? theme('status_messages') : ''; + $variables['messages'] = $variables['show_messages'] ? drupal_render($status_messages) : ''; $variables['main_menu'] = array(); $variables['secondary_menu'] = array(); $variables['site_name'] = (theme_get_setting('features.name') ? check_plain($site_name) : ''); diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc index 5c35ac3..61e5ee5 100644 --- a/core/includes/theme.maintenance.inc +++ b/core/includes/theme.maintenance.inc @@ -170,9 +170,19 @@ function theme_authorize_report($variables) { if ($number === '#abort') { continue; } - $items[] = theme('authorize_message', array('message' => $log_message['message'], 'success' => $log_message['success'])); + $authorize_message = array( + '#theme' => 'authorize_message', + '#message' => $log_message['message'], + '#success' => $log_message['success'], + ); + $items[] = drupal_render($authorize_message); } - $output .= theme('item_list', array('items' => $items, 'title' => $heading)); + $item_list = array( + '#theme' => 'item_list', + '#items' => $items, + '#title' => $heading, + ); + $output .= drupal_render($item_list); } $output .= ''; } diff --git a/core/update.php b/core/update.php index 8608f97..f2bb57b 100644 --- a/core/update.php +++ b/core/update.php @@ -414,6 +414,7 @@ function update_check_requirements($skip_warnings = FALSE) { if ($severity == REQUIREMENT_ERROR || ($severity == REQUIREMENT_WARNING && !$skip_warnings)) { update_task_list('requirements'); drupal_set_title('Requirements problem'); +<<<<<<< HEAD $status = array( '#theme' => 'status_report', '#requirements' => $requirements, @@ -424,6 +425,18 @@ function update_check_requirements($skip_warnings = FALSE) { $maintenance_page = array( '#theme' => 'maintenance_page', '#content' => $status_report, +======= + $status_report = array( + '#theme' => 'status_report', + '#requirements' => $requirements, + ); + $content = drupal_render($status_report); + $content .= 'Check the messages and try again.'; + drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); + $maintenance_page = array( + '#theme' => 'maintenance_page', + '#content' => $content, +>>>>>>> changes ); print drupal_render($maintenance_page); exit();