Exemple #1
0
 /**
  * Adds a new token configuration to this registry.
  * TCA changes are directly applied
  *
  * @param string $extensionKey Extension key to be used
  * @param string $tableName Name of the table to be registered
  * @param string $tokenField Name of the field to be registered
  * @param array $options Additional configuration options
  *              + fieldList: field configuration to be added to showitems
  *              + typesList: list of types that shall visualize the token field
  *              + position: insert position of the token field
  *              + label: backend label of the token field
  *              + fieldConfiguration: TCA field config array to override defaults
  * @return bool
  */
 public function add($extensionKey, $tableName, $tokenField = 'token', array $options = [])
 {
     $didRegister = FALSE;
     if (empty($tableName) || !is_string($tableName)) {
         throw new \InvalidArgumentException('No or invalid table name "' . $tableName . '" given.', 1369122038);
     }
     if (!$this->isRegistered($tableName, $tokenField)) {
         $this->registry[$tableName][$tokenField] = $options;
         $this->extensions[$extensionKey][$tableName]['tokenField'][$tokenField] = $tokenField;
         if (!isset($GLOBALS['TCA'][$tableName]['columns']) && isset($GLOBALS['TCA'][$tableName]['ctrl']['dynamicConfigFile'])) {
             // Handle deprecated old style dynamic TCA column loading.
             ExtensionManagementUtility::loadNewTcaColumnsConfigFiles();
         }
         if (isset($GLOBALS['TCA'][$tableName]['columns'])) {
             $this->applyTcaForTableAndField($tableName, $tokenField);
             $didRegister = TRUE;
         }
     }
     return $didRegister;
 }
 /**
  * @test
  */
 public function loadNewTcaColumnsConfigFilesDoesNotIncludeFileIfColumnsExist()
 {
     $GLOBALS['TCA'] = array('test' => array('ctrl' => array('dynamicConfigFile' => __DIR__ . '/Fixtures/RuntimeException.php'), 'columns' => array('foo' => 'bar')));
     ExtensionManagementUtility::loadNewTcaColumnsConfigFiles();
 }
if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
if (TYPO3_MODE === 'BE') {
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction('web_func', 'TYPO3\\CMS\\WizardSortpages\\View\\SortPagesWizardModuleFunction', NULL, 'LLL:EXT:wizard_sortpages/locallang.xlf:wiz_sort', 'wiz');
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('_MOD_web_func', 'EXT:wizard_sortpages/locallang_csh.xlf');
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadNewTcaColumnsConfigFiles();
/**
 * Extension: go_maps_ext
 * File: C:/xampp/htdocs/typo3_6.2.14/typo3conf/ext/go_maps_ext/ext_tables.php
 */
$_EXTKEY = 'go_maps_ext';
$_EXTCONF = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY];
if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin('Clickstorm.' . $_EXTKEY, 'Show', 'Google Map');
$pluginSignature = str_replace('_', '', $_EXTKEY) . '_show';
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature] = 'code,layout,select_key,pages,recursive';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_show.xml');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'Google Maps API Extbase');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_gomapsext_domain_model_address', 'EXT:go_maps_ext/Resources/Private/Language/locallang_csh_tx_gomapsext_domain_model_address.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_gomapsext_domain_model_address');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_gomapsext_domain_model_map', 'EXT:go_maps_ext/Resources/Private/Language/locallang_csh_tx_gomapsext_domain_model_map.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_gomapsext_domain_model_map');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_gomapsext_domain_model_category', 'EXT:go_maps_ext/Resources/Private/Language/locallang_csh_tx_gomapsext_domain_model_category.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_gomapsext_domain_model_category');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadNewTcaColumnsConfigFiles();
#
 /**
  *
  */
 public function testEleminateNonTcaColumnsByTable()
 {
     if (tx_rnbase_util_TYPO3::isTYPO60OrHigher()) {
         \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadNewTcaColumnsConfigFiles();
     }
     $data = array('blacklisted' => true, 'whitelisted' => 0, 'ich-muss-raus' => true, 'ich-auch' => false);
     $res = tx_mklib_util_TCA::eleminateNonTcaColumnsByTable('tx_mklib_wordlist', $data);
     $this->assertEquals(2, count($res), 'falsche array größe');
     $this->assertTrue($res['blacklisted'], 'blacklsited Feld ist nicht korrekt!');
     $this->assertEquals(0, $res['whitelisted'], 'whitelisted Feld ist nicht korrekt!');
     $this->assertFalse(isset($res['ich-muss-raus']), 'ich-muss-raus Feld wurde nicht entfernt!');
     $this->assertFalse(isset($res['ich-auch']), 'ich-auch Feld wurde nicht entfernt!');
 }
