<?php

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', array(
  'roof' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.roof',
    'config' => array(
      'type' => 'input',
      'size' => 254,
      'max' => 2047,
      'eval' => 'trim',
      'default' => ''
    )
  ),
  'projectTitle' => array(
    'exclude' => true,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.projectTitle',
    'config' => array(
      'type' => 'input',
      'size' => 254,
      'eval' => 'trim',
      'default' => ''
    )
  ),
  'articleAffiliation' => array(
    'exclude' => true,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.articleAffiliation',
    'config' => array(
      'type' => 'input',
      'size' => 254,
      'eval' => 'trim',
      'default' => ''
    )
  ),
  'targetgroup' => array(
    'exclude' => true,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.targetgroup',
    'config' => array(
      'type' => 'select',
      'renderType' => 'selectSingle',
      'items' => [
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.targetgroup.select.pupils', 'pupils'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.targetgroup.select.parents', 'parents'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.targetgroup.select.teachers', 'teachers'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.targetgroup.select.consultants', 'consultants'],
      ],
      'default' => 'pupils',
    )
  ),
  'red_status' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.red_status',
    'config' => array(
      'type' => 'select',
      'renderType' => 'selectSingle',
      'items' => [
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.red_status.-1', -1],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.red_status.1', 1],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.red_status.2', 2],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.red_status.3', 3],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.red_status.11', 11],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.red_status.12', 12],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.red_status.21', 21],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.red_status.22', 22],
      ],
      'default' => -1
    )
  ),
  'assetType' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType',
    'config' => array(
      'type' => 'select',
      'renderType' => 'selectSingle',
      'items' => [
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType.0', 'homepage'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType.1', 'themeOverview'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType.2', 'alternateThemeOverview'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType.3', 'content'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType.4', 'oldContent'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType.5', 'infoText'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType.6', 'generalContent'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType.7', 'interactivity'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType.8', 'fragebogen'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType.9', 'printEditionOverview'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType.10', 'news'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType.11', 'readersLetter'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType.12', 'blogOverview'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.assetType.13', 'contact'],
      ],
      'default' => 'content'
    )
  ),
  'publicationType' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.publicationType',
    'config' => array(
      'type' => 'select',
      'renderType' => 'selectSingle',
      'items' => [
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.publicationType.0', 'online'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.publicationType.1', 'onlineAndPrint'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.publicationType.2', 'print'],
      ],
      'default' => 'online'
    )
  ),
  'orderStatus' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.orderStatus',
    'config' => array(
      'type' => 'select',
      'renderType' => 'selectSingle',
      'items' => [
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.orderStatus.0', 'new'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.orderStatus.3', 'aktualisiert'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.orderStatus.2', 'locked'],
      ],
      'default' => 'new'
    )
  ),
  'orderType' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.orderType',
    'config' => array(
      'type' => 'select',
      'renderType' => 'selectSingle',
      'items' => [
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.orderType.0', 'intern'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.orderType.1', 'extern'],
      ],
      'default' => 'intern'
    )
  ),
  'author_ro' => array(
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.author_ro',
    'config' => array(
        'type' => 'none',
        'format' => 'user',
        'format.' => array(
          'userFunc' => \Meramo\mrm_be\UserFunc\Pages::class.'->render_author_ro',
        )
    ),
  ),
  'last_editor_ro' => array(
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.last_editor_ro',
    'config' => array(
        'type' => 'none',
        'format' => 'user',
        'format.' => array(
          'userFunc' => \Meramo\mrm_be\UserFunc\Pages::class.'->render_last_editor_ro',
        )
    ),
  ),
  'be_author' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.be_author',
    'config' => array(
      'type' => 'select',
      'renderType' => 'selectSingle',
      'default' => 1,
      'foreign_table' => 'be_users',
    )
  ),
  'red_end' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.red_end',
    'config' => array(
      'type' => 'input',
      'renderType' => 'inputDateTime',
      'eval' => 'datetime',
      'default' => 0,
    )
  ),
  'use_roof_as_breadcrumb_text' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.use_roof_as_breadcrumb_text',
    'config' => array(
      'type' => 'check',
      'renderType' => 'checkboxToggle',
      'items' => [
        [
          0 => '',
          1 => '',
        ]
      ],
      'default' => 0
    ),
  ),
  'forCategoryOverview' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.forCategoryOverview',
    'config' => array(
      'type' => 'check',
      'renderType' => 'checkboxToggle',
      'items' => [
        [
          0 => '',
          1 => '',
        ]
      ],
      'default' => 0
    ),
  ),
  'forCategoryOverviewTopPosition' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.forCategoryOverviewTopPosition',
    'config' => array(
      'type' => 'check',
      'renderType' => 'checkboxToggle',
      'items' => [
        [
          0 => '',
          1 => '',
        ]
      ],
      'default' => 0
    ),
  ),
  'forThemeOverview' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.forThemeOverview',
    'config' => array(
      'type' => 'check',
      'renderType' => 'checkboxToggle',
      'items' => [
        [
          0 => '',
          1 => '',
        ]
      ],
      'default' => 0
    ),
  ),
  'forHome' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.forHome',
    'config' => array(
      'type' => 'check',
      'renderType' => 'checkboxToggle',
      'items' => [
        [
          0 => '',
          1 => '',
        ]
      ],
      'default' => 0
    ),
  ),
  'forHTMLSitemap' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.forHTMLSitemap',
    'config' => array(
      'type' => 'check',
      'renderType' => 'checkboxToggle',
      'items' => [
        [
          0 => '',
          1 => '',
        ]
      ],
      'default' => 0
    ),
  ),
  'teaserHome' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.teaserHome',
    'config' => array(
      'type' => 'input',
      'size' => 90,
      'max' => 90,
      'eval' => 'trim',
      'default' => ''
    )
  ),
  'teaserOverview' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.teaserOverview',
    'config' => array(
      'type' => 'input',
      'size' => 90,
      'max' => 90,
      'eval' => 'trim',
      'default' => ''
    )
  ),
  'sharing_activated' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.sharing.activated',
    'config' => array(
      'type' => 'check',
      'renderType' => 'checkboxToggle',
      'items' => [
        [
          0 => '',
          1 => '',
        ]
      ],
      'default' => 1
    ),
  ),
  'blog_author' => [
    'exlude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.blogauthor.select',
    'config' => [
      'type' => 'select',
      'renderType' => 'selectSingle',
      'items' => [],
      'foreign_table' => 'pages',
      'foreign_table_where' => 'AND {#pages}.{#doktype} = 102 ORDER BY title',
      'eval' => 'int',
      'default' => 0,
    ],
  ],
  'overview' => [
    'exclude' => true,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.blogauthor.overview',
    'config' => array(
      'type' => 'text',
      'cols' => '32',
      'rows' => '6',
      'eval' => 'trim',
      'default' => ''
    )
  ],
  'intro' => [
    'exclude' => true,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.blogauthor.intro',
    'config' => array(
      'type' => 'text',
      'cols' => '32',
      'rows' => '6',
      'eval' => 'trim',
      'default' => ''
    )
  ],
  'security_user_pass' => array(
    'exclude' => true,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.security.user_pass',
    'config' => array(
      'type' => 'text',
      'cols' => '32',
      'rows' => '4',
      'eval' => 'trim',
      'default' => ''
    )
  ),
  'dkz_code_nrs' => array(
    'exclude' => true,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.dkz',
    'config' => array(
      'type' => 'user',
      'renderType' => 'mrm_pages_dkz_selector',
      /* *
      'type' => 'input',
      'size' => 254,
      'eval' => 'trim',
      /* */
      'default' => '',
    )
  ),
  'free_searchwords' => array(
     'exclude' => 1,
     'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.free_searchwords',
     'config' => array (
       'type' => 'text',
       'cols' => '32',
       'rows' => '4'
     )
   ),
   'abstract' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.abstract',
    'config' => array (
      'type' => 'text',
      'cols' => '32',
      'rows' => '4',
      'max' => 200
    )
  ),
   'ignored_searchwords' => array(
      'exclude' => 1,
      'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.ignored_searchwords',
      'config' => array (
        'type' => 'text',
        'cols' => '32',
        'rows' => '4'
      )
    ),
  'lesson' => array(
    'exclude' => true,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.lesson',
    'config' => [
      'type' => 'select',
      'renderType' => 'selectCheckBox',
      'items' => [
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.lesson.select.0', 0],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.lesson.select.1', 1],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.lesson.select.2', 2],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.lesson.select.3', 3],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.lesson.select.4', 4],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.lesson.select.5', 5],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.lesson.select.6', 6],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.lesson.select.7', 7],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.lesson.select.8', 8],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.lesson.select.9', 9],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.lesson.select.10', 10],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.lesson.select.11', 11],
      ],
    ]
  ),
  'overview_image' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.overview.image',
    'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
      'overview_image',
      [
        'type' => 'inline',
        'maxitems' => 1,
        'minitems' => 0,
        'foreign_table' => 'sys_file_reference',
        'foreign_table_field' => 'tablenames',
        'foreign_label' => 'uid_local',
        'foreign_sortby' => 'sorting_foreign',
        'foreign_field' => 'uid_foreign',
        'foreign_selector' => 'uid_local',
        'foreign_selector_fieldTcaOverride' => [
          'config' => [
            'appearance' => [
              'elementBrowserType' => 'file',
              'elementBrowserAllowed' => 'gif,jpg,jpeg,png,svg',
            ],
          ],
        ],
        'foreign_types' => [
          0 => [
            'showitem' => '--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette',
          ],
          2 => [
            'showitem' => '--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette',
          ],
        ],
        'foreign_match_fields' => [
          'fieldname' => 'overview_image',
        ],
        'appearance' => [
          'fileUploadAllowed' => 0,
          'newRecordLinkAddTitle' => 1,
          'headerThumbnail' => [
            'field' => 'uid_local',
            'height' => 64,
            'width' => 64,
          ],
          'enabledControls' => [
            'info' => 1,
            'new' => 0,
            'dragdrop' => 0,
            'sort' => 1,
            'hide' => 0,
            'delete' => 1,
            'localize' => 0,
          ],
          'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference',
        ],
        'behaviour' => [
          'localizationMode' => 'select',
          'localizeChildrenAtParentLocalization' => 1,
        ],
        'overrideChildTca' => [
          'columns' => [
            'uid_local' => [
              'config' => [
                'appearance' => [
                  'elementBrowserType' => 'file',
                  'elementBrowserAllowed' => 'jpg,png,svg,jpeg,gif',
                ],
              ],
            ],
          ],
          'types' => [
            2 => [
              'showitem' => '--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette',
            ],
          ],
        ],
      ],
      $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
    )
  ),
  'event_link' => array(
    'exclude' => 1,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_link',
    'config' => array(
      'type' => 'input',
      'size' => 254,
      'max' => 2047,
      'eval' => 'trim',
      'default' => ''
    )
  ),
  'event_location' => array(
    'exclude' => true,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_location',
    'config' => array(
      'type' => 'input',
      'size' => 254,
      'eval' => 'trim',
      'default' => ''
    )
  ),
  'event_state' => array(
    'exclude' => true,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_state',
    'config' => [
      'type' => 'select',
      'renderType' => 'selectSingle',
      'items' => (function(){
          $a = [];
          for($i = 0; $i < 17; $i++) array_push($a, ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_state.select.'.$i, $i]);
          return $a;
        })()
      ,
    ]
  ),
  'event_category' => array(
    'exclude' => true,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category',
    'config' => [
      'type' => 'select',
      'renderType' => 'selectSingle',
      'items' => [
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.5', 5],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.6', 6],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.7', 7],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.8', 8],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.9', 9],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.11', 11],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.10', 10],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.14', 14],
      ],
    ],
  ),
  'blog_status' => array(
    'exclude' => true,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.blog.blog_status',
    'config' => [
      'type' => 'select',
      'renderType' => 'selectSingle',
      'items' => [
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.blog.blog_status.select.1', 1],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.blog.blog_status.select.2', 2],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.blog.blog_status.select.3', 3],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.blog.blog_status.select.4', 4],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.blog.blog_status.select.5', 5],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.blog.blog_status.select.6', 6],
      ],
      'default' => 2,
    ]
  ),
  'blog_category' => array(
    'exclude' => true,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.blog.blog_category',
    'config' => [
      'type' => 'select',
      'renderType' => 'selectSingle',
      'items' => [
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.5', 5],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.6', 6],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.7', 7],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.8', 8],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.9', 9],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.11', 11],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.10', 10],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.event_category.select.14', 14],
      ],
      'default' => 5,
    ],
  ),
  'documentlanguage' => array(
    'exclude' => true,
    'label' => 'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.documentlanguage',
    'config' => [
      'type' => 'select',
      'renderType' => 'selectSingle',
      'items' => [
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.documentlanguage.select.de', 'de'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.documentlanguage.select.en', 'en'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.documentlanguage.select.fr', 'fr'],
        ['LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.documentlanguage.select.es', 'es'],
      ],
      'default' => 'de'
    ],
  ),
));

