0

我是typo3 扩展开发的新手,我想在 ext_table.php 中获取typoscript 值。实现这个有什么好的价值吗?这是我的 ext_tables.php 文件。我想在这里获取打字稿值。`

    <?php
    if (!defined('TYPO3_MODE')) {
    die ('Access denied.');
   }

    // get extension confArr
    $confArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['pits_documents']);

$tempColumns = array (
    'tx_pitsdocuments_languages' => array (     
        'exclude' => 0,     
        'label' => 'LLL:EXT:pits_documents/locallang_db.xml:tx_dam.tx_pitsdocuments_languages',     
        'config' => array (
            'type' => 'select',
                'foreign_table' => 'tx_dam_cat',    
            'foreign_table_where' => ' AND tx_dam_cat.parent_id='.$confArr['langcat'].' AND tx_dam_cat.sys_language_uid=0 ORDER BY tx_dam_cat.uid', 
            'size' => 5,    
            'minitems' => 0,
            'maxitems' => 99,   
            'wizards' => array(
                '_PADDING'  => 2,
                '_VERTICAL' => 1,
                'list' => array(
                    'type'   => 'script',
                    'title'  => 'List',
                    'icon'   => 'list.gif',
                    'params' => array(
                        'table' => 'tx_dam_cat',
                        'pid'   => '###CURRENT_PID###',
                    ),
                    'script' => 'wizard_list.php',
                ),
            ),
        )
    ),
    'tx_pitsdocuments_supplier' => array (      
        'exclude' => 0,     
        'label' => 'LLL:EXT:pits_documents/locallang_db.xml:tx_dam.tx_pitsdocuments_supplier',      
        'config' => array (
            'type' => 'select',
      'foreign_table' => 'tx_dam_cat',  
            'foreign_table_where' => ' AND tx_dam_cat.parent_id='.$confArr['supplycat'].' AND tx_dam_cat.sys_language_uid=0 ORDER BY tx_dam_cat.uid',   
            'size' => 8,    
            'minitems' => 0,
            'maxitems' => 1,    
            'wizards' => array(
                '_PADDING'  => 2,
                '_VERTICAL' => 1,
                'list' => array(
                    'type'   => 'script',
                    'title'  => 'List',
                    'icon'   => 'list.gif',
                    'params' => array(
                        'table' => 'tx_dam_cat',
                        'pid'   => '###CURRENT_PID###',
                    ),
                    'script' => 'wizard_list.php',
                ),
            ),
        )
    ),
    'tx_pitsdocuments_businessunit' => array (      
        'exclude' => 0,     
        'label' => 'LLL:EXT:pits_documents/locallang_db.xml:tx_dam.tx_pitsdocuments_businessunit',      
        'config' => array (
            'type' => 'select',
      /* 'items' => array (
                array('',0),
            ), */   
            'foreign_table' => 'tx_dam_cat',    
            'foreign_table_where' => ' AND tx_dam_cat.parent_id='.$confArr['businesscat'].' AND tx_dam_cat.sys_language_uid=0 ORDER BY tx_dam_cat.uid', 
            'size' => 8,    
            'minitems' => 0,
            'maxitems' => 1,    
            'wizards' => array(
                '_PADDING'  => 2,
                '_VERTICAL' => 1,
                'list' => array(
                    'type'   => 'script',
                    'title'  => 'List',
                    'icon'   => 'list.gif',
                    'params' => array(
                        'table' => 'tx_dam_cat',
                        'pid'   => '###CURRENT_PID###',
                    ),
                    'script' => 'wizard_list.php',
                ),
            ),
        )
    ),
    'tx_pitsdocuments_foldertype' => array (        
        'exclude' => 0,     
        'label' => 'LLL:EXT:pits_documents/locallang_db.xml:tx_dam.tx_pitsdocuments_foldertype',        
        'config' => array (
            'type' => 'check',
            'cols' => 4,
            'items' => array (
                array('LLL:EXT:pits_documents/locallang_db.xml:tx_dam.tx_pitsdocuments_foldertype.I.0', '1'),
                array('LLL:EXT:pits_documents/locallang_db.xml:tx_dam.tx_pitsdocuments_foldertype.I.1', '2'),
                array('LLL:EXT:pits_documents/locallang_db.xml:tx_dam.tx_pitsdocuments_foldertype.I.2', '3'),
            ),
        )
    ),
    'tx_pitsdocuments_doctypes' => array (      
        'exclude' => 0,     
        'label' => 'LLL:EXT:pits_documents/locallang_db.xml:tx_dam.tx_pitsdocuments_doctypes',      
        'config' => array (
            'type' => 'select',
      /* 'items' => array (
                array('',0),
            ), */   
            'foreign_table' => 'tx_dam_cat',    
            'foreign_table_where' => ' AND tx_dam_cat.parent_id='.$confArr['doctypecat'].' AND tx_dam_cat.sys_language_uid=0 ORDER BY tx_dam_cat.uid',  
            'size' => 8,    
            'minitems' => 0,
            'maxitems' => 1,    
            'wizards' => array(
                '_PADDING'  => 2,
                '_VERTICAL' => 1,
                'list' => array(
                    'type'   => 'script',
                    'title'  => 'List',
                    'icon'   => 'list.gif',
                    'params' => array(
                        'table' => 'tx_dam_cat',
                        'pid'   => '###CURRENT_PID###',
                    ),
                    'script' => 'wizard_list.php',
                ),
            ),
        )
    ),
);


t3lib_div::loadTCA('tx_dam');
t3lib_extMgm::addTCAcolumns('tx_dam',$tempColumns,1);
t3lib_extMgm::addToAllTCAtypes('tx_dam','--div--;LLL:EXT:pits_documents/locallang_db.xml:tx_dam.div_overview,tx_pitsdocuments_foldertype;;;;1-1-1, tx_pitsdocuments_languages, tx_pitsdocuments_supplier, tx_pitsdocuments_businessunit, tx_pitsdocuments_doctypes');

$tempColumnscat = array (
      'global_id' => array(
            'l10n_mode' => 'exclude',
            'l10n_display' => 'defaultAsReadonly',
            'label' => 'LLL:EXT:pits_documents/locallang_db.xml:tx_dam_cat.global_id',
            'config' => $GLOBALS['T3_VAR']['ext']['dam']['TCA']['category_config'],
        ),
);


t3lib_div::loadTCA('tx_dam_cat');
t3lib_extMgm::addTCAcolumns('tx_dam_cat',$tempColumnscat,1);
t3lib_extMgm::addToAllTCAtypes('tx_dam_cat','global_id','','after:parent_id');


t3lib_extMgm::addPlugin(array(
    'LLL:EXT:pits_documents/locallang_db.xml:tt_content.list_type_pi1',
    $_EXTKEY . '_pi1',
    t3lib_extMgm::extRelPath($_EXTKEY) . 'ext_icon.gif'
),'list_type');

?>
`
4

1 回答 1

1

在向导中,您应该能够获取已编辑页面的 id($this-id ?查看API)。您不需要将其作为配置中的参数发送。

您可以在 foreign_table_where 中使用标记,但不能在向导本身中使用标记 - 查看TCA

于 2012-08-27T07:12:14.927 回答