Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.102 diff -u -p -r1.102 system.admin.inc --- modules/system/system.admin.inc 16 Oct 2008 20:23:08 -0000 1.102 +++ modules/system/system.admin.inc 7 Nov 2008 20:23:51 -0000 @@ -1778,6 +1778,49 @@ function system_status($check = FALSE) { } /** + * Menu callback: exports the site status report. + */ +function system_status_export() { + // Load .install files + include_once DRUPAL_ROOT . '/includes/install.inc'; + drupal_load_updates(); + + // Check run-time requirements and status information. + $requirements = module_invoke_all('requirements', 'runtime'); + usort($requirements, '_system_sort_requirements'); + + // Fetch list of enabled modules and their versions. + $modules = module_rebuild_cache(); + $enabled = array(); + foreach ($modules as $module) { + if ($module->status && !isset($module->info['required'])) { + $enabled[] = $module->name . (isset($module->info['version']) ? ' ' . $module->info['version'] : ''); + } + } + sort($enabled); + $requirements[] = array( + 'title' => t('Enabled modules'), + 'value' => theme('item_list', $enabled), + ); + + // Generate output using a simple HTML markup structure. + $output = '

Status Report

'; + foreach ($requirements as $requirement) { + if (empty($requirement['#type'])) { + // Contrary to the on-site page, the export should not contain descriptions. + $output .= '

' . $requirement['title'] . '

' . $requirement['value'] . '

'; + } + } + + // Force the browser to display the file save dialog. + drupal_set_header('Content-Type: text/plain; charset=utf-8'); + drupal_set_header('Content-Disposition: attachment; filename="system-status-report.txt"'); + // Strip links and any other HTML tags from the output. + echo drupal_html_to_text($output, array('p', 'ul', 'li', 'h1', 'h2')); + exit; +} + +/** * Menu callback: run cron manually. */ function system_run_cron() { @@ -2036,7 +2079,8 @@ function theme_system_admin_by_module($m */ function theme_status_report(&$requirements) { $i = 0; - $output = ''; + $output = '

' . t("It may be useful to attach this information to support requests and bug reports filed on drupal.org's support forums and project issue queues.", array('@status-report-export' => url('admin/reports/status/export'))) . '

'; + $output .= '
'; foreach ($requirements as $requirement) { if (empty($requirement['#type'])) { $class = ++$i % 2 == 0 ? 'even' : 'odd'; Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.635 diff -u -p -r1.635 system.module --- modules/system/system.module 31 Oct 2008 02:18:22 -0000 1.635 +++ modules/system/system.module 7 Nov 2008 20:16:43 -0000 @@ -98,7 +98,7 @@ function system_help($path, $arg) { case 'admin/settings/ip-blocking': return '

' . t('IP addresses listed here are blocked from your site before any modules are loaded. You may add IP addresses to the list, or delete existing entries.') . '

'; case 'admin/reports/status': - return '

' . t("Here you can find a short overview of your site's parameters as well as any problems detected with your installation. It may be useful to copy and paste this information into support requests filed on drupal.org's support forums and project issue queues.") . '

'; + return '

' . t("Here you can find a short overview of your site's parameters as well as any problems detected with your installation.") . '

'; } } @@ -668,6 +668,12 @@ function system_menu() { 'access arguments' => array('administer site configuration'), 'type' => MENU_CALLBACK, ); + $items['admin/reports/status/export'] = array( + 'title' => 'Export status report', + 'page callback' => 'system_status_export', + 'access arguments' => array('administer site configuration'), + 'type' => MENU_CALLBACK, + ); // Default page for batch operations $items['batch'] = array( 'page callback' => 'system_batch_page',