xmlsitemap_user.install 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * @file
  4. * Install and uninstall schema and functions for the xmlsitemap_user module.
  5. */
  6. /**
  7. * Implements hook_requirements().
  8. */
  9. function xmlsitemap_user_requirements($phase) {
  10. $requirements = array();
  11. $t = get_t();
  12. if ($phase == 'runtime') {
  13. if (!user_access('access user profiles', drupal_anonymous_user())) {
  14. $requirements['xmlsitemap_user_anonymous_permission'] = array(
  15. 'title' => $t('XML sitemap user'),
  16. 'value' => $t('Anonymous access to user profiles'),
  17. 'description' => $t('In order to list user profile links in the sitemap, the anonymous user must have the <a href="@perm-link"><em>View user profiles</em> permission</a>.', array('@perm-link' => url('admin/people/permissions/' . DRUPAL_ANONYMOUS_RID, array('fragment' => 'module-user')))),
  18. 'severity' => REQUIREMENT_ERROR,
  19. );
  20. }
  21. }
  22. return $requirements;
  23. }
  24. /**
  25. * Implements hook_uninstall().
  26. */
  27. function xmlsitemap_user_uninstall() {
  28. drupal_load('module', 'user');
  29. drupal_load('module', 'xmlsitemap');
  30. xmlsitemap_link_bundle_delete('user', 'user');
  31. }
  32. /**
  33. * Implements hook_update_last_removed().
  34. */
  35. function xmlsitemap_user_update_last_removed() {
  36. return 6202;
  37. }