我正在尝试创建一个扩展来修改不同扩展中的字段。 我的扩展需要通过TSConfig页面在fe_users中添加和禁用字段。
我看过谷歌如何使用自己的扩展来做到这一点。 但我没有找到任何有用的东西,我可以使用。
(已编辑 )
管理员应该无法看到这些字段:
公司 名称 中间名字 地址 邮政编码 土地 电话 传真 万维网 图片 TSConfig 绑定域名 登录后重定向 开始 停止 记录类型应添加这些字段
客户(INT,无法在显示屏上编辑)Manditory swissaxis_id(INT,唯一编号),如果可能,只能显示,不能编辑 shop_rights(Textarea,没有定义的值。权利将被保存在那里序列化。)fe_groups
这些字段不应显示给任何管理员
绑定域名 TSConfig 登录后重定向 记录类型我很感谢任何可能的反馈。
I'm trying to create a extension to modify fields in a different extension. My extension needs to add and disable fields in fe_users over the TSConfig Page.
Ive looked over google how to do this with a own extension. But I didn't find anything usefull that I could work with.
(Edited)
The admin shouldn't be able to see these fields:
Company Name Middle name Address Zipcode Land Phone Fax www Image TSConfig Bind a Domain Redirect after login Start Stop Record TypeThese fields should be added
Customer (INT, not able to edit on display) Manditory swissaxis_id (INT, Unique number) if possible only displayable and not editing possibility shop_rights (Textarea, No defined Value. The Rights will be saved there serialised.)fe_groups
These fields shouldn't be displayed to any Admin
Bind a domain TSConfig Redirect after login Record TypeI'm thankfull for any Feedback possible.
最满意答案
以下是有关如何向fe_users添加新字段的fe_users : https : fe_users https://docs.typo3.org/typo3cms/TCAReference/ExtendingTca/Examples/Index html的
我将从一个旧的临时扩展zusatzfelder中给你一个例子来修改“pages”表。 它真的很旧,请验证一切是否是最新的。 您还可以查看任何其他“真实”扩展...
ext_emconf.php(可能由extension_builder创建)
<?php ######################################################################## # Extension Manager/Repository config file for ext "zusatzfelder". # # Auto generated 29-08-2011 15:33 # # Manual updates: # Only the data in the array - everything else is removed by next # writing. "version" and "dependencies" must not be touched! ######################################################################## $EM_CONF[$_EXTKEY] = array( 'title' => 'Zusatzfelder', 'description' => '', 'category' => '', 'author' => '', 'author_email' => '', 'shy' => '', 'dependencies' => '', 'conflicts' => '', 'priority' => '', 'module' => '', 'state' => '', 'internal' => '', 'uploadfolder' => 0, 'createDirs' => '', 'modify_tables' => '', 'clearCacheOnLoad' => 0, 'lockType' => '', 'author_company' => '', 'version' => '0.0.0', 'constraints' => array( 'depends' => array( ), 'conflicts' => array( ), 'suggests' => array( ), ), '_md5_values_when_last_written' => 'a:8:{s:9:"ChangeLog";s:4:"5b94";s:10:"README.txt";s:4:"ee2d";s:12:"ext_icon.gif";s:4:"1bdc";s:14:"ext_tables.php";s:4:"474a";s:14:"ext_tables.sql";s:4:"ead9";s:16:"locallang_db.xml";s:4:"7a92";s:19:"doc/wizard_form.dat";s:4:"0cba";s:20:"doc/wizard_form.html";s:4:"29e8";}', ); ?>ext_tables.sql
CREATE TABLE pages ( tx_zusatzfelder_contentnav_title_addition tinytext, tx_zusatzfelder_contentnav_title tinytext, tx_zusatzfelder_contentnav_disable int(11) DEFAULT '0' NOT NULL, );ext_tables.php
<?php if (!defined('TYPO3_MODE')) { die ('Access denied.'); } $tempColumns = array ( 'tx_zusatzfelder_contentnav_title' => array ( 'exclude' => 0, 'label' => 'LLL:EXT:zusatzfelder/locallang_db.xml:pages.tx_zusatzfelder_contentnav_title', 'config' => array ( 'type' => 'input', 'size' => '30', ) ), 'tx_zusatzfelder_contentnav_title_addition' => array ( 'exclude' => 0, 'label' => 'LLL:EXT:zusatzfelder/locallang_db.xml:pages.tx_zusatzfelder_contentnav_title_addition', 'config' => array ( 'type' => 'input', 'size' => '30', ) ), 'tx_zusatzfelder_contentnav_disable' => array ( 'exclude' => 0, 'label' => 'LLL:EXT:zusatzfelder/locallang_db.xml:pages.tx_zusatzfelder_contentnav_disable', 'config' => array ( 'type' => 'check', 'default' => '0', ) ), ); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages',$tempColumns,1); // http://typo3-blog.net/tutorials/news/addtoalltcatypes.html // PS: the "after:"... is for placement in the BE, stopped working last week... \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','tx_zusatzfelder_contentnav_title;;;;1-1-1','','after:subtitle'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','tx_zusatzfelder_contentnav_title_addition;;;;1-1-1','','after:subtitle'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','tx_zusatzfelder_contentnav_disable;;;;1-1-1','','after:subtitle'); ?>locallang_db.xml
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <T3locallang> <meta type="array"> <type>database</type> <description>Language labels for database tables/fields belonging to extension 'zusatzfelder'</description> </meta> <data type="array"> <languageKey index="default" type="array"> <label index="pages.tx_zusatzfelder_contentnav_title_addition">Untermenu: Vorlauf Titel (zB. "Mehr zur")</label> <label index="pages.tx_zusatzfelder_contentnav_title">Untermenu: Titellink anderer Text (Standard: Seitentitel; Leerschlag: kein Titel)</label> <label index="pages.tx_zusatzfelder_contentnav_disable">Untermenu ausblenden</label> </languageKey> </data> </T3locallang>这就是你需要添加新字段的所有内容 - 如果你更喜欢在ext_tables.php中做'label' => 'My untranslated Label',你甚至不需要locallang。
Here's a link on how you add new fields to fe_users: https://docs.typo3.org/typo3cms/TCAReference/ExtendingTca/Index.html https://docs.typo3.org/typo3cms/TCAReference/ExtendingTca/Examples/Index.html
I'll give you an example from an old, makeshift extension zusatzfelder of mine that modifies the "pages" table. It's really old, please verify if everything is current. You can also look at any other, "real" extension...
ext_emconf.php (maybe created by extension_builder)
<?php ######################################################################## # Extension Manager/Repository config file for ext "zusatzfelder". # # Auto generated 29-08-2011 15:33 # # Manual updates: # Only the data in the array - everything else is removed by next # writing. "version" and "dependencies" must not be touched! ######################################################################## $EM_CONF[$_EXTKEY] = array( 'title' => 'Zusatzfelder', 'description' => '', 'category' => '', 'author' => '', 'author_email' => '', 'shy' => '', 'dependencies' => '', 'conflicts' => '', 'priority' => '', 'module' => '', 'state' => '', 'internal' => '', 'uploadfolder' => 0, 'createDirs' => '', 'modify_tables' => '', 'clearCacheOnLoad' => 0, 'lockType' => '', 'author_company' => '', 'version' => '0.0.0', 'constraints' => array( 'depends' => array( ), 'conflicts' => array( ), 'suggests' => array( ), ), '_md5_values_when_last_written' => 'a:8:{s:9:"ChangeLog";s:4:"5b94";s:10:"README.txt";s:4:"ee2d";s:12:"ext_icon.gif";s:4:"1bdc";s:14:"ext_tables.php";s:4:"474a";s:14:"ext_tables.sql";s:4:"ead9";s:16:"locallang_db.xml";s:4:"7a92";s:19:"doc/wizard_form.dat";s:4:"0cba";s:20:"doc/wizard_form.html";s:4:"29e8";}', ); ?>ext_tables.sql
CREATE TABLE pages ( tx_zusatzfelder_contentnav_title_addition tinytext, tx_zusatzfelder_contentnav_title tinytext, tx_zusatzfelder_contentnav_disable int(11) DEFAULT '0' NOT NULL, );ext_tables.php
<?php if (!defined('TYPO3_MODE')) { die ('Access denied.'); } $tempColumns = array ( 'tx_zusatzfelder_contentnav_title' => array ( 'exclude' => 0, 'label' => 'LLL:EXT:zusatzfelder/locallang_db.xml:pages.tx_zusatzfelder_contentnav_title', 'config' => array ( 'type' => 'input', 'size' => '30', ) ), 'tx_zusatzfelder_contentnav_title_addition' => array ( 'exclude' => 0, 'label' => 'LLL:EXT:zusatzfelder/locallang_db.xml:pages.tx_zusatzfelder_contentnav_title_addition', 'config' => array ( 'type' => 'input', 'size' => '30', ) ), 'tx_zusatzfelder_contentnav_disable' => array ( 'exclude' => 0, 'label' => 'LLL:EXT:zusatzfelder/locallang_db.xml:pages.tx_zusatzfelder_contentnav_disable', 'config' => array ( 'type' => 'check', 'default' => '0', ) ), ); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages',$tempColumns,1); // http://typo3-blog.net/tutorials/news/addtoalltcatypes.html // PS: the "after:"... is for placement in the BE, stopped working last week... \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','tx_zusatzfelder_contentnav_title;;;;1-1-1','','after:subtitle'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','tx_zusatzfelder_contentnav_title_addition;;;;1-1-1','','after:subtitle'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','tx_zusatzfelder_contentnav_disable;;;;1-1-1','','after:subtitle'); ?>locallang_db.xml
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <T3locallang> <meta type="array"> <type>database</type> <description>Language labels for database tables/fields belonging to extension 'zusatzfelder'</description> </meta> <data type="array"> <languageKey index="default" type="array"> <label index="pages.tx_zusatzfelder_contentnav_title_addition">Untermenu: Vorlauf Titel (zB. "Mehr zur")</label> <label index="pages.tx_zusatzfelder_contentnav_title">Untermenu: Titellink anderer Text (Standard: Seitentitel; Leerschlag: kein Titel)</label> <label index="pages.tx_zusatzfelder_contentnav_disable">Untermenu ausblenden</label> </languageKey> </data> </T3locallang>That's all you need to add new fields – you don't even need the locallang if you just prefer to do 'label' => 'My untranslated Label', in ext_tables.php.
更多推荐
发布评论