fgcf.install 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /**
  3. * Implementation of hook_install().
  4. */
  5. function fgcf_install() {
  6. $vocabulary = array(
  7. 'name' => 'FGCF Thème',
  8. 'description' => '',
  9. 'multiple' => 0,
  10. 'required' => 1,
  11. 'hierarchy' => 0,
  12. 'relations' => 1,
  13. 'module' => 'fgcf',
  14. 'weight' => 0,
  15. 'nodes' => array('fgcf_fiche' => 1),
  16. );
  17. taxonomy_save_vocabulary($vocabulary);
  18. $vocabulary = array(
  19. 'name' => 'FGCF Format de cours',
  20. 'description' => 'Toute caractéristique de la formation, comme la présence de travaux pratiques, une évaluation, etc.',
  21. 'multiple' => 0,
  22. 'required' => 0,
  23. 'hierarchy' => 0,
  24. 'relations' => 1,
  25. 'module' => 'fgcf',
  26. 'weight' => 0,
  27. 'nodes' => array(),
  28. );
  29. taxonomy_save_vocabulary($vocabulary);
  30. $vocabulary = array(
  31. 'name' => 'FGCF Supports remis',
  32. 'description' => '',
  33. 'multiple' => 0,
  34. 'required' => 0,
  35. 'hierarchy' => 0,
  36. 'relations' => 1,
  37. 'module' => 'fgcf',
  38. 'weight' => 0,
  39. 'nodes' => array(),
  40. );
  41. taxonomy_save_vocabulary($vocabulary);
  42. $vocabulary = array(
  43. 'name' => 'FGCF Sanction',
  44. 'description' => '',
  45. 'multiple' => 1,
  46. 'required' => 0,
  47. 'hierarchy' => 0,
  48. 'relations' => 1,
  49. 'module' => 'fgcf',
  50. 'weight' => 0,
  51. 'nodes' => array(),
  52. );
  53. taxonomy_save_vocabulary($vocabulary);
  54. $vocabulary = array(
  55. 'name' => 'FGCF Public visé',
  56. 'description' => '',
  57. 'multiple' => 0,
  58. 'required' => 0,
  59. 'hierarchy' => 0,
  60. 'relations' => 1,
  61. 'module' => 'fgcf',
  62. 'weight' => 0,
  63. 'nodes' => array(),
  64. );
  65. taxonomy_save_vocabulary($vocabulary);
  66. }
  67. /**
  68. * Implements hook_update_N().
  69. *
  70. * Rename "FGCF Thématique" vocabulary to "FGCF Thème", as per issue #642
  71. *
  72. * @return array
  73. */
  74. function fgcf_update_6101() {
  75. $sq = "UPDATE {vocabulary} SET name = 'FGCF Thème' WHERE name = 'FGCF Thématique'";
  76. $ret = update_sql($sq);
  77. return $ret;
  78. }