You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
2.4 KiB

  1. <?php
  2. // Project: Web Reference Database (refbase) <http://www.refbase.net>
  3. // Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
  4. // original author(s).
  5. //
  6. // This code is distributed in the hope that it will be useful,
  7. // but WITHOUT ANY WARRANTY. Please see the GNU General Public
  8. // License for more details.
  9. //
  10. // File: ./export/bibutils/export_xml2ris.php
  11. // Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/export/bibutils/export_xml2ris.php $
  12. // Author(s): Matthias Steffens <mailto:refbase@extracts.de>
  13. //
  14. // Created: 28-Sep-04, 22:14
  15. // Modified: $Date: 2008-08-19 17:13:01 +0000 (Tue, 19 Aug 2008) $
  16. // $Author: msteffens $
  17. // $Revision: 1198 $
  18. // This is an export format file (which must reside within the 'export/' sub-directory of your refbase root directory). It contains a version of the
  19. // 'exportRecords()' function that outputs records according to the standard export format used e.g. by commercial bibliographic packages like 'Reference Manager' (http://www.refman.com).
  20. // This function is basically a wrapper for the bibutils 'xml2ris' command line tool (http://www.scripps.edu/~cdputnam/software/bibutils/bibutils.html).
  21. // --------------------------------------------------------------------
  22. // --- BEGIN EXPORT FORMAT ---
  23. // Export found records in 'RIS' format:
  24. // Requires the following packages (available under the GPL):
  25. // - bibutils <http://www.scripps.edu/~cdputnam/software/bibutils/bibutils.html>
  26. // - ActiveLink PHP XML Package <http://www.active-link.com/software/>
  27. function exportRecords($result, $rowOffset, $showRows, $exportStylesheet, $displayType)
  28. {
  29. // function 'exportBibutils()' is defined in 'execute.inc.php'
  30. $risSourceText = exportBibutils($result,"xml2ris");
  31. // NOTE: the 'exec()' command that is used in function 'execute()' in file 'execute.inc.php'
  32. // does not include trailing whitespace in its '$output' array [*]; since this would
  33. // chop off trailing whitespace from closing RIS 'ER - ' tags, we add it back here
  34. // [*] see <http://www.php.net/manual/en/function.exec.php>
  35. return preg_replace("/^ER -$/m", "ER - ", $risSourceText);
  36. }
  37. // --- END EXPORT FORMAT ---
  38. // --------------------------------------------------------------------
  39. ?>