\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule(
  $GLOBALS['TCA']['pages'],
  [
    'types' => [
      (string) 1 => [
        'showitem' => (function($showitem){
          $showitem = trim(preg_replace('/\s\s+/', ' ', $showitem));
          //remove metadata tab
          $showitem = str_replace(' --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata, --palette--;;abstract, --palette--;;metatags, --palette--;;editorial,', '', $showitem);
          //remove access tab
          $showitem = str_replace(' --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.access, --palette--;;visibility, --palette--;;access,', '', $showitem);
          //file_put_contents('/var/www/html/typo3temp/debug.log', $showitem.PHP_EOL, FILE_APPEND);
          //file_put_contents('/var/www/html/typo3temp/debug.log', json_encode($GLOBALS, JSON_PRETTY_PRINT).PHP_EOL, FILE_APPEND);

          return $showitem;
        })($GLOBALS['TCA']['pages']['types'][\TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKTYPE_DEFAULT]['showitem'])
      ]
    ]
  ]
);

/* event doktype */
$eventDoktype = 100;
// Add new page type as possible select item:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
  'pages',
  'doktype',
  [
   'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.doktype.event',
   $eventDoktype,
   'EXT:mrm_be/Resources/Public/Icons/mrm_be_doktype_event.svg'
  ],
  '1',
  'after'
);

