From 8a4eb3cfa81f832bbb434ea7a59e0eed389d795e Mon Sep 17 00:00:00 2001 From: Kamil Kuzminski Date: Tue, 25 Jul 2017 15:52:14 +0200 Subject: [PATCH 1/2] Place the toggle buttons next to the visibility button --- dca/tl_article.php | 39 ++++++++++++++++++++------------------- dca/tl_content.php | 6 ++++-- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/dca/tl_article.php b/dca/tl_article.php index 683e85e..a30129d 100755 --- a/dca/tl_article.php +++ b/dca/tl_article.php @@ -12,29 +12,30 @@ /** * Add operations */ -$GLOBALS['TL_DCA']['tl_article']['list']['operations']['toggleOnDesktop'] = [ - 'label' => &$GLOBALS['TL_LANG']['tl_article']['toggleOnDesktop'], - 'attributes' => 'onclick="Backend.getScrollOffset();"', - 'haste_ajax_operation' => [ - 'field' => 'hideOnDesktop', - 'options' => [ - ['value' => '', 'icon' => 'system/modules/mobilecontent/assets/desktop-visible.svg'], - ['value' => '1', 'icon' => 'system/modules/mobilecontent/assets/desktop-invisible.svg'], +array_insert($GLOBALS['TL_DCA']['tl_article']['list']['operations'], 6, [ + 'toggleOnDesktop' => [ + 'label' => &$GLOBALS['TL_LANG']['tl_article']['toggleOnDesktop'], + 'attributes' => 'onclick="Backend.getScrollOffset();"', + 'haste_ajax_operation' => [ + 'field' => 'hideOnDesktop', + 'options' => [ + ['value' => '', 'icon' => 'system/modules/mobilecontent/assets/desktop-visible.svg'], + ['value' => '1', 'icon' => 'system/modules/mobilecontent/assets/desktop-invisible.svg'], + ], ], ], -]; - -$GLOBALS['TL_DCA']['tl_article']['list']['operations']['toggleOnMobile'] = [ - 'label' => &$GLOBALS['TL_LANG']['tl_article']['toggleOnMobile'], - 'attributes' => 'onclick="Backend.getScrollOffset();"', - 'haste_ajax_operation' => [ - 'field' => 'hideOnMobile', - 'options' => [ - ['value' => '', 'icon' => 'system/modules/mobilecontent/assets/mobile-visible.svg'], - ['value' => '1', 'icon' => 'system/modules/mobilecontent/assets/mobile-invisible.svg'], + 'toggleOnMobile' => [ + 'label' => &$GLOBALS['TL_LANG']['tl_article']['toggleOnMobile'], + 'attributes' => 'onclick="Backend.getScrollOffset();"', + 'haste_ajax_operation' => [ + 'field' => 'hideOnMobile', + 'options' => [ + ['value' => '', 'icon' => 'system/modules/mobilecontent/assets/mobile-visible.svg'], + ['value' => '1', 'icon' => 'system/modules/mobilecontent/assets/mobile-invisible.svg'], + ], ], ], -]; +]); /** * Extend palettes diff --git a/dca/tl_content.php b/dca/tl_content.php index b7fc707..b4d903b 100755 --- a/dca/tl_content.php +++ b/dca/tl_content.php @@ -18,8 +18,10 @@ /** * Add operations */ -$GLOBALS['TL_DCA']['tl_content']['list']['operations']['toggleOnDesktop'] = &$GLOBALS['TL_DCA']['tl_article']['list']['operations']['toggleOnDesktop']; -$GLOBALS['TL_DCA']['tl_content']['list']['operations']['toggleOnMobile'] = &$GLOBALS['TL_DCA']['tl_article']['list']['operations']['toggleOnMobile']; +array_insert($GLOBALS['TL_DCA']['tl_content']['list']['operations'], 5, [ + 'toggleOnDesktop' => &$GLOBALS['TL_DCA']['tl_article']['list']['operations']['toggleOnDesktop'], + 'toggleOnMobile' => &$GLOBALS['TL_DCA']['tl_article']['list']['operations']['toggleOnMobile'], +]); /** * Extend palettes From 6df7c3608fcda9bad63c54b0b79cd77d358dd858 Mon Sep 17 00:00:00 2001 From: Kamil Kuzminski Date: Wed, 26 Jul 2017 09:05:55 +0200 Subject: [PATCH 2/2] Make the buttons order consistent in modules as well --- dca/tl_module.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dca/tl_module.php b/dca/tl_module.php index 7679c60..f28da36 100755 --- a/dca/tl_module.php +++ b/dca/tl_module.php @@ -18,8 +18,10 @@ /** * Add operations */ -$GLOBALS['TL_DCA']['tl_module']['list']['operations']['toggleOnDesktop'] = &$GLOBALS['TL_DCA']['tl_article']['list']['operations']['toggleOnDesktop']; -$GLOBALS['TL_DCA']['tl_module']['list']['operations']['toggleOnMobile'] = &$GLOBALS['TL_DCA']['tl_article']['list']['operations']['toggleOnMobile']; +array_insert($GLOBALS['TL_DCA']['tl_module']['list']['operations'], 4, [ + 'toggleOnDesktop' => &$GLOBALS['TL_DCA']['tl_article']['list']['operations']['toggleOnDesktop'], + 'toggleOnMobile' => &$GLOBALS['TL_DCA']['tl_article']['list']['operations']['toggleOnMobile'], +]); /** * Add palettes