imageblock.install 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * @file imageblock.install
  4. * Contains install and update functions for Image Block module.
  5. */
  6. /**
  7. * Implements hook_schema().
  8. */
  9. function imageblock_schema() {
  10. $schema = array();
  11. $schema['imageblock'] = array(
  12. 'description' => 'Stores contents of custom-made image blocks.',
  13. 'fields' => array(
  14. 'bid' => array(
  15. 'type' => 'serial',
  16. 'unsigned' => TRUE,
  17. 'not null' => TRUE,
  18. 'description' => "The block's {block}.bid.",
  19. ),
  20. 'body' => array(
  21. 'type' => 'text',
  22. 'not null' => FALSE,
  23. 'size' => 'big',
  24. 'description' => 'Block contents.',
  25. 'translatable' => TRUE,
  26. ),
  27. 'info' => array(
  28. 'type' => 'varchar',
  29. 'length' => 128,
  30. 'not null' => TRUE,
  31. 'default' => '',
  32. 'description' => 'Block description.',
  33. ),
  34. 'format' => array(
  35. 'type' => 'varchar',
  36. 'length' => 255,
  37. 'not null' => FALSE,
  38. 'description' => 'The {filter_format}.format of the block body.',
  39. ),
  40. 'fid' => array(
  41. 'type' => 'int',
  42. 'unsigned' => TRUE,
  43. 'not null' => TRUE,
  44. 'default' => 0,
  45. 'description' => "The File's {files}.fid.",
  46. ),
  47. 'data' => array(
  48. 'type' => 'text',
  49. 'not null' => FALSE,
  50. 'size' => 'big',
  51. 'description' => 'A serialized array of name value pairs that are related to the block file.',
  52. ),
  53. ),
  54. 'unique keys' => array(
  55. 'info' => array('info'),
  56. ),
  57. 'indexes' => array(
  58. 'fid' => array('fid'),
  59. ),
  60. 'primary key' => array('bid'),
  61. );
  62. return $schema;
  63. }
  64. /**
  65. * Implements hook_uninstall().
  66. */
  67. function imageblock_uninstall() {
  68. variable_del('imageblock_max_file_size');
  69. variable_del('imageblock_max_dimensions');
  70. variable_del('imageblock_image_path');
  71. }