node_export.install 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?php
  2. /**
  3. * @file
  4. * The Node export install file.
  5. */
  6. /**
  7. * Implements hook_uninstall().
  8. */
  9. function node_export_uninstall() {
  10. variable_del('node_export_format');
  11. variable_del('node_export_code');
  12. variable_del('node_export_filename');
  13. variable_del('node_export_file_list');
  14. variable_del('node_export_existing');
  15. $types = node_type_get_names();
  16. foreach ($types as $type => $name) {
  17. variable_del('node_export_reset_status_' . $type);
  18. variable_del('node_export_reset_promote_' . $type);
  19. variable_del('node_export_reset_sticky_' . $type);
  20. variable_del('node_export_reset_author_' . $type);
  21. variable_del('node_export_reset_created_' . $type);
  22. variable_del('node_export_reset_menu_' . $type);
  23. variable_del('node_export_reset_revision_timestamp_' . $type);
  24. variable_del('node_export_reset_last_comment_timestamp_' . $type);
  25. variable_del('node_export_reset_path_' . $type);
  26. variable_del('node_export_reset_book_mlid_' . $type);
  27. }
  28. // File field functionality.
  29. variable_del('node_export_file_types');
  30. variable_del('node_export_file_mode');
  31. variable_del('node_export_file_assets_path');
  32. variable_del('node_export_file_supported_fields');
  33. // DSV format.
  34. variable_del('node_export_dsv_delimiter');
  35. variable_del('node_export_dsv_enclosure');
  36. variable_del('node_export_dsv_seperator');
  37. variable_del('node_export_dsv_escape_eol');
  38. // Old vars.
  39. variable_del('node_export_reset_' . $type);
  40. variable_del('node_export_nodes_without_confirm');
  41. }
  42. /**
  43. * Warn user about changed permissions and configuration.
  44. */
  45. function node_export_update_7300() {
  46. drupal_set_message(
  47. t(
  48. "Node export <a href=\"!perms\">permissions</a> and <a href=\"!config\">configuration</a> "
  49. . "have changed, please take this opportunity to review these options to "
  50. . "ensure the correct behavior and security of the module. The import "
  51. . "form is now located under <a href=\"!add\">Create content</a>.",
  52. array(
  53. '!perms' => url('admin/people/permissions'),
  54. '!config' => url('admin/settings/node_export'),
  55. '!add' => url('node/add'),
  56. )
  57. ),
  58. 'warning'
  59. );
  60. drupal_set_message(
  61. t(
  62. "Node export no longer checks whether users have access to use the "
  63. . "filter formats of the fields in the node. Please keep this in mind "
  64. . "when deciding which user roles will get the 'export nodes' "
  65. . "permission."
  66. ),
  67. 'warning'
  68. );
  69. return 'Note: Please update Node export permissions and configuration.';
  70. }
  71. /**
  72. * Combine Node export file module directly into Node export.
  73. */
  74. function node_export_update_7301() {
  75. // Upgraders with node_export_file should have the module disabled.
  76. if (module_exists('node_export_file')) {
  77. drupal_set_message('<em>Node export file</em> is deprecated. Please delete the ' . drupal_get_path('module', 'node_export_file') . ' directory from the Drupal installation.', 'warning');
  78. module_disable(array('node_export_file'), FALSE);
  79. }
  80. return 'Node export file removed, functionality moved to Node export.';
  81. }
  82. /**
  83. * Remove old variables.
  84. */
  85. function node_export_update_7302() {
  86. // Old variables.
  87. variable_del('node_export_method');
  88. variable_del('node_export_bulk_code');
  89. variable_del('node_export_bulk_filename');
  90. variable_del('node_export_omitted');
  91. return 'Removed old variables.';
  92. }
  93. /**
  94. * Combine Node export format modules directly into Node export.
  95. */
  96. function node_export_update_7303() {
  97. // Upgraders with format modules should have the modules disabled.
  98. if (module_exists('node_export_node_code')) {
  99. drupal_set_message('<em>Node export node code</em> is deprecated. Please delete the ' . drupal_get_path('module', 'node_export_node_code') . ' directory from the Drupal installation.', 'warning');
  100. module_disable(array('node_export_node_code'), FALSE);
  101. }
  102. if (module_exists('node_export_drupal')) {
  103. drupal_set_message('<em>Node export drupal</em> is deprecated. Please delete the ' . drupal_get_path('module', 'node_export_drupal') . ' directory from the Drupal installation.', 'warning');
  104. module_disable(array('node_export_drupal'), FALSE);
  105. }
  106. if (module_exists('node_export_dsv')) {
  107. drupal_set_message('<em>Node export DSV</em> is deprecated. Please delete the ' . drupal_get_path('module', 'node_export_dsv') . ' directory from the Drupal installation.', 'warning');
  108. module_disable(array('node_export_dsv'), FALSE);
  109. }
  110. if (module_exists('node_export_csv')) {
  111. drupal_set_message('<em>Node export CSV</em> is deprecated. Please delete the ' . drupal_get_path('module', 'node_export_csv') . ' directory from the Drupal installation.', 'warning');
  112. module_disable(array('node_export_csv'), FALSE);
  113. }
  114. if (module_exists('node_export_json')) {
  115. drupal_set_message('<em>Node export JSON</em> is deprecated. Please delete the ' . drupal_get_path('module', 'node_export_json') . ' directory from the Drupal installation.', 'warning');
  116. module_disable(array('node_export_json'), FALSE);
  117. }
  118. if (module_exists('node_export_serialize')) {
  119. drupal_set_message('<em>Node export serialize</em> is deprecated. Please delete the ' . drupal_get_path('module', 'node_export_serialize') . ' directory from the Drupal installation.', 'warning');
  120. module_disable(array('node_export_serialize'), FALSE);
  121. }
  122. if (module_exists('node_export_xml')) {
  123. drupal_set_message('<em>Node export XML</em> is deprecated. Please delete the ' . drupal_get_path('module', 'node_export_xml') . ' directory from the Drupal installation.', 'warning');
  124. module_disable(array('node_export_xml'), FALSE);
  125. }
  126. return 'Node export format modules removed, functionality moved to Node export.';
  127. }