Skip to content

Instantly share code, notes, and snippets.

@mneuhaus
Created July 9, 2015 07:57
Show Gist options
  • Save mneuhaus/950afdc120223cf5c204 to your computer and use it in GitHub Desktop.
Save mneuhaus/950afdc120223cf5c204 to your computer and use it in GitHub Desktop.
<?php
if (!isset($GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['type'])) {
if (file_exists($GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['dynamicConfigFile'])) {
require_once($GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['dynamicConfigFile']);
}
// no type field defined, so we define it here. This will only happen the first time the extension is installed!!
$GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['type'] = 'tx_extbase_type';
$tempColumnstx_mfshvcore_tx_famelolocation_domain_model_location = array();
$tempColumnstx_mfshvcore_tx_famelolocation_domain_model_location[$GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['type']] = array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore.tx_extbase_type',
'config' => array(
'type' => 'select',
'items' => array(
array('Location','Tx_Mfshvcore_Location')
),
'default' => 'Tx_Mfshvcore_Location',
'size' => 1,
'maxitems' => 1,
)
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tx_famelolocation_domain_model_location', $tempColumnstx_mfshvcore_tx_famelolocation_domain_model_location, 1);
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'tx_famelolocation_domain_model_location',
$GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['type'],
'',
'after:' . $GLOBALS['TCA']['tx_famelolocation_domain_model_location']['ctrl']['label']
);
$tmp_mfshvcore_columns = array(
'og' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.og',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'lg' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.lg',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'member_count' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.member_count',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'monday_from' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.monday_from',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'monday_to' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.monday_to',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'tuesday_from' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.tuesday_from',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'tuesday_to' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.tuesday_to',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'wednesday_from' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.wednesday_from',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'wednesday_to' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.wednesday_to',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'thursday_from' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.thursday_from',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'thursday_to' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.thursday_to',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'friday_from' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.friday_from',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'friday_to' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.friday_to',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'saturday_from' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.saturday_from',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'saturday_to' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.saturday_to',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'sunday_from' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.sunday_from',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'sunday_to' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mfshvcore/Resources/Private/Language/locallang_db.xlf:tx_mfshvcore_domain_model_location.sunday_to',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tx_famelolocation_domain_model_location', $tmp_mfshvcore_columns);
/* inherit and extend the show items from the parent class */
if(isset($GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types']['1']['showitem'])) {
$GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types']['Tx_Mfshvcore_Location']['showitem'] = $GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types']['1']['showitem'];
} elseif(is_array($GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types'])) {
// use first entry in types array
$tx_famelolocation_domain_model_location_type_definition = reset($GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types']);
$GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types']['Tx_Mfshvcore_Location']['showitem'] = $tx_famelolocation_domain_model_location_type_definition['showitem'];
} else {
$GLOBALS['TCA']['tx_famelolocation_domain_model_location']['types']['Tx_Mfshvcore_Location']['showitem'] = '';
}
$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,';
$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';
$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');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
'',
'EXT:/Resources/Private/Language/locallang_csh_.xlf'
);## EXTENSION BUILDER DEFAULTS END TOKEN - Everything BEFORE this line is overwritten with the defaults of the extension builder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment