fgcf.install 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 Supports 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 Documents 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 concerné',
  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. * Rename "FGCF Thématique" vocabulary to "FGCF Thème", as per issue #642
  69. *
  70. * @return array
  71. */
  72. function fgcf_update_6101() {
  73. $sq = "UPDATE {vocabulary} SET name = 'FGCF Thème' WHERE name = 'FGCF Thématique'";
  74. $ret = array(update_sql($sq));
  75. return $ret;
  76. }
  77. /**
  78. * Rename "FGCF Public visé" vocabulary to "FGCF Public concerné", as per issue #642
  79. *
  80. * @return array
  81. */
  82. function fgcf_update_6102() {
  83. $sq = "UPDATE {vocabulary} SET name = 'FGCF Public concerné' WHERE name = 'FGCF Public visé'";
  84. $ret = array(update_sql($sq));
  85. return $ret;
  86. }
  87. /**
  88. * Deploy feature changes, as per issue #650.
  89. *
  90. * @return array
  91. */
  92. function fgcf_update_6103() {
  93. // Revert only the CCK field changes.
  94. features_revert(array('fgcf' => array('content')));
  95. // OR, to revert all components for all features :
  96. // features_revert();
  97. return array();
  98. }
  99. /**
  100. * Rename "FGCF Supports remis" and "FGCF Format de cours" vocabularies as per issue #642
  101. *
  102. * @return array
  103. */
  104. function fgcf_update_6104() {
  105. $ret = array();
  106. $sq = "UPDATE {vocabulary} SET name = 'FGCF Documents remis' WHERE name = 'FGCF Supports remis'";
  107. $ret[] = update_sql($sq);
  108. $sq = "UPDATE {vocabulary} SET name = 'FGCF Supports de cours' WHERE name = 'FGCF Format de cours'";
  109. $ret[] = update_sql($sq);
  110. $sq = "DELETE FROM {url_alias} WHERE src LIKE 'fgcf/%'";
  111. $ret[] = update_sql($sq);
  112. return $ret;
  113. }