markocupic / contao-custom-global-operation
扩展Contao后端全局操作导航
1.0
2023-02-09 20:22 UTC
Requires
- php: ^8.1
- contao/core-bundle: ^4.13 || ^5.0
Requires (Dev)
- contao/easy-coding-standard: ^3.0
- contao/manager-plugin: ^2.3.1
- contao/test-case: ^4.5
- phpunit/phpunit: ^9.3
- symfony/http-client: 5.4.*
- symfony/phpunit-bridge: ^5.4
README
在Contao后端中查看许多全局操作的更多概览
如果Contao后端模块拥有许多全局操作,导航可能会变得难以理解。
这个Contao扩展可以帮助您。不同的菜单项可以按主题分组并有序输出。
配置
配置通过Contao的DCA进行,请注意以下两个键
custom_glob_op
: 通过custom_glob_op => true
激活菜单项的自定义输出。通过数组custom_glob_op_options => []
可以进一步配置菜单项或将其排除。
'global_operations' => [
'all' => [
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"',
],
'glob_operation_one' => [
'href' => 'action=glob_operation_one',
'class' => 'glob_operation_one',
'icon' => 'bundles/myawesomecontaobundle/icons/file-word-regular.svg',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"',
'custom_glob_op' => true,
'custom_glob_op_options' => ['add_to_menu_group' => 'my_menu_one', 'sorting' => 10],
],
'glob_operation_two' => [
'href' => 'action=glob_operation_two',
'class' => 'glob_operation_one',
'icon' => 'bundles/myawesomecontaobundle/icons/file-excel-regular.svg',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"',
'custom_glob_op' => true,
'custom_glob_op_options' => ['add_to_menu_group' => 'my_menu_one', 'sorting' => 20],
],
'glob_operation_three' => [
'href' => 'action=glob_operation_three',
'class' => 'glob_operation_one',
'icon' => 'bundles/myawesomecontaobundle/icons/file-pdf-regular.svg',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"',
'custom_glob_op' => true,
'custom_glob_op_options' => ['add_to_menu_group' => 'my_menu_two', 'sorting' => 30],
],
],