vendor/codefog/contao-social_images/contao/dca/tl_page.php line 23

Open in your IDE?
  1. <?php
  2. use Contao\CoreBundle\DataContainer\PaletteManipulator;
  3. // Palettes
  4. foreach ($GLOBALS['TL_DCA']['tl_page']['palettes'] as $k => $v) {
  5. if (is_array($v)) {
  6. continue;
  7. }
  8. PaletteManipulator::create()
  9. ->addLegend('socialimages_legend', 'layout_legend', PaletteManipulator::POSITION_AFTER, true)
  10. ->addField('socialImage', 'socialimages_legend', PaletteManipulator::POSITION_APPEND)
  11. ->applyToPalette($k, 'tl_page')
  12. ;
  13. }
  14. // Fields
  15. $GLOBALS['TL_DCA']['tl_page']['fields']['socialImage'] = [
  16. 'exclude' => true,
  17. 'inputType' => 'fileTree',
  18. 'eval' => ['files' => true, 'filesOnly' => true, 'fieldType' => 'radio', 'extensions' => \Contao\Config::get('validImageTypes'), 'tl_class' => 'clr'],
  19. 'sql' => ['type' => 'binary', 'length' => 16, 'notnull' => false],
  20. ];