materio_translator.install 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * @file
  4. * file_description
  5. */
  6. /**
  7. * Implements hook_schema().
  8. */
  9. function materio_translator_schema() {
  10. $schema['materio_translator'] = 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 materio_translator_install() {
  34. // Set module weight for it to run after core and i18n modules
  35. db_query("UPDATE {system} SET weight = 90 WHERE name = 'materio_translator' AND type = 'module'");
  36. }
  37. /**
  38. * Implements hook_uninstall().
  39. */
  40. // function materio_translator_uninstall() {
  41. // variable_del('materio_translator_languages');
  42. // }