我目前正在对使用t3blog扩展项目。在后端,创建一个新的职位时,你先输入一个标题,然后你必须点击“创建新的”添加内容的帖子。

理想地,客户端想要删除“创建新的”,或者至少有它由缺省创建新的内容片段。

我挖通过扩展的TCA,我发现它补充说,控制,现在我有点坚持,因为我还没有在TCA之前遭到黑客攻击,没有人知道如何修改的行为“经由TCA内联”类型?

下面是添加控制的代码。

'content' => Array (
        'exclude' => 1,
        'label' => 'LLL:EXT:t3blog/locallang_db.xml:tx_t3blog_post.content',
        'config' => array (
            'type' => 'inline',
            'foreign_table' => 'tt_content',
            'foreign_field' => 'irre_parentid',
            'foreign_table_field' => 'irre_parenttable',
            'maxitems' => 100,
            'appearance' => array(
                'showSynchronizationLink' => 0,
                'showAllLocalizationLink' => 0,
                'showPossibleLocalizationRecords' => 0,
                'showRemovedLocalizationRecords' => 0,
                'expandSingle' => 1
            ),
            'behaviour' => array(
            ),
        )

    ),

我想要做的就是删除所创建的“常规”标签,只是有“文本”选项卡。

任何提示将非常理解的。

有帮助吗?

解决方案 2

勉强挠头长会议后,昨天这个修复,方法如下:

修改了TCA这样:

    'content' => Array (
        'exclude' => 1,
        'label' => 'LLL:EXT:t3blog/locallang_db.xml:tx_t3blog_post.content',
        'config' => array (
            'type' => 'inline',
            'foreign_table' => 'tt_content',
            'foreign_field' => 'irre_parentid',
            'foreign_table_field' => 'irre_parenttable',
            'maxitems' => 100,
            'appearance' => array(
                'showSynchronizationLink' => 0,
                'showAllLocalizationLink' => 0,
                'showPossibleLocalizationRecords' => 0,
                'showRemovedLocalizationRecords' => 0,
                'expandSingle' => 1,
                'collapseAll' => 0
            ),
            'behaviour' => array(
            ),
            't3blog' => true
        )

    )

然后创建新的空的延伸。内的ext目录,创建ext_tables.php具有以下内容:

<?php
$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tceforms_inline.php'] = t3lib_extMgm::extPath($_EXTKEY).'ux_inline.php';

和内部ux_inline.php:

<?php
class ux_t3lib_TCEforms_inline extends t3lib_TCEforms_inline
{
    public function renderForeignRecordHeader($parentUid, $foreign_table, $rec, $config, $isVirtualRecord = false)
    {
        if(isset($config['t3blog']) && $config['t3blog'])
        {
            $GLOBALS['TCA']['tt_content']['types']['text']['showitem'] = 'bodytext;;9;richtext:rte_transform[flag=rte_enabled|mode=ts_css];3-3-3';
            $GLOBALS['TCA']['tt_content']['columns']['CType']['exclude'] = 1;
            $GLOBALS['TCA']['tt_content']['columns']['header']['exclude'] = 1;

            return;
        }
        else
        {
            return parent::renderForeignRecordHeader($parentUid, $foreign_table, $rec, $config, $isVirtualRecord);
        }
    }

    public function getExpandedCollapsedState($table, $uid)
    {
        if(isset($_REQUEST['edit']['tx_t3blog_post']))
            return true;
        else
            return parent::getExpandedCollapsedState($table, $uid);
    }

    public function getLevelInteractionLink($type, $objectPrefix, $conf=array())
    {
            if(!isset($conf['t3blog']) || !$conf['t3blog'])
            {
                return parent::getLevelInteractionLink($type, $objectPrefix, $conf);
            }
            else
    {
        if((int) $conf['inline']['first'] > 0)
            return;
    }

    $nameObject = $this->inlineNames['object'];
    $attributes = array();
    switch($type) {
        case 'newRecord':
            $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:cm.createnew', 1);
            $iconFile = 'gfx/new_el.gif';
            // $iconAddon = 'width="11" height="12"';
            $className = 'typo3-newRecordLink';
            $attributes['class'] = 'inlineNewButton '.$this->inlineData['config'][$nameObject]['md5'];
            $attributes['onclick'] = "return inline.createNewRecord('$objectPrefix')";
            $attributes['style'] = "display: none;";
            if (isset($conf['inline']['inlineNewButtonStyle']) && $conf['inline']['inlineNewButtonStyle']) {
                $attributes['style'] = $conf['inline']['inlineNewButtonStyle'];
            }
            if (isset($conf['appearance']['newRecordLinkAddTitle']) && $conf['appearance']['newRecordLinkAddTitle']) {
                $titleAddon = ' '.$GLOBALS['LANG']->sL($GLOBALS['TCA'][$conf['foreign_table']]['ctrl']['title'], 1);
            }
            $icon = ($iconFile ? '<img'.t3lib_iconWorks::skinImg($this->backPath, $iconFile, $iconAddon).' alt="'.htmlspecialchars($title.$titleAddon).'" />' : '');
            $link = $this->wrapWithAnchor($icon.$title.$titleAddon, '#', $attributes);
            return '<div'.($className ? ' class="'.$className.'"' : '').'>'.$link.'</div>';
            break;
        case 'localize':
            $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.xml:localizeAllRecords', 1);
            $iconFile = 'gfx/localize_el.gif';
            $className = 'typo3-localizationLink';
            $attributes['onclick'] = "return inline.synchronizeLocalizeRecords('$objectPrefix', 'localize')";
            break;
        case 'synchronize':
            $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.xml:synchronizeWithOriginalLanguage', 1);
            $iconFile = 'gfx/synchronize_el.gif';
            $className = 'typo3-synchronizationLink';
            $attributes['class'] = 'inlineNewButton '.$this->inlineData['config'][$nameObject]['md5'];
            $attributes['onclick'] = "return inline.synchronizeLocalizeRecords('$objectPrefix', 'synchronize')";
            break;
    }
        // Create the link:

    }
}

希望这会帮助别人,将来别人。

其他提示

我的理解是这种类型的“内联”指的是一种叫做“ IRRE ”或内联关系记录编辑,在TCA一个相对较新和强大的(由TYPO3标准)的数据结构。您可能会发现本节作为参考有用TYPO3核心API 文档。

因为它是,点击执行Ajax调用在后台创建一个新的数据库记录。然而,从我所看到的(用这个和其他插件,如Powermail),我怀疑有一种方法跳过额外的点击,而不做一些严重的黑客攻击/延长T3核心本身。对不起,我不能更多的帮助,而只是碰到这种近日来,我自己。但愿还有谁曾尝试上的其他TYPO3黑客...

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top