\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule(
  $GLOBALS['TCA']['pages'],
  [
    // add icon for new page type:
    'ctrl' => [
      'typeicon_classes' => [
        $eventDoktype => 'mrm_be_doktype_event_icon',
      ],
    ],
    // add all page standard fields and tabs to your new page type
    'types' => [
      (string) $eventDoktype => [
        'showitem' => (function($showitem){ //remove seo, social media and metadata tab
          $showitem = trim(preg_replace('/\s\s+/', ' ', $showitem));
          $cutstart = strpos($showitem,  '--div--;LLL:EXT:seo');
          $cutend = strpos($showitem, '--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.appearance');
          $y = substr($showitem, 0, $cutstart).substr($showitem, $cutend);
          return $y;
        })($GLOBALS['TCA']['pages']['types'][\TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKTYPE_DEFAULT]['showitem'])
      ]
    ]
  ]
);
/* event doktype end */

/* blog doktype */
$blogDoktype = 101;
// Add new page type as possible select item:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
  'pages',
  'doktype',
  [
   'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.doktype.blog',
   $blogDoktype,
   'EXT:mrm_be/Resources/Public/Icons/mrm_be_doktype_blog.svg'
  ],
  '1',
  'after'
);

\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule(
  $GLOBALS['TCA']['pages'],
  [
    // add icon for new page type:
    'ctrl' => [
      'typeicon_classes' => [
        $blogDoktype => 'mrm_be_doktype_blog_icon',
      ],
    ],
    // add all page standard fields and tabs to your new page type
    'types' => [
      (string) $blogDoktype => [
        'showitem' => $GLOBALS['TCA']['pages']['types'][\TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKTYPE_DEFAULT]['showitem']
      ]
    ]
  ]
);
/* blog doktype end */
/* blogauthor doktype */
$blogauthorDoktype = 102;
// Add new page type as possible select item:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
  'pages',
  'doktype',
  [
   'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.doktype.blogauthor',
   $blogauthorDoktype,
   'EXT:mrm_be/Resources/Public/Icons/mrm_be_doktype_blogauthor.svg'
  ],
  '1',
  'after'
);

