node_export.formats.inc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. /**
  3. * @file
  4. * The Node export formats file.
  5. *
  6. * Implements the default node export format handlers.
  7. */
  8. /**
  9. * Implements hook_node_export_format_handlers().
  10. */
  11. function node_export_node_export_format_handlers() {
  12. return array(
  13. 'json' => array(
  14. '#title' => t('JSON'),
  15. '#module' => 'node_export',
  16. '#file' => drupal_get_path('module', 'node_export') . '/formats/json.inc',
  17. '#description' => t(
  18. '<a href="!json">JavaScript Object Notation</a> code.',
  19. array(
  20. '!json' => 'http://en.wikipedia.org/wiki/JSON'
  21. )
  22. ),
  23. '#mime' => 'application/json',
  24. '#export_callback' => 'node_export_json_export',
  25. '#import_callback' => 'node_export_json_import',
  26. ),
  27. 'drupal' => array(
  28. '#title' => t('Drupal var export'),
  29. '#module' => 'node_export',
  30. '#file' => drupal_get_path('module', 'node_export') . '/formats/drupal.inc',
  31. '#description' => t(
  32. '<a href="!drupal">Drupal var export</a> code.',
  33. array(
  34. '!drupal' => 'http://api.drupal.org/api/drupal/includes!utility.inc/function/drupal_var_export/7'
  35. )
  36. ),
  37. '#export_callback' => 'node_export_drupal_export',
  38. '#import_callback' => 'node_export_drupal_import',
  39. ),
  40. 'serialize' => array(
  41. '#title' => t('Serialize'),
  42. '#module' => 'node_export',
  43. '#file' => drupal_get_path('module', 'node_export') . '/formats/serialize.inc',
  44. '#description' => t(
  45. 'Very robust, though not human readable, representation through <a href="!wiki">Serialization</a> using the PHP <a href="!php">serialize</a> function.',
  46. array(
  47. '!wiki' => 'http://tools.ietf.org/html/rfc4180',
  48. '!php' => 'http://en.wikipedia.org/wiki/Comma-separated_values'
  49. )
  50. ),
  51. '#export_callback' => 'node_export_serialize_export',
  52. '#import_callback' => 'node_export_serialize_import',
  53. ),
  54. 'xml' => array(
  55. '#title' => t('XML'),
  56. '#module' => 'node_export',
  57. '#file' => drupal_get_path('module', 'node_export') . '/formats/xml.inc',
  58. '#description' => t(
  59. '<a href="!xml">XML 1.0</a> representation which is good for machine-readability and human-readability.',
  60. array(
  61. '!xml' => 'http://en.wikipedia.org/wiki/XML',
  62. )
  63. ),
  64. '#mime' => 'application/xml',
  65. '#export_callback' => 'node_export_xml_export',
  66. '#import_callback' => 'node_export_xml_import',
  67. ),
  68. 'dsv' => array(
  69. '#title' => t('DSV'),
  70. '#module' => 'node_export',
  71. '#file' => drupal_get_path('module', 'node_export') . '/formats/dsv.inc',
  72. '#description' => t(
  73. 'Configurable <a href="!dsv">Delimiter-separated values</a> code. Export and import sites must be configured the same.',
  74. array(
  75. '!dsv' => 'http://en.wikipedia.org/wiki/Delimiter-separated_values'
  76. )
  77. ),
  78. '#settings_callback' => 'node_export_dsv_settings',
  79. '#export_callback' => 'node_export_dsv_export',
  80. '#import_callback' => 'node_export_dsv_import',
  81. ),
  82. );
  83. }