You are here

function configuration_ui_config_info in Configuration Management 7.2

Menu Callback Form.

1 string reference to 'configuration_ui_config_info'
configuration_ui_menu in ui/configuration_ui.module
Implements hook_menu().

File

ui/configuration_ui.admin.inc, line 230
User interface functions for Configuration Management.

Code

function configuration_ui_config_info($config_id) {
  static $diff_exists;
  if (!isset($diff_exists)) {
    $diff_exists = module_exists('diff');
  }
  $config = ConfigurationManagement::createConfigurationInstance($config_id);
  $config
    ->loadFromActiveStore();
  $identifiers = $config
    ->getAllIdentifiers($config
    ->getComponent());
  $status = check_plain($config
    ->getStatus());
  if ($diff_exists && $status != t('In Sync')) {
    $status = l(check_plain($status), 'admin/config/system/configuration/diff/' . arg(5), array(
      'attributes' => array(
        'title' => t('View differences'),
      ),
    ));
  }
  if (arg(6) == 'status') {
    print $status;
    exit;
  }
  if (arg(6) == 'dependencies') {
    ConfigurationManagement::rawDepdendencyInfo(array(
      $config_id,
    ), TRUE, FALSE);
    exit;
  }
  if (arg(6) == 'optionals') {
    ConfigurationManagement::rawDepdendencyInfo(array(
      $config_id,
    ), FALSE, TRUE);
    exit;
  }
  if (arg(6) == 'dependencies_optionals') {
    ConfigurationManagement::rawDepdendencyInfo(array(
      $config_id,
    ), TRUE, TRUE);
    exit;
  }
  $page = '';
  $page .= '<h2>' . t('Configuration for: @config', array(
    '@config' => $identifiers[$config
      ->getIdentifier()],
  )) . '</h2>';
  $page .= '<p>' . t('Identifier: @hash', array(
    '@hash' => $config
      ->getIdentifier(),
  )) . '</p>';
  $page .= '<p>' . t('Hash: @hash', array(
    '@hash' => $config
      ->getHash(),
  )) . '</p>';
  $page .= '<p>' . t('Status: <strong>!status</strong>', array(
    '!status' => $status,
  )) . '</p>';
  $dependencies = array(
    'items' => array_keys($config
      ->getDependencies()),
  );
  if (!empty($dependencies['items'])) {
    $page .= '<p>' . t('Dependencies:') . '</p>';
    $page .= theme('item_list', $dependencies);
  }
  else {
    $page .= '<p>' . t('No Dependencies') . '</p>';
  }
  $optionals = array(
    'items' => array_keys($config
      ->getOptionalConfigurations()),
  );
  if (!empty($optionals['items'])) {
    $page .= '<p>' . t('Optional Configurations:') . '</p>';
    $page .= theme('item_list', $optionals);
  }
  else {
    $page .= '<p>' . t('No Optional Configurations') . '</p>';
  }
  return $page;
}