本文整理汇总了PHP中TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToAllPalettesOfField方法的典型用法代码示例。如果您正苦于以下问题:PHP ExtensionManagementUtility::addFieldsToAllPalettesOfField方法的具体用法?PHP ExtensionManagementUtility::addFieldsToAllPalettesOfField怎么用?PHP ExtensionManagementUtility::addFieldsToAllPalettesOfField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\ExtensionManagementUtility
的用法示例。
在下文中一共展示了ExtensionManagementUtility::addFieldsToAllPalettesOfField方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addFieldsToAllPalettesOfFieldAddsNewPaletteIfFieldHasNoPaletteYetAndKeepsExistingLabel
/**
* @test
*/
public function addFieldsToAllPalettesOfFieldAddsNewPaletteIfFieldHasNoPaletteYetAndKeepsExistingLabel()
{
$GLOBALS['TCA'] = array('aTable' => array('columns' => array('fieldA' => array()), 'types' => array('typeA' => array('showitem' => 'fieldA;labelA'))));
$expected = array('aTable' => array('columns' => array('fieldA' => array()), 'types' => array('typeA' => array('showitem' => 'fieldA;labelA, --palette--;;generatedFor-fieldA')), 'palettes' => array('generatedFor-fieldA' => array('showitem' => 'newA'))));
ExtensionManagementUtility::addFieldsToAllPalettesOfField('aTable', 'fieldA', 'newA');
$this->assertEquals($expected, $GLOBALS['TCA']);
}
示例2: defined
<?php
defined('TYPO3_MODE') or die;
// Prepare new columns for fe_users table
$tempColumns = array('tx_openid_openid' => array('exclude' => 0, 'label' => 'LLL:EXT:openid/locallang_db.xlf:be_users.tx_openid_openid', 'config' => array('type' => 'input', 'size' => '30', 'eval' => 'trim,nospace,uniqueInPid', 'wizards' => array('0' => array('type' => 'popup', 'title' => 'Add OpenID', 'module' => array('name' => 'wizard_openid'), 'icon' => 'EXT:openid/ext_icon_small.png', 'JSopenParams' => ',width=800,height=600,status=0,menubar=0,scrollbars=0')))));
// Add new columns to fe_users table
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('fe_users', $tempColumns);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToAllPalettesOfField('fe_users', 'username', 'tx_openid_openid');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('fe_users', 'EXT:openid' . '/locallang_csh.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('_MOD_user_setup', 'EXT:openid/locallang_csh_mod.xlf');
示例3: canAddFieldsToAllPalettesOfFieldWithoutPaletteExistingBefore
/**
* Tests whether fields are added to a new palette that did not exist before.
*
* @test
* @see ExtensionManagementUtility::addFieldsToAllPalettesOfField()
*/
public function canAddFieldsToAllPalettesOfFieldWithoutPaletteExistingBefore()
{
$table = $this->getUniqueId('tx_coretest_table');
$GLOBALS['TCA'] = $this->generateTCAForTable($table);
ExtensionManagementUtility::addFieldsToAllPalettesOfField($table, 'fieldA', 'newA, newA, newB, fieldX');
$this->assertEquals('fieldX, fieldX1, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteA']['showitem']);
$this->assertEquals('fieldX, fieldX1, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteB']['showitem']);
$this->assertEquals('fieldX, fieldX1, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteC']['showitem']);
$this->assertEquals('fieldX, fieldX1, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteD']['showitem']);
$this->assertEquals('newA, newB, fieldX', $GLOBALS['TCA'][$table]['palettes']['generatedFor-fieldA']['showitem']);
}
示例4: canAddFieldsToAllPalettesOfFieldWithoutPaletteExistingBefore
/**
* Tests whether fields are added to a new palette that did not exist before.
*
* @test
* @see ExtensionManagementUtility::addFieldsToAllPalettesOfField()
*/
public function canAddFieldsToAllPalettesOfFieldWithoutPaletteExistingBefore() {
$table = $this->getUniqueId('tx_coretest_table');
$GLOBALS['TCA'] = $this->generateTCAForTable($table);
ExtensionManagementUtility::addFieldsToAllPalettesOfField($table, 'fieldA', 'newA, newA, newB, fieldX');
// is palette reference added
$this->assertSame('fieldA;;generatedFor-fieldA, fieldB, fieldC;labelC;paletteC;specialC, fieldC1, fieldD, fieldD1', $GLOBALS['TCA'][$table]['types']['typeA']['showitem']);
$this->assertEquals('fieldX, fieldX1, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteA']['showitem']);
$this->assertEquals('fieldX, fieldX1, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteB']['showitem']);
$this->assertEquals('fieldX, fieldX1, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteC']['showitem']);
$this->assertEquals('fieldX, fieldX1, fieldY', $GLOBALS['TCA'][$table]['palettes']['paletteD']['showitem']);
$this->assertEquals('newA, newB, fieldX', $GLOBALS['TCA'][$table]['palettes']['generatedFor-fieldA']['showitem']);
}