Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Option to set a column to hidden / d-none is missing for screen sizes #30

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
8b7fff5
[TASK] Update documentation and version numbers
Bunnyfield Dec 24, 2017
1c46e25
[BUGFIX] Always treat icons as an array, since there might be 2 icons
Bunnyfield Dec 28, 2017
02990ec
[TASK] Enable alphanumeric frame values for extension like t3ddy
Bunnyfield Dec 28, 2017
3a411cd
[BUGFIX] Adjust translations to match columns and container of l18n_p…
Bunnyfield Dec 28, 2017
b118db3
[BUGFIX] move bracket to fix issue with FIND IN SET
Bunnyfield Jan 5, 2018
02f62d7
[BUGFIX] Remove trailing or leading comma from CSV list of columns
Bunnyfield Jan 9, 2018
ac69b6c
[BUGFIX] Switch horizontal grids from inline-block to table-cell
Bunnyfield Jan 10, 2018
4129f4f
[BUGFIX] Remove superfluous addCssFile calls in favor of TBE_STYLES
Bunnyfield Jan 10, 2018
043c4d8
[TASK] replace deprecated SPDX license identifier for packagist
Bunnyfield Jan 29, 2018
3cfad5e
[BUGFIX] Use select field array instead of CSV and fetch result
Bunnyfield Feb 1, 2018
8a4b8b1
[BUGFIX] Leave overridePageIdList untouched to avoid problems w short…
Bunnyfield Feb 1, 2018
ada7752
[BUGFIX] Check for NULL before accessing class to avoid errors w PHP 7.2
Bunnyfield Feb 1, 2018
a44e370
[TASK] Make sure that child elements of containers get correct colPos
Bunnyfield Dec 22, 2017
6560fa4
[BUGFIX] Always use specific uid and pid when in workspace mode
Bunnyfield Feb 1, 2018
2c1a4b2
Revert "[BUGFIX] Always use specific uid and pid when in workspace mode"
Bunnyfield Feb 19, 2018
d36950f
[FEATURE] Restrict referenced content to column language if configured
Bunnyfield Mar 16, 2018
45a93e2
[BUGFIX] Use label for unassigned columns and have empty colPos stored
Bunnyfield Mar 16, 2018
d2d1acb
[BUGFIX] Use label for unassigned columns and have empty colPos stored
Bunnyfield Mar 20, 2018
a362a7b
[BUGFIX] Fix shortcut rendering for shortcuts to page(s)
Bunnyfield Mar 19, 2018
f8298ac
[BUGFIX] Set proper CSS styles for neutral frame headers
Bunnyfield Mar 21, 2018
bd5691e
[BUGFIX] Consider allowed settings for first level CE backend layouts
Bunnyfield Mar 21, 2018
3154e54
[BUGFIX] use proper pid values to fetch available layout columns
Bunnyfield Mar 21, 2018
cee9e1d
[TASK] Raise version number
Bunnyfield Mar 21, 2018
7d97993
[BUGFIX] Fix German translation of wizard fields used for restrictions
Bunnyfield Mar 22, 2018
dc3786c
[BUGFIX] Replace Connection::select with custom queryBuilder
Bunnyfield Mar 28, 2018
dc64d3b
[BUGFIX] convert negative uid values to pid before fetching BE layouts
Bunnyfield Mar 26, 2018
2ed799e
Squashed commit of the following:
Bunnyfield Mar 28, 2018
ae74074
[BUGFIX] Insert missing line after merge conflict
Bunnyfield Mar 28, 2018
2d2a0ba
[TASK] Code cleanup
Bunnyfield Mar 30, 2018
bef562c
[BUGFIX] remove hardcoded path from drag in wizard url
Bunnyfield Mar 31, 2018
84fc221
[BUGFIX] make paste icons aware of allowed and disallowed settings
Bunnyfield Mar 31, 2018
0b0041e
[TASK] Make Gridelements available for frontend editing
Bunnyfield Apr 3, 2018
0c8fe6d
[TASK] Make Gridelements available for frontend editing
Bunnyfield Apr 3, 2018
07e056e
[TASK] Raise version numbers before releasing to TER
Bunnyfield Apr 3, 2018
0818369
[BUGFIX] make localization panels only for specific tables
Bunnyfield Apr 4, 2018
5d936d2
[BUGFIX] remove debug output
Bunnyfield Apr 4, 2018
ae8c71f
[BUGFIX] fix regression introduced with 8.2.0
Bunnyfield Apr 4, 2018
c06d596
[BUGFIX] Remove debug output from unused element subheader
Bunnyfield May 3, 2018
dbaca32
[BUGFIX] Make sure to avoid named parameters when assigning fields di…
Bunnyfield May 3, 2018
e35f237
[TASK] Adjust variable type after interface fix in the core
Bunnyfield May 3, 2018
01d7c83
[BUGFIX] Make sure values are integers for strict comparison
Bunnyfield May 3, 2018
b826690
[BUGFIX] Get default language only when sys_language_content is not set
Bunnyfield May 3, 2018
34e8a98
[BUGFIX] remove new element buttons from page columns as soon as maxi…
Bunnyfield May 3, 2018
6c7cf43
[TASK] Raise version numbers before releasing to TER
Bunnyfield Jun 18, 2018
32adfe5
[BUGFIX] Fetch children of translated containers regardless of l18n_p…
Bunnyfield Jun 18, 2018
fc617c5
[TASK] Raise version number before releasing to TER
Bunnyfield Jun 18, 2018
26fd6d7
[TASK] Add dependencies to make sure those are loaded before GE
Bunnyfield Jun 25, 2018
98e0301
[BUGFIX] Introduce contentUid for DataHandler hooks
Bunnyfield Jul 9, 2018
1b00289
[BUGFIX] Adjust values after move operations within workspaces
Bunnyfield Jul 2, 2018
90a9b55
[BUGFIX] Make DrawItem aware of sources and targets for move actions
Bunnyfield Jul 2, 2018
5006d18
[BUGFIX] Cleanup workspaces after finalizing
Bunnyfield Jul 2, 2018
85a2402
[BUGFIX] Keep TypoScript structure to render shortcuts with FSC
Bunnyfield Aug 10, 2018
0b631b1
[BUGFIX] Bring back select icons for CE backend layouts
Bunnyfield Sep 9, 2018
b2bac2f
[BUGFIX] only set variable value, if thé CType show it's a Gridelement
Bunnyfield Nov 29, 2018
73380e6
[BUGFIX] Check if there was a nextThree item with that uid before uns…
Bunnyfield Nov 29, 2018
1a30da4
[BUGFIX] Make sure class gets 0 appended if value is empty
Bunnyfield Nov 29, 2018
a0c901c
[BUGFIX] Use official method to check explicit allowed/deny settings
Bunnyfield Nov 29, 2018
3df153b
[TASK] Squashed commit of the following:
Bunnyfield Dec 9, 2018
aeb8685
[BUGFIX] Use correct configuration keys for documentation
Bunnyfield Dec 10, 2018
fc44472
Squashed commit of the following:
Bunnyfield Dec 10, 2018
c2dae08
[TASK] Remove superfluous plugin configuration
Bunnyfield Jan 1, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 1 addition & 61 deletions Classes/Backend/ItemsProcFuncs/AbstractItemsProcFunc.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,14 @@

