Commit 56b72541 authored by catch's avatar catch

Issue #2009674 by pplantinga, Samvel, dmitrii: Replace theme() with...

Issue #2009674 by pplantinga, Samvel, dmitrii: Replace theme() with drupal_render() in system module.
parent 51bc69ca
......@@ -25,9 +25,7 @@ class SystemPoweredByBlock extends BlockBase {
* {@inheritdoc}
*/
public function build() {
return array(
'#children' => theme('system_powered_by'),
);
return array('#theme' => 'system_powered_by');
}
}
......@@ -138,8 +138,16 @@ function system_themes_page() {
uasort($theme_groups['enabled'], 'system_sort_themes');
drupal_alter('system_themes_page', $theme_groups);
$admin_form = drupal_get_form('system_themes_admin_form', $admin_theme_options);
return theme('system_themes_page', array('theme_groups' => $theme_groups, 'theme_group_titles' => $theme_group_titles)) . drupal_render($admin_form);
$build = array(
'#sorted' => TRUE,
);
$build['system_themes_page'] = array(
'#theme' => 'system_themes_page',
'#theme_groups' => $theme_groups,
'#theme_group_titles' => $theme_group_titles,
);
$build['admin_form'] = drupal_get_form('system_themes_admin_form', $admin_theme_options);
return $build;
}
/**
......@@ -365,7 +373,11 @@ function theme_admin_page($variables) {
$container = array();
foreach ($blocks as $block) {
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 (empty($block['position'])) {
// perform automatic striping.
$block['position'] = ++$stripe % 2 ? 'left' : 'right';
......@@ -377,8 +389,9 @@ function theme_admin_page($variables) {
}
}
$system_compact_link = array('#theme' => 'system_compact_link');
$output = '<div class="admin clearfix">';
$output .= theme('system_compact_link');
$output .= drupal_render($system_compact_link);
foreach ($container as $id => $data) {
$output .= '<div class="' . $id . ' clearfix">';
......@@ -411,13 +424,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;
......@@ -428,8 +449,9 @@ function theme_system_admin_index($variables) {
}
}
$system_compact_link = array('#theme' => 'system_compact_link');
$output = '<div class="admin clearfix">';
$output .= theme('system_compact_link');
$output .= drupal_render($system_compact_link);
foreach ($container as $id => $data) {
$output .= '<div class="' . $id . ' clearfix">';
$output .= $data;
......@@ -577,7 +599,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);
}
/**
......@@ -636,7 +663,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;
......@@ -648,6 +681,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
*/
......@@ -832,8 +866,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;
......
......@@ -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));
}
/**
......
......@@ -126,7 +126,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;
......@@ -241,7 +245,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'),
......
......@@ -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(
......@@ -3183,7 +3186,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);
......
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