Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在TYPO3 TCA类型内联中隐藏“创建新按钮”?_Typo3_Inline_Backend_Typo3 Tca - Fatal编程技术网

如何在TYPO3 TCA类型内联中隐藏“创建新按钮”?

如何在TYPO3 TCA类型内联中隐藏“创建新按钮”?,typo3,inline,backend,typo3-tca,Typo3,Inline,Backend,Typo3 Tca,我想隐藏“创建新”图像按钮,以防字段类型为内联的TCA 我的代码如下: <pre> 'image' => array( 'label' => 'Image', 'config' => array( 'type' => 'inline', 'foreign_table' => 'sys_file_reference', 'foreign_field' => 'uid_foreign',

我想隐藏“创建新”图像按钮,以防字段类型为内联的TCA

我的代码如下:

<pre>
'image' => array(
   'label' => 'Image',
   'config' => array(
        'type' => 'inline',
        'foreign_table' => 'sys_file_reference',
        'foreign_field' => 'uid_foreign',
        'foreign_sortby' => 'sorting_foreign',
        'foreign_table_field' => 'tablenames',
        'foreign_match_fields' => array(
          'fieldname' => 'field_slide_image',
        ),
        'foreign_label' => 'uid_local',
        'foreign_selector' => 'uid_local',
        'foreign_selector_fieldTcaOverride' => array(
          'config' => array(
            'appearance' => array(
              'elementBrowserType' => 'file',
              'elementBrowserAllowed' => $allowedFileExtensions
            )
          )
        ),
        'filter' => array(
          array(
            'userFunc' => 'TYPO3\\CMS\\Core\\Resource\\Filter\\FileExtensionFilter->filterInlineChildren',
            'parameters' => array(
              'allowedFileExtensions' => $allowedFileExtensions,
              'disallowedFileExtensions' => $disallowedFileExtensions
            )
          )
        ),
        'appearance' => array(

          'useSortable' => TRUE,
          'headerThumbnail' => array(
            'field' => 'uid_local',
            'width' => '45',
            'height' => '45c',
          ),
          'showPossibleLocalizationRecords' => FALSE,
          'showRemovedLocalizationRecords' => FALSE,
          'showSynchronizationLink' => FALSE,
          'showAllLocalizationLink' => FALSE,
          'showPossibleRecordsSelector' => "hide",

          'enabledControls' => array(
            'info' => FALSE,
           'new' => false,
            'dragdrop' => TRUE,
            'sort' => true,
            'hide' => TRUE,
            'delete' => TRUE,
            'localize' => TRUE,
          ),
        ),
        'behaviour' => array(
          'localizationMode' => 'select',
          'localizeChildrenAtParentLocalization' => TRUE,
        ),
    ),

)

</pre>

'image'=>数组(
“标签”=>“图像”,
'配置'=>数组(
'类型'=>'内联',
“外部\u表”=>“系统文件\u参考”,
“外部\u字段”=>“uid\u外部”,
“外部排序”=>“外部排序”,
“外来表字段”=>“表名”,
“外部匹配字段”=>数组(
'fieldname'=>'field\u slide\u image',
),
“外部标签”=>“uid\U本地”,
“外部\u选择器”=>“uid\u本地”,
“外部选择器\u字段覆盖”=>数组(
'配置'=>数组(
“外观”=>数组(
'elementBrowserType'=>'file',
'elementBrowserAllowed'=>$allowedFileExtensions
)
)
),
'过滤器'=>阵列(
排列(
'userFunc'=>'TYPO3\\CMS\\Core\\Resource\\Filter\\FileExtensionFilter->filterlinechildren',
“参数”=>数组(
“allowedFileExtensions”=>$allowedFileExtensions,
'disallowedFileExtensions'=>$disallowedFileExtensions
)
)
),
“外观”=>数组(
“useSortable”=>TRUE,
“headerThumbnail”=>数组(
'field'=>'uid\u local',
“宽度”=>“45”,
“高度”=>“45c”,
),
'showPossibleLocalizationRecords'=>FALSE,
“showRemovedLocalizationRecords”=>FALSE,
'showSynchronizationLink'=>FALSE,
'showAllLocalizationLink'=>FALSE,
'showPossibleRecordsSelector'=>“隐藏”,
“EnabledControl”=>数组(
'info'=>FALSE,
'new'=>false,
“dragdrop”=>正确,
'sort'=>true,
“隐藏”=>正确,
“删除”=>TRUE,
“本地化”=>正确,
),
),
“行为”=>数组(
“本地化模式”=>“选择”,
“localizeChildrenAtParentLocalization”=>TRUE,
),
),
)
我已经添加了这个代码'new'=>false,但它仍然不起作用

找到的解决方案:

我找到了一个解决办法


我希望这能对其他用户有所帮助。

好的,只有在设置并达到“maxitems”限制时,“new”按钮才会隐藏。

使用TYPO3权限系统,只允许对特定用户组的字段进行读取访问

使用隐藏TCA中的“新建”按钮 ['appearance']['EnabledControl']['new']=false

这仅适用于8.x。

找到的解决方案:

我找到了一个解决办法


谢谢你回答是,但我想隐藏该按钮,并将插入该图像(s)从前端只是我将显示在列表模块中,而不允许添加从那里“对不起,我也需要这个管理员,如果您有任何参考代码,请提供一些参考代码。如果您需要一个只读字段,您可以创建一个自定义TCA类型(在7.6和8.x中)。关于权限,该列需要在TCA中配置
exclude=>1
,然后您可以在后端组中配置权限,就像你可以为任何表格做的一样。谢谢你的回复,但我只需要隐藏“创建新”按钮,而不是整个字段,因为我想查看UserFunc插入的sysfile中的图像。我找到了一个解决方案,我希望这可以帮助其他用户。
// Render the level links (create new record):
if ($config['appearance']['enabledControls']['new']) {
> $levelLinks = $this->getLevelInteractionLink('newRecord', $nameObject . '-' . $foreign_table, $config);
}