tt_content.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Allow language synchronization for FAL fields
  4. */
  5. $allowSync = [
  6. 'tt_content' => [
  7. 'image',
  8. 'media'
  9. ]
  10. ];
  11. foreach ($allowSync as $syncTablename => $syncColumns) {
  12. foreach ($syncColumns as $syncColumn) {
  13. $GLOBALS['TCA'][$syncTablename]['columns'][$syncColumn]['config']['behaviour']['allowLanguageSynchronization'] = 1;
  14. }
  15. }
  16. /**
  17. * Add crop editor
  18. */
  19. $cropConfiguration = \CYBOB\EumSitePackage\Utility\TcaUtility::getDefaultCropConfiguration();
  20. $cropColumnsByType = [
  21. 'image' => [
  22. 'image'
  23. ],
  24. 'menu_pages' => [
  25. 'image'
  26. ],
  27. 'menu_subpages' => [
  28. 'image'
  29. ],
  30. 'menu_categorized_pages' => [
  31. 'image'
  32. ]
  33. ];
  34. foreach ($cropColumnsByType as $type => $cropColumns) {
  35. foreach ($cropColumns as $cropColumn) {
  36. $GLOBALS['TCA']['tt_content']['types'][$type]['columnsOverrides'][$cropColumn]['config']['overrideChildTca']['columns']['crop']['config'] = [
  37. 'cropVariants' => array_merge_recursive(
  38. [
  39. 'default' => [
  40. 'disabled' => true
  41. ]
  42. ],
  43. $cropConfiguration
  44. )
  45. ];
  46. }
  47. }