\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule(
  $GLOBALS['TCA']['pages'],
  [
    // add icon for new page type:
    'ctrl' => [
      'typeicon_classes' => [
        $blogauthorDoktype => 'mrm_be_doktype_blogauthor_icon',
      ],
    ],
    // add all page standard fields and tabs to your new page type
    'types' => [
      (string) $blogauthorDoktype => [
        'showitem' => $GLOBALS['TCA']['pages']['types'][\TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKTYPE_DEFAULT]['showitem']
      ]
    ]
  ]
);
/* blogauthor doktype end */

/* archive doktype */
$archiveDoktype = 103;
// Add new page type as possible select item:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
  'pages',
  'doktype',
  [
   'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.doktype.archive',
   $archiveDoktype,
   'EXT:mrm_be/Resources/Public/Icons/mrm_be_doktype_archive.svg'
  ],
  '1',
  'after'
);

\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule(
  $GLOBALS['TCA']['pages'],
  [
    // add icon for new page type:
    'ctrl' => [
      'typeicon_classes' => [
        $archiveDoktype => 'mrm_be_doktype_archive_icon',
      ],
    ],
    // add all page standard fields and tabs to your new page type
    'types' => [
      (string) $archiveDoktype => [
        'showitem' => $GLOBALS['TCA']['pages']['types'][\TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKTYPE_DEFAULT]['showitem']
      ]
    ]
  ]
);
/* archive doktype end */

