Skip to content

Commit

Permalink
Automatically generate the global operations (see #6528)
Browse files Browse the repository at this point in the history
Description
-----------

extracted for #6527

Commits
-------

addc518 Automatically generate the global operations
  • Loading branch information
aschempp committed Nov 14, 2023
1 parent 7faf879 commit 3d403b5
Show file tree
Hide file tree
Showing 22 changed files with 264 additions and 193 deletions.
3 changes: 3 additions & 0 deletions core-bundle/config/listener.yaml
Expand Up @@ -80,6 +80,9 @@ services:
- '@database_connection'
- '@request_stack'

contao.listener.data_container.default_global_operations:
class: Contao\CoreBundle\EventListener\DataContainer\DefaultGlobalOperationsListener

contao.listener.data_container.default_operations:
class: Contao\CoreBundle\EventListener\DataContainer\DefaultOperationsListener
arguments:
Expand Down
15 changes: 0 additions & 15 deletions core-bundle/contao/dca/tl_article.php
Expand Up @@ -71,21 +71,6 @@
'format' => '%s <span class="label-info">[%s]</span>',
'label_callback' => array('tl_article', 'addIcon')
),
'global_operations' => array
(
'toggleNodes' => array
(
'href' => 'ptg=all',
'class' => 'header_toggle',
'showOnSelect' => true
),
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
),
'operations' => array
(
'edit' => array
Expand Down
9 changes: 0 additions & 9 deletions core-bundle/contao/dca/tl_content.php
Expand Up @@ -68,15 +68,6 @@
'child_record_callback' => array('tl_content', 'addCteType'),
'renderAsGrid' => true
),
'global_operations' => array
(
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
),
'operations' => array
(
'edit' => array
Expand Down
22 changes: 0 additions & 22 deletions core-bundle/contao/dca/tl_favorites.php
Expand Up @@ -45,28 +45,6 @@
(
'fields' => array('title'),
'format' => '%s'
),
'global_operations' => array
(
'toggleNodes' => array
(
'href' => 'ptg=all',
'class' => 'header_toggle',
'showOnSelect' => true
),
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
),
'operations' => array
(
'edit',
'cut',
'delete',
'show'
)
),

Expand Down
14 changes: 2 additions & 12 deletions core-bundle/contao/dca/tl_files.php
Expand Up @@ -81,18 +81,8 @@
'class' => 'header_sync',
'button_callback' => array('tl_files', 'syncFiles')
),
'toggleNodes' => array
(
'href' => 'tg=all',
'class' => 'header_toggle',
'showOnSelect' => true
),
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
'toggleNodes',
'all'
),
'operations' => array
(
Expand Down
9 changes: 0 additions & 9 deletions core-bundle/contao/dca/tl_form.php
Expand Up @@ -70,15 +70,6 @@
'fields' => array('title', 'formID'),
'format' => '%s <span class="label-info">[%s]</span>'
),
'global_operations' => array
(
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
),
'operations' => array
(
'edit' => array
Expand Down
9 changes: 0 additions & 9 deletions core-bundle/contao/dca/tl_form_field.php
Expand Up @@ -62,15 +62,6 @@
'child_record_callback' => array('tl_form_field', 'listFormFields'),
'renderAsGrid' => true
),
'global_operations' => array
(
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
),
'operations' => array
(
'edit' => array
Expand Down
9 changes: 0 additions & 9 deletions core-bundle/contao/dca/tl_image_size.php
Expand Up @@ -69,15 +69,6 @@
'headerFields' => array('name', 'author', 'tstamp'),
'child_record_callback' => array('tl_image_size', 'listImageSize')
),
'global_operations' => array
(
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
),
'operations' => array
(
'edit' => array
Expand Down
9 changes: 0 additions & 9 deletions core-bundle/contao/dca/tl_image_size_item.php
Expand Up @@ -49,15 +49,6 @@
'panelLayout' => 'limit',
'headerFields' => array('name', 'tstamp', 'width', 'height', 'resizeMode', 'zoom'),
'child_record_callback' => array('tl_image_size_item', 'listImageSizeItem')
),
'global_operations' => array
(
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
)
),

