social_media_links.install 822 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * @file
  4. * Social Media Link module's install and uninstall code.
  5. */
  6. /**
  7. * Implements hook_uninstall().
  8. */
  9. function social_media_links_uninstall() {
  10. variable_del('social_media_links_platforms');
  11. variable_del('social_media_links_appearance');
  12. variable_del('social_media_links_link_attributes');
  13. variable_del('social_media_links_icon_style');
  14. }
  15. /**
  16. * Migrate the platform data to the new structure.
  17. */
  18. function social_media_links_update_7101() {
  19. $platforms = variable_get('social_media_links_platforms', array());
  20. foreach ($platforms as $key => $value) {
  21. if (!is_array($value)) {
  22. $platform_new = array(
  23. 'platform_value' => $value,
  24. 'weight' => 0,
  25. );
  26. $platforms[$key] = $platform_new;
  27. }
  28. }
  29. variable_set('social_media_links_platforms', $platforms);
  30. }