summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2013-06-17 00:04:58 (GMT)
committerAlex Pott2013-06-17 00:04:58 (GMT)
commit5d83ca57c1812f6e417cef676618bd5981fc46ca (patch)
treeef3f43cd69514406339e41c1633c52717ab71658
parentb61918f0ff581a7b7adf51d26dc2e4e17ab3ba32 (diff)
Issue #2008954 by markie: Replace theme() with drupal_render() in /core/lib.
-rw-r--r--core/lib/Drupal/Component/Diff/DiffEngine.php14
-rw-r--r--core/lib/Drupal/Core/Controller/AjaxController.php7
-rw-r--r--core/lib/Drupal/Core/Controller/ExceptionController.php6
-rw-r--r--core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php8
4 files changed, 28 insertions, 7 deletions
diff --git a/core/lib/Drupal/Component/Diff/DiffEngine.php b/core/lib/Drupal/Component/Diff/DiffEngine.php
index f426b96..0d1ec5c 100644
--- a/core/lib/Drupal/Component/Diff/DiffEngine.php
+++ b/core/lib/Drupal/Component/Diff/DiffEngine.php
@@ -1260,7 +1260,12 @@ class DrupalDiffInline {
$output .= $piece;
}
else {
- $output .= theme('diff_inline_chunk', array('text' => $piece, 'type' => $chunk->type));
+ $diff_inline_chunk = array(
+ '#theme' => 'diff_inline_chunk',
+ '#text' => $piece,
+ '#type' => $chunk->type,
+ );
+ $output .= drupal_render($diff_inline_chunk);
}
}
break;
@@ -1271,7 +1276,12 @@ class DrupalDiffInline {
$output .= $piece;
}
else {
- $output .= theme('diff_inline_chunk', array('text' => $piece, 'type' => $chunk->type));
+ $diff_inline_chunk = array(
+ '#theme' => 'diff_inline_chunk',
+ '#text' => $piece,
+ '#type' => $chunk->type,
+ );
+ $output .= drupal_render($diff_inline_chunk);
}
}
break;
diff --git a/core/lib/Drupal/Core/Controller/AjaxController.php b/core/lib/Drupal/Core/Controller/AjaxController.php
index 7fb31f9..411311e 100644
--- a/core/lib/Drupal/Core/Controller/AjaxController.php
+++ b/core/lib/Drupal/Core/Controller/AjaxController.php
@@ -67,9 +67,10 @@ class AjaxController extends ContainerAware {
// replace the element making the ajax call. The default 'replaceWith'
// behavior can be changed with #ajax['method'].
$response->addCommand(new InsertCommand(NULL, $html));
- $status_messages = theme('status_messages');
- if (!empty($status_messages)) {
- $response->addCommand(new PrependCommand(NULL, $status_messages));
+ $status_messages = array('#theme' => 'status_messages');
+ $output = drupal_render($status_messages);
+ if (!empty($output)) {
+ $response->addCommand(new PrependCommand(NULL, $output));
}
}
}
diff --git a/core/lib/Drupal/Core/Controller/ExceptionController.php b/core/lib/Drupal/Core/Controller/ExceptionController.php
index c2003eb..c9a661b 100644
--- a/core/lib/Drupal/Core/Controller/ExceptionController.php
+++ b/core/lib/Drupal/Core/Controller/ExceptionController.php
@@ -255,7 +255,11 @@ class ExceptionController extends ContainerAware {
drupal_set_title(t('Error'));
// We fallback to a maintenance page at this point, because the page
// generation itself can generate errors.
- $output = theme('maintenance_page', array('content' => t('The website has encountered an error. Please try again later.')));
+ $maintenance_page = array(
+ '#theme' => 'maintenance_page',
+ '#content' => t('The website has encountered an error. Please try again later.'),
+ );
+ $output = drupal_render($maintenance_page);
$response = new Response($output, 500);
$response->setStatusCode(500, '500 Service unavailable (with message)');
diff --git a/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php
index 3559998..c4d2f74 100644
--- a/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php
@@ -45,7 +45,13 @@ class MaintenanceModeSubscriber implements EventSubscriberInterface {
// Deliver the 503 page.
drupal_maintenance_theme();
drupal_set_title(t('Site under maintenance'));
- $content = theme('maintenance_page', array('content' => filter_xss_admin(t(config('system.maintenance')->get('message'), array('@site' => config('system.site')->get('name'))))));
+ $maintenance_page = array(
+ '#theme' => 'maintenance_page',
+ '#content' => filter_xss_admin(
+ t(config('system.maintenance')->get('message'), array('@site' => config('system.site')->get('name')))
+ ),
+ );
+ $content = drupal_render($maintenance_page);
$response = new Response('Service unavailable', 503);
$response->setContent($content);
$event->setResponse($response);