Expand Down
9 changes: 0 additions & 9 deletions core-bundle/contao/dca/tl_layout.php
Expand Up @@ -52,15 +52,6 @@
'defaultSearchField' => 'name',
'headerFields' => array('name', 'author', 'tstamp'),
'child_record_callback' => array('tl_layout', 'listLayout')
),
'global_operations' => array
(
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
)
),

Expand Down
9 changes: 0 additions & 9 deletions core-bundle/contao/dca/tl_log.php
Expand Up @@ -47,15 +47,6 @@
'format' => '<span class="label-date">[%s]</span> %s',
'label_callback' => array('tl_log', 'colorize')
),
'global_operations' => array
(
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
),
'operations' => array
(
'delete',
Expand Down
9 changes: 0 additions & 9 deletions core-bundle/contao/dca/tl_member.php
Expand Up @@ -62,15 +62,6 @@
'showColumns' => true,
'label_callback' => array('tl_member', 'addIcon')
),
'global_operations' => array
(
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
),
'operations' => array
(
'edit',
Expand Down
9 changes: 0 additions & 9 deletions core-bundle/contao/dca/tl_member_group.php
Expand Up @@ -46,15 +46,6 @@
'fields' => array('name'),
'format' => '%s',
'label_callback' => array('tl_member_group', 'addIcon')
),
'global_operations' => array
(
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
)
),

Expand Down
9 changes: 0 additions & 9 deletions core-bundle/contao/dca/tl_module.php
Expand Up @@ -57,15 +57,6 @@
'label' => array
(
'group_callback' => array('tl_module', 'getGroupHeader')
),
'global_operations' => array
(
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
)
),

Expand Down
15 changes: 0 additions & 15 deletions core-bundle/contao/dca/tl_page.php
Expand Up @@ -94,21 +94,6 @@
'format' => '%s',
'label_callback' => array('tl_page', 'addIcon')
),
'global_operations' => array
(
'toggleNodes' => array
(
'href' => 'ptg=all',
'class' => 'header_toggle',
'showOnSelect' => true
),
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
),
'operations' => array
(
'edit' => array
Expand Down
9 changes: 0 additions & 9 deletions core-bundle/contao/dca/tl_preview_link.php
Expand Up @@ -44,15 +44,6 @@
'fields' => array('url', 'createdAt', 'expiresAt'),
'showColumns' => true,
),
'global_operations' => array
(
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
),
'operations' => array
(
'edit',
Expand Down
7 changes: 1 addition & 6 deletions core-bundle/contao/dca/tl_templates.php
Expand Up @@ -69,12 +69,7 @@
'class' => 'header_toggle',
'showOnSelect' => true
),
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
'all'
),
'operations' => array
(
Expand Down
7 changes: 1 addition & 6 deletions core-bundle/contao/dca/tl_theme.php
Expand Up @@ -73,12 +73,7 @@
'class' => 'header_store',
'button_callback' => array('tl_theme', 'themeStore')
),
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
'all'
),
'operations' => array
(
Expand Down
9 changes: 0 additions & 9 deletions core-bundle/contao/dca/tl_user.php
Expand Up @@ -71,15 +71,6 @@
'showColumns' => true,
'label_callback' => array('tl_user', 'addIcon')
),
'global_operations' => array
(
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
),
'operations' => array
(
'edit' => array
Expand Down
9 changes: 0 additions & 9 deletions core-bundle/contao/dca/tl_user_group.php
Expand Up @@ -58,15 +58,6 @@
'format' => '%s',
'label_callback' => array('tl_user_group', 'addIcon')
),
'global_operations' => array
(
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
)
),

// Palettes
Expand Down

0 comments on commit 3d403b5

Please sign in to comment.