diff --git a/drd_server.module b/drd_server.module index 0fa6e2a..3a37415 100644 --- a/drd_server.module +++ b/drd_server.module @@ -503,9 +503,24 @@ function drd_server_status() { return $valid; } + $projects = array(); + module_load_include('inc', 'update', 'update.compare'); + if (function_exists('update_get_projects')) { + $all_projects = update_get_projects(); + foreach ($all_projects as $project_name => $full_info) { + $projects[$project_name] = $full_info['info']['version']; + } + } + else { + // If for some reason we don't have update module available to check, + // fall back to the old way of trying to use module names, which still + // works far more often than not. + $projects = db_select('system', 's')->fields('s', array('name', 'schema_version'))->condition('s.status', 1)->execute()->fetchAllKeyed(0, 1); + } + $status = array( 'maintenance_mode' => variable_get('maintenance_mode', FALSE), - 'projects_enabled' => db_select('system', 's')->fields('s', array('name', 'schema_version'))->condition('s.status', 1)->execute()->fetchAllKeyed(0, 1), + 'projects_enabled' => $projects, 'drupal_root' => DRUPAL_ROOT, );