use GridElementsTeam\Gridelements\Helper\Helper;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\View\BackendLayoutView;
use TYPO3\CMS\Core\Database\QueryGenerator;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Lang\LanguageService;

/**
* Class/Function which offers TCE main hook functions.
*
* @author Jo Hasenau <[email protected]>
* @package TYPO3
* @subpackage tx_gridelements
*/
abstract class AbstractItemsProcFunc implements SingletonInterface
{
Expand Down Expand Up @@ -65,62 +61,7 @@ public function init()
*/
public function getSelectedBackendLayout($pageId)
{
if (empty($GLOBALS['tx_gridelements']['pageBackendLayoutData'][$pageId])) {
$backendLayoutData = GeneralUtility::callUserFunction(BackendLayoutView::class . '->getSelectedBackendLayout',
$pageId, $this);
// add allowed CTypes to the columns, since this is not done by the native core methods
if (!empty($backendLayoutData['__items'])) {
$backendLayoutData['columns']['CSV'] = '-2,-1';
if (!empty($backendLayoutData['__config']['backend_layout.']['rows.'])) {
$allowed = [];
$disallowed = [];
$maxItems = [];
foreach ($backendLayoutData['__config']['backend_layout.']['rows.'] as $row) {
if (!empty($row['columns.'])) {
foreach ($row['columns.'] as $column) {
if (!isset($column['colPos'])) {
continue;
}
$colPos = (int)$column['colPos'];
if (isset($column['allowed.'])) {
$column['allowed'] = $column['allowed.'];
}
if (isset($column['disallowed.'])) {
$column['disallowed'] = $column['disallowed.'];
}
if (!is_array($column['allowed']) && !empty($column['allowed'])) {
$allowed[$colPos] = ['CType' => $column['allowed']];
} else if (empty($column['allowed'])) {
$allowed[$colPos] = ['CType' => '*'];
} else {
$allowed[$colPos] = $column['allowed'];
}
if ($column['allowedGridTypes']) {
$allowed[$colPos]['tx_gridelements_backend_layout'] = $column['allowedGridTypes'];
}
if (!empty($column['disallowed'])) {
$disallowed[$colPos] = $column['disallowed'];
}
if (!empty($column['maxitems'])) {
$maxItems[$colPos] = $column['maxitems'];
}
$backendLayoutData['columns']['CSV'] .= ',' . $colPos;
}
}
}
$backendLayoutData['allowed'] = $allowed;
if (!empty($disallowed)) {
$backendLayoutData['disallowed'] = $disallowed;
}
if (!empty($maxItems)) {
$backendLayoutData['maxitems'] = $maxItems;
}
}
$backendLayoutData = Helper::getInstance()->mergeAllowedDisallowedSettings($backendLayoutData);
};
$GLOBALS['tx_gridelements']['pageBackendLayoutData'][$pageId] = $backendLayoutData;
}
return $GLOBALS['tx_gridelements']['pageBackendLayoutData'][$pageId];
return Helper::getInstance()->getSelectedBackendLayout($pageId);
}

/**
Expand Down Expand Up @@ -166,5 +107,4 @@ public function getBackendUser()
{
return $GLOBALS['BE_USER'];
}

}
26 changes: 15 additions & 11 deletions Classes/Backend/ItemsProcFuncs/CTypeList.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,13 @@
***************************************************************/

use GridElementsTeam\Gridelements\Backend\LayoutSetup;
use GridElementsTeam\Gridelements\Helper\Helper;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;

/**
* Class/Function which manipulates the item-array for table/field tt_content CType.
*
* @author Jo Hasenau <[email protected]>
* @package TYPO3
* @subpackage tx_gridelements
*/
class CTypeList extends AbstractItemsProcFunc
{
Expand All @@ -49,16 +46,26 @@ public function itemsProcFunc(array &$params)
{
if ((int)$params['row']['pid'] > 0) {
$colPos = is_array($params['row']['colPos']) ? $params['row']['colPos'][0] : $params['row']['colPos'];
$this->checkForAllowedCTypes($params['items'], $params['row']['pid'], $colPos,
$params['row']['tx_gridelements_container'], $params['row']['tx_gridelements_columns']);
$this->checkForAllowedCTypes(
$params['items'],
$params['row']['pid'],
$colPos,
$params['row']['tx_gridelements_container'],
$params['row']['tx_gridelements_columns']
);
} else {
$this->init((int)$params['row']['pid']);
// negative uid_pid values indicate that the element has been inserted after an existing element
// so there is no pid to get the backendLayout for and we have to get that first
$existingElement = BackendUtility::getRecordWSOL('tt_content', -((int)$params['row']['pid']), 'pid,CType,colPos,tx_gridelements_container,tx_gridelements_columns');
if ((int)$existingElement['pid'] > 0) {
$this->checkForAllowedCTypes($params['items'], $existingElement['pid'], $existingElement['colPos'],
$existingElement['tx_gridelements_container'], $existingElement['tx_gridelements_columns']);
$this->checkForAllowedCTypes(
$params['items'],
$existingElement['pid'],
$existingElement['colPos'],
$existingElement['tx_gridelements_container'],
$existingElement['tx_gridelements_columns']
);
}
}
}
Expand Down Expand Up @@ -89,7 +96,7 @@ public function checkForAllowedCTypes(array &$items, $pageId, $pageColumn, $grid
if (is_array($layout['allowed']) && is_array($layout['allowed'][$column]) && !empty($layout['allowed'][$column]['CType'])) {
$allowed = $layout['allowed'][$column]['CType'];
}
if (is_array($layout['disallowed']) && is_array($layout['disallowed'][$column]) && !empty($layout['disallowed'][$column]['CType'])){
if (is_array($layout['disallowed']) && is_array($layout['disallowed'][$column]) && !empty($layout['disallowed'][$column]['CType'])) {
$disallowed = $layout['disallowed'][$column]['CType'];
}
}
Expand Down Expand Up @@ -122,9 +129,6 @@ public function init($pageId = 0)
{
parent::init();
if (!$this->layoutSetup) {
if ($pageId < 0) {
$pageId = Helper::getInstance()->getPidFromNegativeUid($pageId);
}
$this->injectLayoutSetup(GeneralUtility::makeInstance(LayoutSetup::class)->init($pageId));
}
}
Expand Down
30 changes: 21 additions & 9 deletions Classes/Backend/ItemsProcFuncs/ColPosList.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
* Class/Function which manipulates the item-array for table/field tt_content colPos.
*
* @author Jo Hasenau <[email protected]>
* @package TYPO3
* @subpackage tx_gridelements
*/
class ColPosList extends AbstractItemsProcFunc
{
Expand All @@ -43,17 +41,31 @@ public function itemsProcFunc(array &$params)
$contentType = is_array($params['row']['CType']) ? $params['row']['CType'][0] : $params['row']['CType'];
$listType = is_array($params['row']['list_type']) ? $params['row']['list_type'][0] : $params['row']['list_type'];
$gridType = is_array($params['row']['tx_gridelements_backend_layout']) ? $params['row']['tx_gridelements_backend_layout'][0] : $params['row']['tx_gridelements_backend_layout'];
$params['items'] = $this->addColPosListLayoutItems($params['row']['pid'], $params['items'], $contentType,
$listType, $gridType, $params['row']['tx_gridelements_container']);
$params['items'] = $this->addColPosListLayoutItems(
$params['row']['pid'],
$params['items'],
$contentType,
$listType,
$gridType,
$params['row']['tx_gridelements_container']
);
} else {
// negative uid_pid values indicate that the element has been inserted after an existing element
// so there is no pid to get the backendLayout for and we have to get that first
$existingElement = BackendUtility::getRecordWSOL('tt_content', -((int)$params['row']['pid']),
'pid,CType,tx_gridelements_container');
$existingElement = BackendUtility::getRecordWSOL(
'tt_content',
-((int)$params['row']['pid']),
'pid,CType,tx_gridelements_container'
);
if ($existingElement['pid'] > 0) {
$params['items'] = $this->addColPosListLayoutItems($existingElement['pid'], $params['items'],
$existingElement['CType'], $existingElement['list_type'],
$existingElement['tx_gridelements_backend_layout'], $existingElement['tx_gridelements_container']);
$params['items'] = $this->addColPosListLayoutItems(
$existingElement['pid'],
$params['items'],
$existingElement['CType'],
$existingElement['list_type'],
$existingElement['tx_gridelements_backend_layout'],
$existingElement['tx_gridelements_container']
);
}
}
}
Expand Down
26 changes: 15 additions & 11 deletions Classes/Backend/ItemsProcFuncs/ListTypeList.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,13 @@
***************************************************************/

use GridElementsTeam\Gridelements\Backend\LayoutSetup;
use GridElementsTeam\Gridelements\Helper\Helper;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;

/**
* Class/Function which manipulates the item-array for table/field tt_content CType.
*
* @author Jo Hasenau <[email protected]>
* @package TYPO3
* @subpackage tx_gridelements
*/
class ListTypeList extends AbstractItemsProcFunc
{
Expand All @@ -49,16 +46,26 @@ public function itemsProcFunc(array &$params)
{
if ((int)$params['row']['pid'] > 0) {
$colPos = is_array($params['row']['colPos']) ? $params['row']['colPos'][0] : $params['row']['colPos'];
$this->checkForAllowedListTypes($params['items'], $params['row']['pid'], $colPos,
$params['row']['tx_gridelements_container'], $params['row']['tx_gridelements_columns']);
$this->checkForAllowedListTypes(
$params['items'],
$params['row']['pid'],
$colPos,
$params['row']['tx_gridelements_container'],
$params['row']['tx_gridelements_columns']
);
} else {
$this->init((int)$params['row']['pid']);
// negative uid_pid values indicate that the element has been inserted after an existing element
// so there is no pid to get the backendLayout for and we have to get that first
$existingElement = BackendUtility::getRecordWSOL('tt_content', -((int)$params['row']['pid']), 'pid,list_type,colPos,tx_gridelements_container,tx_gridelements_columns');
if ((int)$existingElement['pid'] > 0) {
$this->checkForAllowedListTypes($params['items'], $existingElement['pid'], $existingElement['colPos'],
$existingElement['tx_gridelements_container'], $existingElement['tx_gridelements_columns']);
$this->checkForAllowedListTypes(
$params['items'],
$existingElement['pid'],
$existingElement['colPos'],
$existingElement['tx_gridelements_container'],
$existingElement['tx_gridelements_columns']
);
}
}
}
Expand Down Expand Up @@ -89,7 +96,7 @@ public function checkForAllowedListTypes(array &$items, $pageId, $pageColumn, $g
if (is_array($layout['allowed']) && is_array($layout['allowed'][$column]) && !empty($layout['allowed'][$column]['list_type'])) {
$allowed = $layout['allowed'][$column]['list_type'];
}
if (is_array($layout['disallowed']) && is_array($layout['disallowed'][$column]) && !empty($layout['disallowed'][$column]['list_type'])){
if (is_array($layout['disallowed']) && is_array($layout['disallowed'][$column]) && !empty($layout['disallowed'][$column]['list_type'])) {
$disallowed = $layout['disallowed'][$column]['list_type'];
}
}
Expand Down Expand Up @@ -122,9 +129,6 @@ public function init($pageId = 0)
{
parent::init();
if (!$this->layoutSetup) {
if ($pageId < 0) {
$pageId = Helper::getInstance()->getPidFromNegativeUid($pageId);
}
$this->injectLayoutSetup(GeneralUtility::makeInstance(LayoutSetup::class)->init($pageId));
}
}
Expand Down
4 changes: 1 addition & 3 deletions Classes/Backend/ItemsProcFuncs/SysLanguageUidList.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
* Class/Function which manipulates the item-array for table/field tt_content CType.
*
* @author Jo Hasenau <[email protected]>
* @package TYPO3
* @subpackage tx_gridelements
*/
class SysLanguageUidList extends AbstractItemsProcFunc
{
Expand Down Expand Up @@ -61,6 +59,6 @@ public function checkForAllowedLanguages(array &$items, $gridContainerId)
unset($items[$item]);
}
}
};
}
}
}
Loading