Commit 03d3cb0a authored by catch's avatar catch

Issue #2008982 by xxAlHixx, adamcowboy, hussainweb, c4rl: Replace theme() with...

Issue #2008982 by xxAlHixx, adamcowboy, hussainweb, c4rl: Replace theme() with drupal_render() in config module.
parent 2e9c7fef
...@@ -77,26 +77,29 @@ public function downloadExport() { ...@@ -77,26 +77,29 @@ public function downloadExport() {
* Table showing a two-way diff between the active and staged configuration. * Table showing a two-way diff between the active and staged configuration.
*/ */
public function diff($config_file) { public function diff($config_file) {
// Add the CSS for the inline diff. // @todo Remove use of drupal_set_title() when
$output['#attached']['css'][] = drupal_get_path('module', 'system') . '/css/system.diff.css'; // 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); $diff = config_diff($this->targetStorage, $this->sourceStorage, $config_file);
$formatter = new \DrupalDiffFormatter(); $formatter = new \DrupalDiffFormatter();
$formatter->show_header = FALSE; $formatter->show_header = FALSE;
$variables = array( $build = array();
'header' => 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('Old'), 'colspan' => '2'),
array('data' => t('New'), 'colspan' => '2'), array('data' => t('New'), 'colspan' => '2'),
), ),
'rows' => $formatter->format($diff), '#rows' => $formatter->format($diff),
); );
$output['diff'] = array( $build['back'] = array(
'#markup' => theme('table', $variables),
);
$output['back'] = array(
'#type' => 'link', '#type' => 'link',
'#attributes' => array( '#attributes' => array(
'class' => array( 'class' => array(
...@@ -107,10 +110,6 @@ public function diff($config_file) { ...@@ -107,10 +110,6 @@ public function diff($config_file) {
'#href' => 'admin/config/development/sync', '#href' => 'admin/config/development/sync',
); );
// @todo Remove use of drupal_set_title() when return $build;
// 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;
} }
} }
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