定制 rfuehricht/recordmodules 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rfuehricht/recordmodules

最新稳定版本:1.2.1

Composer 安装命令:

composer require rfuehricht/recordmodules

包简介

Adds backend modules for configured record types.

README 文档

README

This extension makes it possible to configure backend modules for some type of records. Editors do not have to switch to module "List" and search for the correct sys folder to find the records.

Example of modules

Example of a custom module

How to configure

Configuration in database records overrides settings in TCA.

After creating a configuration record or any change in the configuration, the system caches must be cleared and the backend must be reloaded.

Via TCA

In your site package, use TCA overrides to activate a custom module for a record type.

Configuration/TCA/Overrides/sys_category.php

$GLOBALS['TCA']['sys_category']['ctrl']['recordModule'] = [
    'activate' => true,
    'pids' => 1,
    'parent' => 'web',
    'sorting' => 12,
    'title' => 'LLL:EXT:site_package/Resources/Private/locallang.xlf:myTitle',
    'icon' => 'EXT:site_package/Resources/Public/Icons/my_icon.svg',
    'iconIdentifier' => 'my-ext-my-icon'
];

parent is optional and specifies where to put the module. Default is a new custom module group "Records".

pids is optional and can be a comma separated string of page ids, a single id or an array of ids. If set, the module will only list records of these page ids (if the current user has access). if not set, the module will show the normal page tree for the user to select a page. Note that only records of the current table are listed in the module.

sorting is optional. Use integer values to specify sort order of your custom modules when creating more than one.

title is optional. Default is the title of the table as specified in TCA. Use a string or a LLL reference.

icon and iconIdentifier are optional. Default is the icon as specified in TCA.

Via configuration records

On root level you can create configuration records for each desired backend module.

The settings are nearly the same as the settings in TCA.

Example of a configuration record listing backend users

Events

EXT:recordmodules offers two events to adjust the PIDs used by a module.

BeforePidsLoadedEvent and AfterPidsLoadedEvent. The event holds the PIDs and the current table used.

Example:

use Rfuehricht\Recordmodules\Event\BeforePidsLoadedEvent;

final class ModifyRecordModulesPids
{
    public function __invoke(BeforePidsLoadedEvent $event): void
    {
        if ($event->getTable() === 'tx_news_domain_model_news') {
            $event->setPids([123, 124, 125]);
        }
    }
}

统计信息

  • 总下载量: 1.34k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2025-03-11