From 03d3cb0a36981fc156eabb157d19d051185830e8 Mon Sep 17 00:00:00 2001 From: catch Date: Sun, 30 Jun 2013 11:48:42 +0100 Subject: [PATCH] Issue #2008982 by xxAlHixx, adamcowboy, hussainweb, c4rl: Replace theme() with drupal_render() in config module. --- .../config/Controller/ConfigController.php | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/core/modules/config/lib/Drupal/config/Controller/ConfigController.php b/core/modules/config/lib/Drupal/config/Controller/ConfigController.php index 5709febe73..34366fc421 100644 --- a/core/modules/config/lib/Drupal/config/Controller/ConfigController.php +++ b/core/modules/config/lib/Drupal/config/Controller/ConfigController.php @@ -77,26 +77,29 @@ public function downloadExport() { * Table showing a two-way diff between the active and staged configuration. */ public function diff($config_file) { - // Add the CSS for the inline diff. - $output['#attached']['css'][] = drupal_get_path('module', 'system') . '/css/system.diff.css'; + // @todo Remove use of drupal_set_title() when + // http://drupal.org/node/1871596 is in. + drupal_set_title(t('View changes of @config_file', array('@config_file' => $config_file)), PASS_THROUGH); $diff = config_diff($this->targetStorage, $this->sourceStorage, $config_file); $formatter = new \DrupalDiffFormatter(); $formatter->show_header = FALSE; - $variables = array( - 'header' => array( + $build = array(); + + // Add the CSS for the inline diff. + $build['#attached']['css'][] = drupal_get_path('module', 'system') . '/css/system.diff.css'; + + $build['diff'] = array( + '#theme' => 'table', + '#header' => array( array('data' => t('Old'), 'colspan' => '2'), array('data' => t('New'), 'colspan' => '2'), ), - 'rows' => $formatter->format($diff), + '#rows' => $formatter->format($diff), ); - $output['diff'] = array( - '#markup' => theme('table', $variables), - ); - - $output['back'] = array( + $build['back'] = array( '#type' => 'link', '#attributes' => array( 'class' => array( @@ -107,10 +110,6 @@ public function diff($config_file) { '#href' => 'admin/config/development/sync', ); - // @todo Remove use of drupal_set_title() when - // http://drupal.org/node/1871596 is in. - drupal_set_title(t('View changes of @config_file', array('@config_file' => $config_file)), PASS_THROUGH); - - return $output; + return $build; } } -- GitLab