cck_phone.install 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * @file
  4. * Defines phone number fields for CCK.
  5. * Installation file
  6. */
  7. /**
  8. * Implements hook_field_schema().
  9. */
  10. function cck_phone_field_schema($field) {
  11. return array(
  12. 'columns' => array(
  13. 'number' => array(
  14. 'type' => 'varchar',
  15. 'length' => 15,
  16. 'not null' => FALSE,
  17. ),
  18. 'country_codes' => array(
  19. 'type' => 'varchar',
  20. 'length' => 2,
  21. 'not null' => FALSE,
  22. ),
  23. 'extension' => array(
  24. 'type' => 'varchar',
  25. 'length' => 6,
  26. 'not null' => FALSE,
  27. ),
  28. ),
  29. );
  30. }
  31. /**
  32. * Implements hook_install().
  33. */
  34. function cck_phone_install() {
  35. drupal_set_message(st('Phone number module installed successfully.'));
  36. }
  37. /**
  38. * Implements hook_uninstall().
  39. */
  40. function cck_phone_uninstall() {
  41. }
  42. /**
  43. * Implements hook_enable().
  44. *
  45. * Notify content module when this module is enabled.
  46. */
  47. function cck_phone_enable() {
  48. // TODO: Migration path for phone.module to cck_phone
  49. }
  50. /**
  51. * Implements hook_disable().
  52. *
  53. * Notify content module when this module is disabled.
  54. */
  55. function cck_phone_disable() {
  56. }