Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.93 KB | None | 0 0
  1. <?php
  2.  
  3. if (!isset($GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['type'])) {
  4. if (file_exists($GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['dynamicConfigFile'])) {
  5. require_once($GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['dynamicConfigFile']);
  6. }
  7. // no type field defined, so we define it here. This will only happen the first time the extension is installed!!
  8. $GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['type'] = 'tx_extbase_type';
  9. $tempColumnstx_mfshvcore_tx_famelolocation_domain_model_location = array();
  10. $tempColumnstx_mfshvcore_tx_famelolocation_domain_model_location[$GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['type']] = array(
  11. 'exclude' => 1,
  12. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore.tx_extbase_type',
  13. 'config' => array(
  14. 'type' => 'select',
  15. 'items' => array(
  16. array('Location','Tx_Mfshvcore_Location')
  17. ),
  18. 'default' => 'Tx_Mfshvcore_Location',
  19. 'size' => 1,
  20. 'maxitems' => 1,
  21. )
  22. );
  23. \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tx_famelolocation_domain_model_location', $tempColumnstx_mfshvcore_tx_famelolocation_domain_model_location, 1);
  24. }
  25.  
  26. \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
  27. 'tx_famelolocation_domain_model_location',
  28. $GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['type'],
  29. '',
  30. 'after:' . $GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['label']
  31. );
  32.  
  33. $tmp_mfshvcore_columns = array(
  34.  
  35. 'og' => array(
  36. 'exclude' => 1,
  37. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.og',
  38. 'config' => array(
  39. 'type' => 'input',
  40. 'size' => 30,
  41. 'eval' => 'trim'
  42. ),
  43. ),
  44. 'lg' => array(
  45. 'exclude' => 1,
  46. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.lg',
  47. 'config' => array(
  48. 'type' => 'input',
  49. 'size' => 30,
  50. 'eval' => 'trim'
  51. ),
  52. ),
  53. 'member_count' => array(
  54. 'exclude' => 1,
  55. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.member_count',
  56. 'config' => array(
  57. 'type' => 'input',
  58. 'size' => 30,
  59. 'eval' => 'trim'
  60. ),
  61. ),
  62. 'monday_from' => array(
  63. 'exclude' => 1,
  64. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.monday_from',
  65. 'config' => array(
  66. 'type' => 'input',
  67. 'size' => 30,
  68. 'eval' => 'trim'
  69. ),
  70. ),
  71. 'monday_to' => array(
  72. 'exclude' => 1,
  73. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.monday_to',
  74. 'config' => array(
  75. 'type' => 'input',
  76. 'size' => 30,
  77. 'eval' => 'trim'
  78. ),
  79. ),
  80. 'tuesday_from' => array(
  81. 'exclude' => 1,
  82. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.tuesday_from',
  83. 'config' => array(
  84. 'type' => 'input',
  85. 'size' => 30,
  86. 'eval' => 'trim'
  87. ),
  88. ),
  89. 'tuesday_to' => array(
  90. 'exclude' => 1,
  91. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.tuesday_to',
  92. 'config' => array(
  93. 'type' => 'input',
  94. 'size' => 30,
  95. 'eval' => 'trim'
  96. ),
  97. ),
  98. 'wednesday_from' => array(
  99. 'exclude' => 1,
  100. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.wednesday_from',
  101. 'config' => array(
  102. 'type' => 'input',
  103. 'size' => 30,
  104. 'eval' => 'trim'
  105. ),
  106. ),
  107. 'wednesday_to' => array(
  108. 'exclude' => 1,
  109. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.wednesday_to',
  110. 'config' => array(
  111. 'type' => 'input',
  112. 'size' => 30,
  113. 'eval' => 'trim'
  114. ),
  115. ),
  116. 'thursday_from' => array(
  117. 'exclude' => 1,
  118. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.thursday_from',
  119. 'config' => array(
  120. 'type' => 'input',
  121. 'size' => 30,
  122. 'eval' => 'trim'
  123. ),
  124. ),
  125. 'thursday_to' => array(
  126. 'exclude' => 1,
  127. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.thursday_to',
  128. 'config' => array(
  129. 'type' => 'input',
  130. 'size' => 30,
  131. 'eval' => 'trim'
  132. ),
  133. ),
  134. 'friday_from' => array(
  135. 'exclude' => 1,
  136. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.friday_from',
  137. 'config' => array(
  138. 'type' => 'input',
  139. 'size' => 30,
  140. 'eval' => 'trim'
  141. ),
  142. ),
  143. 'friday_to' => array(
  144. 'exclude' => 1,
  145. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.friday_to',
  146. 'config' => array(
  147. 'type' => 'input',
  148. 'size' => 30,
  149. 'eval' => 'trim'
  150. ),
  151. ),
  152. 'saturday_from' => array(
  153. 'exclude' => 1,
  154. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.saturday_from',
  155. 'config' => array(
  156. 'type' => 'input',
  157. 'size' => 30,
  158. 'eval' => 'trim'
  159. ),
  160. ),
  161. 'saturday_to' => array(
  162. 'exclude' => 1,
  163. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.saturday_to',
  164. 'config' => array(
  165. 'type' => 'input',
  166. 'size' => 30,
  167. 'eval' => 'trim'
  168. ),
  169. ),
  170. 'sunday_from' => array(
  171. 'exclude' => 1,
  172. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.sunday_from',
  173. 'config' => array(
  174. 'type' => 'input',
  175. 'size' => 30,
  176. 'eval' => 'trim'
  177. ),
  178. ),
  179. 'sunday_to' => array(
  180. 'exclude' => 1,
  181. 'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.sunday_to',
  182. 'config' => array(
  183. 'type' => 'input',
  184. 'size' => 30,
  185. 'eval' => 'trim'
  186. ),
  187. ),
  188. );
  189.  
  190. \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tx_famelolocation_domain_model_location', $tmp_mfshvcore_columns);
  191.  
  192. /* inherit and extend the show items from the parent class */
  193.  
  194. if(isset($GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types']['1']['showitem'])) {
  195. $GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types']['Tx_Mfshvcore_Location']['showitem'] = $GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types']['1']['showitem'];
  196. } elseif(is_array($GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types'])) {
  197. // use first entry in types array
  198. $tx_famelolocation_domain_model_location_type_definition = reset($GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types']);
  199. $GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types']['Tx_Mfshvcore_Location']['showitem'] = $tx_famelolocation_domain_model_location_type_definition['showitem'];
  200. } else {
  201. $GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types']['Tx_Mfshvcore_Location']['showitem'] = '';
  202. }
  203. $GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types']['Tx_Mfshvcore_Location']['showitem'] .= ',--div--;LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location,';
  204. $GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types']['Tx_Mfshvcore_Location']['showitem'] .= 'og, lg, member_count, monday_from, monday_to, tuesday_from, tuesday_to, wednesday_from, wednesday_to, thursday_from, thursday_to, friday_from, friday_to, saturday_from, saturday_to, sunday_from, sunday_to';
  205.  
  206. $GLOBALS['TCA']['tx_famelolocation_domain_model_location']['columns'][$GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['type']]['config']['items'][] = array('LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_famelolocation_domain_model_location.tx_extbase_type.Tx_Mfshvcore_Location','Tx_Mfshvcore_Location');
  207.  
  208. \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
  209. '',
  210. 'EXT:/Resources/Private/Language/locallang_csh_.xlf'
  211. );## EXTENSION BUILDER DEFAULTS END TOKEN - Everything BEFORE this line is overwritten with the defaults of the extension builder
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement