' . t('List of configuration files found:') . ''; try { // Retrieve the list of available files. $files_list = search_api_solr_server_get_files($server); if (empty($files_list)) { $form['info']['#markup'] = t('No files found.'); return $form; } $form['files'] = array( '#type' => 'vertical_tabs', ); // Generate a fieldset for each file. foreach ($files_list as $file_name => $file_info) { $file_date = format_date(strtotime($file_info['modified'])); $escaped_file_name = check_plain($file_name); $form['files'][$file_name] = array( '#title' => $escaped_file_name, '#type' => 'fieldset', ); $data = '

' . $escaped_file_name . '

'; $data .= '

' . t('Last modified: @time.', array('@time' => $file_date)) . '

'; if ($file_info['size'] > 0) { $file_data = $server->getFile($file_name); $data .= '
' . check_plain($file_data->data) . '
'; } else { $data .= '

' . t('The file is empty.') . '

'; } $form['files'][$file_name]['data']['#markup'] = $data; } } catch (SearchApiException $e) { watchdog_exception('search_api_solr', $e, '%type while retrieving config files of Solr server @server: !message in %function (line %line of %file).', array('@server' => $server->name)); $form['info']['#markup'] = t('An error occured while trying to load the list of files.'); } return $form; }