';
- $output .= theme('system_compact_link');
+ $output .= drupal_render($system_compact_link);
foreach ($container as $id => $data) {
$output .= '
';
@@ -1027,16 +1052,24 @@ function theme_system_admin_index($variables) {
// Iterate over all modules.
foreach ($menu_items as $module => $block) {
list($description, $items) = $block;
+ $admin_block_content = array(
+ '#theme' => 'admin_block_content',
+ '#content' => $items,
+ );
+ $admin_block = array(
+ '#theme' => 'admin_block',
+ '#block' => $block,
+ );
// Output links.
if (count($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))) {
+ if ($block_output = drupal_render($admin_block)) {
if (!isset($block['position'])) {
// Perform automatic striping.
$block['position'] = $position;
@@ -1047,8 +1080,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;
@@ -1191,7 +1225,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);
}
/**
@@ -1250,10 +1289,14 @@ function theme_system_modules_uninstall($variables) {
);
}
- $output = theme('table', array('header' => $header, 'rows' => $rows, 'empty' => t('No modules are available to uninstall.')));
- $output .= drupal_render_children($form);
+ $table = array(
+ '#theme' => 'table',
+ '#header' => $header,
+ '#rows' => $rows,
+ '#empty' => t('No modules are available to uninstall.'),
+ );
- return $output;
+ return drupal_render($table) . drupal_render_children($form);
}
/**
@@ -1262,6 +1305,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
*/
@@ -1281,7 +1325,19 @@ function theme_system_themes_page($variables) {
foreach ($theme_groups[$state] as $theme) {
// Theme the screenshot.
- $screenshot = $theme->screenshot ? theme('image', $theme->screenshot) : '
' . t('no screenshot') . '
';
+ if ($theme->screenshot) {
+ $image = array(
+ '#theme' => 'image',
+ '#uri' => $theme->screenshot['uri'],
+ '#alt' => $theme->screenshot['alt'],
+ '#title' => $theme->screenshot['title'],
+ '#attributes' => $theme->screenshot['attributes'],
+ );
+ $screenshot = drupal_render($image);
+ }
+ else {
+ $screenshot = '
' . t('no screenshot') . '
';
+ }
// Localize the theme description.
$description = t($theme->info['description']);
@@ -1309,7 +1365,14 @@ function theme_system_themes_page($variables) {
$output .= '
' . t('This theme requires the theme engine @theme_engine to operate correctly.', array('@theme_engine' => $theme->info['engine'])) . '
';
}
else {
- $output .= theme('links', array('links' => $theme->operations, 'attributes' => array('class' => array('operations', 'clearfix'))));
+ $links = array(
+ '#theme' => 'links',
+ '#links' => $theme->operations,
+ '#attributes' => array(
+ 'class' => array('operations', 'clearfix'),
+ ),
+ );
+ $output .= drupal_render($links);
}
$output .= '
';
}
@@ -1413,7 +1476,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);
}
/**
@@ -1539,8 +1607,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 1e1bae3..d4388b2 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 89f9ddc..e5c0e1a 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -130,7 +130,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;
@@ -245,7 +249,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 a6a7786..fe10e19 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -139,7 +139,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(
@@ -3588,7 +3591,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 bea8b13..3bfe755 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 ca8439d..6c0e57b 100644
--- a/core/modules/system/tests/modules/theme_test/theme_test.module
+++ b/core/modules/system/tests/modules/theme_test/theme_test.module
@@ -93,7 +93,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);
}
/**
@@ -139,7 +140,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 ef5fb70..5299481 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/theme.api.php b/core/modules/system/theme.api.php
index aedc6b0..169e1aa 100644
--- a/core/modules/system/theme.api.php
+++ b/core/modules/system/theme.api.php
@@ -186,7 +186,13 @@ function hook_process(&$variables, $hook) {
'variable_name' => $variable_name,
'variables' => $variables,
);
- $variables[$variable_name] = theme('rdf_template_variable_wrapper', array('content' => $variables[$variable_name], 'attributes' => $attributes, 'context' => $context));
+ $rdf_template_variable_wrapper = array(
+ '#theme' => 'rdf_template_variable_manager',
+ '#content' => $variables[$variable_name],
+ '#attributes' => $attributes,
+ '#context' => $context,
+ );
+ $variables[$variable_name] = drupal_render($rdf_template_variable_wrapper);
}
}
}