1 config.admin.inc config_diff_page($config_file)

Shows diff of specified configuration file.

Parameters

string $config_file: The name of the configuration file.

Return value

string: Table showing a two-way diff between the active and staged configuration.

File

core/modules/config/config.admin.inc, line 136
Admin page callbacks for the Configuration Management module.

Code

function config_diff_page($config_file) {
  $diff = config_diff($config_file);

  $build = array();

  $build['#title'] = t('View changes of @config_file', array('@config_file' => $config_file));
  // Add the CSS for the inline diff.
  $build['#attached']['css'][] = backdrop_get_path('module', 'system') . '/css/system.diff.css';

  $build['diff'] = array(
    '#theme' => 'table',
    '#header' => array(
      array('data' => t('Old'), 'colspan' => '2', 'class' => array('config-old')),
      array('data' => t('New'), 'colspan' => '2', 'class' => array('config-new')),
    ),
    '#attributes' => array('class' => array('diff-table')),
    '#rows' => $diff,
    '#sticky' => FALSE,
  );

  $build['actions'] = array(
    '#type' => 'actions',
    '#attributes' => array('class' => array('form-actions')),
  );
  $build['actions']['back'] = array(
    '#type' => 'link',
    '#title' => t('Back to "Synchronize configuration" page.'),
    '#href' => 'admin/config/development/configuration',
    '#attributes' => array('class' => array('button', 'button-secondary', 'form-submit')),
  );

  if (backdrop_is_dialog()) {
    $build['actions']['back']['#attributes']['class'][] = 'dialog-cancel';
    $build['actions']['back']['#title'] = t('Close');
  }

  return $build;
}