i18n_access.install 1017 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * @file
  4. * file_description
  5. */
  6. /**
  7. * Implements hook_schema().
  8. */
  9. function i18n_access_schema() {
  10. $schema['i18n_access'] = array(
  11. 'description' => 'Store language permissions per user',
  12. 'fields' => array(
  13. 'uid' => array(
  14. 'description' => 'The primary identifier for a user.',
  15. 'type' => 'int',
  16. 'unsigned' => TRUE,
  17. 'not null' => TRUE,
  18. ),
  19. 'perm' => array(
  20. 'description' => 'List of languages that the user has permission for.',
  21. 'type' => 'text',
  22. 'not null' => FALSE,
  23. 'size' => 'big',
  24. ),
  25. ),
  26. 'primary key' => array('uid'),
  27. );
  28. return $schema;
  29. }
  30. /**
  31. * Implements hook_install().
  32. */
  33. function i18n_access_install() {
  34. // Set module weight for it to run after core and i18n modules
  35. db_query("UPDATE {system} SET weight = 20 WHERE name = 'i18n_access' AND type = 'module'");
  36. }
  37. /**
  38. * Implements hook_uninstall().
  39. */
  40. function i18n_access_uninstall() {
  41. variable_del('i18n_access_languages');
  42. }