';
@@ -509,13 +528,21 @@ function theme_system_admin_index($variables) {
// Output links.
if (count($items)) {
+ $admin_block_content = array(
+ '#theme' => 'admin_block_content',
+ '#content' => $items,
+ );
$block = array();
$block['title'] = $module;
- $block['content'] = theme('admin_block_content', array('content' => $items));
+ $block['content'] = drupal_render($admin_block_content);
$block['description'] = t($description);
$block['show'] = TRUE;
- if ($block_output = theme('admin_block', array('block' => $block))) {
+ $admin_block = array(
+ '#theme' => 'admin_block',
+ '#block' => $block,
+ );
+ if ($block_output = drupal_render($admin_block)) {
if (!isset($block['position'])) {
// Perform automatic striping.
$block['position'] = $position;
@@ -526,8 +553,9 @@ function theme_system_admin_index($variables) {
}
}
+ $system_compact_link = array('#theme' => 'system_compact_link');
$output = '
';
- $output .= theme('system_compact_link');
+ $output .= drupal_render($system_compact_link);
foreach ($container as $id => $data) {
$output .= '
';
$output .= $data;
@@ -675,7 +703,12 @@ function theme_system_modules_details($variables) {
$rows[] = $row;
}
- return theme('table', array('header' => $form['#header'], 'rows' => $rows));
+ $table = array(
+ '#theme' => 'table',
+ '#header' => $form['#header'],
+ '#rows' => $rows,
+ );
+ return drupal_render($table);
}
/**
@@ -734,7 +767,13 @@ function theme_system_modules_uninstall($variables) {
);
}
- $output = theme('table', array('header' => $header, 'rows' => $rows, 'empty' => t('No modules are available to uninstall.')));
+ $table = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ '#empty' => t('No modules are available to uninstall.'),
+ );
+ $output = drupal_render($table);
$output .= drupal_render_children($form);
return $output;
@@ -746,6 +785,7 @@ function theme_system_modules_uninstall($variables) {
* @param $variables
* An associative array containing:
* - theme_groups: An associative array containing groups of themes.
+ * - theme_group_titles: An associative array containing titles of themes.
*
* @ingroup themeable
*/
@@ -853,7 +893,12 @@ function system_date_format_language_overview_page() {
$rows[] = $row;
}
- return theme('table', array('header' => $header, 'rows' => $rows));
+ $table = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ );
+ return drupal_render($table);
}
/**
@@ -961,8 +1006,13 @@ function theme_system_date_format_localize_form($variables) {
$rows[] = $row;
}
+ $table = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ );
$output = drupal_render($form['language']);
- $output .= theme('table', array('header' => $header, 'rows' => $rows));
+ $output .= drupal_render($table);
$output .= drupal_render_children($form);
return $output;
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index 8ef7556..94e595e 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -410,7 +410,8 @@ function hook_css_alter(&$css) {
*/
function hook_ajax_render_alter($commands) {
// Inject any new status messages into the content area.
- $commands[] = ajax_command_prepend('#block-system-main .content', theme('status_messages'));
+ $status_messages = array('#theme' => 'status_messages');
+ $commands[] = ajax_command_prepend('#block-system-main .content', drupal_render($status_messages));
}
/**
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 4d882dd..a07c976 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -131,7 +131,11 @@ function system_requirements($phase) {
'@system_requirements' => 'http://drupal.org/requirements',
));
- $description .= theme('item_list', array('items' => $missing_extensions));
+ $item_list = array(
+ '#theme' => 'item_list',
+ '#items' => $missing_extensions,
+ );
+ $description .= drupal_render($item_list);
$requirements['php_extensions']['value'] = t('Disabled');
$requirements['php_extensions']['severity'] = REQUIREMENT_ERROR;
@@ -246,7 +250,11 @@ function system_requirements($phase) {
$description = $conf_errors[0];
}
else {
- $description = theme('item_list', array('items' => $conf_errors));
+ $item_list = array(
+ '#theme' => 'item_list',
+ '#items' => $conf_errors,
+ );
+ $description = drupal_render($item_list);
}
$requirements['settings.php'] = array(
'value' => t('Not protected'),
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 1935f5c..12e6cbe 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -140,7 +140,10 @@ function system_help($path, $arg) {
function system_theme() {
return array_merge(drupal_common_theme(), array(
'system_themes_page' => array(
- 'variables' => array('theme_groups' => NULL),
+ 'variables' => array(
+ 'theme_groups' => NULL,
+ 'theme_group_titles' => NULL,
+ ),
'file' => 'system.admin.inc',
),
'system_config_form' => array(
@@ -3342,7 +3345,12 @@ function theme_exposed_filters($variables) {
foreach (element_children($form['current']) as $key) {
$items[] = $form['current'][$key];
}
- $output .= theme('item_list', array('items' => $items, 'attributes' => array('class' => array('clearfix', 'current-filters'))));
+ $item_list = array(
+ '#theme' => 'item_list',
+ '#items' => $items,
+ '#attributes' => array('class' => array('clearfix', 'current-filters')),
+ );
+ $output .= drupal_render($item_list);
}
$output .= drupal_render_children($form);
diff --git a/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/EventSubscriber/ThemeTestSubscriber.php b/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/EventSubscriber/ThemeTestSubscriber.php
index 56cbdaf..6e28a15 100644
--- a/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/EventSubscriber/ThemeTestSubscriber.php
+++ b/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/EventSubscriber/ThemeTestSubscriber.php
@@ -34,7 +34,12 @@ public function onRequest(GetResponseEvent $event) {
// theme_test_request_listener_page_callback() to test that even when the
// theme system is initialized this early, it is still capable of
// returning output and theming the page as a whole.
- $GLOBALS['theme_test_output'] = theme('more_link', array('url' => 'user', 'title' => 'Themed output generated in a KernelEvents::REQUEST listener'));
+ $more_link = array(
+ '#theme' => 'more_link',
+ '#url' => 'user',
+ '#title' => 'Themed output generated in a KernelEvents::REQUEST listener',
+ );
+ $GLOBALS['theme_test_output'] = drupal_render($more_link);
}
if (strpos($current_path, 'user/autocomplete') === 0) {
// Register a fake registry loading callback. If it gets called by
diff --git a/core/modules/system/tests/modules/theme_test/theme_test.module b/core/modules/system/tests/modules/theme_test/theme_test.module
index 51cb6d3..13a0243 100644
--- a/core/modules/system/tests/modules/theme_test/theme_test.module
+++ b/core/modules/system/tests/modules/theme_test/theme_test.module
@@ -9,9 +9,11 @@ function theme_test_theme($existing, $type, $theme, $path) {
'variables' => array('foo' => ''),
);
$items['theme_test_template_test'] = array(
+ 'variables' => array(),
'template' => 'theme_test.template_test',
);
$items['theme_test_template_test_2'] = array(
+ 'variables' => array(),
'template' => 'theme_test.template_test',
);
$items['theme_test_foo'] = array(
@@ -100,7 +102,8 @@ function theme_test_request_listener_page_callback() {
* Menu callback for testing template overridding based on filename.
*/
function theme_test_template_test_page_callback() {
- return theme('theme_test_template_test');
+ $theme_test_template_test = array('#theme' => 'theme_test_template_test');
+ return drupal_render($theme_test_template_test);
}
/**
@@ -146,7 +149,8 @@ function _theme_test_alter() {
* Page callback, calls a theme hook suggestion.
*/
function _theme_test_suggestion() {
- return theme(array('theme_test__suggestion', 'theme_test'), array());
+ $theme_test = array('#theme' => array('theme_test__suggestion', 'theme_test'));
+ return drupal_render($theme_test);
}
/**
diff --git a/core/modules/system/tests/modules/twig_theme_test/lib/Drupal/twig_theme_test/TwigThemeTestController.php b/core/modules/system/tests/modules/twig_theme_test/lib/Drupal/twig_theme_test/TwigThemeTestController.php
index 6eb318a..e4ba607 100644
--- a/core/modules/system/tests/modules/twig_theme_test/lib/Drupal/twig_theme_test/TwigThemeTestController.php
+++ b/core/modules/system/tests/modules/twig_theme_test/lib/Drupal/twig_theme_test/TwigThemeTestController.php
@@ -26,7 +26,8 @@ public static function create(ContainerInterface $container) {
* Menu callback for testing PHP variables in a Twig template.
*/
public function phpVariablesRender() {
- return theme('twig_theme_test_php_variables');
+ $twig_theme_test_php_variables = array('#theme' => 'twig_theme_test_php_variables');
+ return drupal_render($twig_theme_test_php_variables);
}
/**
diff --git a/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.module b/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.module
index 934d1b0..cc74184 100644
--- a/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.module
+++ b/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.module
@@ -5,6 +5,7 @@
*/
function twig_theme_test_theme($existing, $type, $theme, $path) {
$items['twig_theme_test_php_variables'] = array(
+ 'variables' => array(),
'template' => 'twig_theme_test.php_variables',
);
$items['twig_theme_test_trans'] = array(