/* video doktype */
$videoDoktype = 104;
// Add new page type as possible select item:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
  'pages',
  'doktype',
  [
   'LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.doktype.video',
   $videoDoktype,
   'EXT:mrm_be/Resources/Public/Icons/mrm_be_doktype_video.svg'
  ],
  '1',
  'after'
);

\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule(
  $GLOBALS['TCA']['pages'],
  [
    // add icon for new page type:
    'ctrl' => [
      'typeicon_classes' => [
        $videoDoktype => 'mrm_be_doktype_video_icon',
      ],
    ],
    // add all page standard fields and tabs to your new page type
    'types' => [
      (string) $videoDoktype => [
        'showitem' => $GLOBALS['TCA']['pages']['types'][\TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKTYPE_DEFAULT]['showitem']
      ]
    ]
  ]
);
/* video doktype end */


\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','--div--;LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.title, --palette--;;access,red_status,--linebreak--,targetgroup,projectTitle,articleAffiliation,publicationType,orderStatus,orderType,author_ro,be_author,last_editor_ro,red_end,forCategoryOverview,forCategoryOverviewTopPosition,forThemeOverview,forHome,forHTMLSitemap,sharing_activated', '1', 'after:nav_title');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','--div--;LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.general.title, --palette--;;access,red_status--linebreak--,red_status,targetgroup,projectTitle,articleAffiliation,publicationType,orderStatus,orderType,author_ro,be_author,last_editor_ro,red_end,forCategoryOverview,forCategoryOverviewTopPosition,forThemeOverview,forHome,sharing_activated', '104', 'after:nav_title');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','--div--;LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.teaser.title, intro, --linebreak--, teaserHome, --linebreak--, teaserOverview', '1', 'after:nav_title');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','--div--;LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.teaser.title, intro,--linebreak--, teaserHome, --linebreak--, teaserOverview', '104', 'after:nav_title');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','--div--;LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.event.title, --palette--;;access,red_status,--linebreak--,event_link,event_location,event_state,event_category,sharing_activated', '100', 'after:nav_title');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','--div--;LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.blog.title, --palette--;;access,red_status,--linebreak--,be_author,blog_author,overview_image,blog_status,blog_category,sharing_activated', '101', 'after:nav_title');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','--div--;LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.blogauthor.title, red_status, --linebreak--,teaserOverview,forCategoryOverview,forCategoryOverviewTopPosition,overview_image,overview,sharing_activated', '102', 'after:nav_title');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','--div--;LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.teaser.title, intro, --linebreak--, teaserHome, --linebreak--, teaserOverview', '103', 'after:nav_title');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','--div--;LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.archive.title, red_status, --linebreak--,sharing_activated,targetgroup', '103', 'after:nav_title');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','--div--;LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.search.title,dkz_code_nrs,free_searchwords,ignored_searchwords,lesson', '1', 'after:sharing_activated');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','--div--;LLL:EXT:mrm_be/Resources/Private/Language/locallang_ttc.xlf:pages.security.title,security_user_pass');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','overview_image, event_category', '104', 'after:targetgroup');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette(
  'pages',
  'title',
  '--linebreak--, roof, use_roof_as_breadcrumb_text',
  'after:title'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette(
  'pages',
  'seo', 
  '--linebreak--, abstract, --linebreak--, keywords,',
  'after:seo_title'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette(
  'pages',
  'language',
  '--linebreak--, documentlanguage,',
  'after:l18n_cfg'
);