Exemple #5
0
 /**
  * Adds a new category configuration to this registry.
  * TCA changes are directly applied
  *
  * @param string $extensionKey Extension key to be used
  * @param string $tableName Name of the table to be registered
  * @param string $fieldName Name of the field to be registered
  * @param array $options Additional configuration options
  *              + fieldList: field configuration to be added to showitems
  *              + typesList: list of types that shall visualize the categories field
  *              + position: insert position of the categories field
  *              + label: backend label of the categories field
  *              + fieldConfiguration: TCA field config array to override defaults
  * @param bool $override If TRUE, any category configuration for the same table / field is removed before the new configuration is added
  * @return bool
  * @throws \InvalidArgumentException
  * @throws \RuntimeException
  */
 public function add($extensionKey, $tableName, $fieldName = 'categories', array $options = array(), $override = false)
 {
     $didRegister = false;
     if (empty($tableName) || !is_string($tableName)) {
         throw new \InvalidArgumentException('No or invalid table name "' . $tableName . '" given.', 1369122038);
     }
     if (empty($extensionKey) || !is_string($extensionKey)) {
         throw new \InvalidArgumentException('No or invalid extension key "' . $extensionKey . '" given.', 1397836158);
     }
     if ($override) {
         $this->remove($tableName, $fieldName);
     }
     if (!$this->isRegistered($tableName, $fieldName)) {
         $this->registry[$tableName][$fieldName] = $options;
         $this->extensions[$extensionKey][$tableName][$fieldName] = $fieldName;
         if (!isset($GLOBALS['TCA'][$tableName]['columns']) && isset($GLOBALS['TCA'][$tableName]['ctrl']['dynamicConfigFile'])) {
             // Handle deprecated old style dynamic TCA column loading.
             ExtensionManagementUtility::loadNewTcaColumnsConfigFiles();
         }
         if (isset($GLOBALS['TCA'][$tableName]['columns'])) {
             $this->applyTcaForTableAndField($tableName, $fieldName);
             $didRegister = true;
         }
     }
     return $didRegister;
 }
 /**
  * Loads ext_tables.php for a single extension. Method is a modified copy of
  * the original bootstrap method.
  *
  * @param string $extensionKey
  * @param \ArrayAccess $extension
  * @return void
  */
 protected function loadExtTablesForExtension($extensionKey, array $extension)
 {
     // In general it is recommended to not rely on it to be globally defined in that
     // scope, but we can not prohibit this without breaking backwards compatibility
     global $T3_SERVICES, $T3_VAR, $TYPO3_CONF_VARS;
     global $TBE_MODULES, $TBE_MODULES_EXT, $TCA;
     global $PAGES_TYPES, $TBE_STYLES, $FILEICONS;
     global $_EXTKEY;
     // Load each ext_tables.php file of loaded extensions
     $_EXTKEY = $extensionKey;
     if (isset($extension['ext_tables.php']) && $extension['ext_tables.php']) {
         // $_EXTKEY and $_EXTCONF are available in ext_tables.php
         // and are explicitly set in cached file as well
         $_EXTCONF = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY];
         require $extension['ext_tables.php'];
         Utility\ExtensionManagementUtility::loadNewTcaColumnsConfigFiles();
     }
 }