-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
256 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.idea/ | ||
public/ | ||
vendor/ | ||
/public/ | ||
/vendor/ | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> | ||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> | ||
<file source-language="en" datatype="plaintext" original="messages" date="2023-02-07T14:19:01Z"> | ||
<header/> | ||
<body> | ||
<trans-unit id="collapsecontent"> | ||
<source>Collapse content in column</source> | ||
<target>Spalte zuklappen</target> | ||
</trans-unit> | ||
<trans-unit id="expandcontent"> | ||
<source>Expand content in column</source> | ||
<target>Spalte ausklappen</target> | ||
</trans-unit> | ||
<trans-unit id="contentcollapsed"> | ||
<source>This column is collapsed!</source> | ||
<target>Diese Spalte ist zugeklappt</target> | ||
</trans-unit> | ||
</body> | ||
</file> | ||
</xliff> |
106 changes: 106 additions & 0 deletions
106
Resources/Private/PartialsPre12/PageLayout/Grid/Column.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" | ||
xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers" | ||
data-namespace-typo3-fluid="true"> | ||
<f:comment>remove class t3-grid-cell (for tests)</f:comment> | ||
<f:comment>change data-colpos attr</f:comment> | ||
<td valign="top" colspan="{column.colSpan}" rowspan="{column.rowSpan}" | ||
data-colpos="{column.dataColPos}" data-language-uid="{column.context.siteLanguage.languageId}" | ||
class="t3-grid-cell t3js-page-lang-column-{column.context.siteLanguage.languageId} t3js-page-column t3-page-column t3-page-column-{column.columnNumber} | ||
{f:if(condition: column.active, else: 't3-grid-cell-unassigned')} | ||
{f:if(condition: column.collapsed, then: 'collapsed')} | ||
t3-gridCell-width{column.colSpan} | ||
t3-gridCell-height{column.rowSpan}"> | ||
<div class="t3-page-column-header"> | ||
<f:if condition="{column.active}"> | ||
<f:then> | ||
<div class="t3-page-column-header-icons"> | ||
<f:if condition="{collapsable}"> | ||
<a href="#" | ||
class="btn btn-sm btn-default btn-borderless t3js-toggle-container-column" | ||
title="{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:expandcontent')}" | ||
data-toggle-title="{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:collapsecontent')}" | ||
data-collapse-state="collapsed"> | ||
<core:icon identifier="actions-view-list-expand" /> | ||
</a> | ||
<a href="#" | ||
class="btn btn-sm btn-default btn-borderless t3js-toggle-container-column" | ||
title="{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:collapsecontent')}" | ||
data-toggle-title="{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:expandcontent')}" | ||
data-collapse-state="expanded"> | ||
<core:icon identifier="actions-view-list-collapse" /> | ||
</a> | ||
</f:if> | ||
<f:if condition="{allowEditContent} && {column.editUrl}"> | ||
<a href="{column.editUrl}" title="{column.editLinkTitle}"><core:icon identifier="actions-document-open" /></a> | ||
</f:if> | ||
</div> | ||
{column.title} | ||
</f:then> | ||
<f:else if="{column.unassigned}"> | ||
{column.title} (<f:format.raw>{column.titleUnassigned}</f:format.raw>) | ||
</f:else> | ||
<f:else if="!{hideRestrictedColumns}"> | ||
<f:format.raw>{column.titleInaccessible}</f:format.raw> | ||
</f:else> | ||
<f:else> | ||
<f:format.raw>{column.titleInaccessible}</f:format.raw> | ||
</f:else> | ||
</f:if> | ||
</div> | ||
<f:comment>use column.allowNewContent instead of pageContext</f:comment> | ||
<f:if condition="{allowEditContent} && {column.contentEditable} && {column.allowNewContent}"> | ||
<div class="t3-page-ce t3js-page-ce" data-page="{column.context.pageId}" id="{column.uniqueId}"> | ||
<div class="t3js-page-new-ce t3-page-ce-wrapper-new-ce" id="colpos-{column.columnNumber}-page-{column.context.pageId}-{column.uniqueId}"> | ||
<f:if condition="{column.context.drawingConfiguration.showNewContentWizard}"> | ||
<f:then> | ||
<typo3-backend-new-content-element-wizard-button url="{column.newContentUrl}" title="{newContentTitle}"> | ||
<button type="button" class="btn btn-default btn-sm"> | ||
<core:icon identifier="actions-add" /> | ||
{newContentTitleShort} | ||
</button> | ||
</typo3-backend-new-content-element-wizard-button> | ||
</f:then> | ||
<f:else> | ||
<a href="{column.newContentUrl}" title="{newContentTitle}" class="btn btn-default btn-sm"> | ||
<core:icon identifier="actions-add" /> | ||
{newContentTitleShort} | ||
</a> | ||
</f:else> | ||
</f:if> | ||
</div> | ||
<div class="t3-page-ce-dropzone-available t3js-page-ce-dropzone-available"></div> | ||
</div> | ||
</f:if> | ||
<f:if condition="{collapsable}"> | ||
<div class="t3-page-ce container-collapsed-column-marker"> | ||
{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:contentcollapsed')} | ||
</div> | ||
</f:if> | ||
<f:if condition="{column.unassigned}"> | ||
<div class="t3-page-ce"> | ||
<div class="t3-page-ce-header">Empty Colpos</div> | ||
<div class="t3-page-ce-body"> | ||
<div class="t3-page-ce-body-inner"> | ||
<div class="row"> | ||
<div class="col-xs-12"> | ||
This column has no "colPos". This is only for display Purposes. | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</f:if> | ||
<f:if condition="{column.items}"> | ||
<f:comment>change data-colpos attr</f:comment> | ||
<div data-colpos="{column.dataColPos}" data-language-uid="{column.context.siteLanguage.languageId}" | ||
class="t3js-sortable t3js-sortable-lang t3js-sortable-lang-{column.context.siteLanguage.languageId} t3-page-ce-wrapper | ||
{f:if(condition: column.items, else: 't3-page-ce-empty')}"> | ||
<f:for each="{column.items}" as="item"> | ||
<f:if condition="{item.deletePlaceholder} == 0"> | ||
<f:render partial="PageLayout/Record" arguments="{_all}" /> | ||
</f:if> | ||
</f:for> | ||
</div> | ||
</f:if> | ||
</td> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<html | ||
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" | ||
xmlns:container="http://typo3.org/ns/B13/Container/ViewHelpers" | ||
data-namespace-typo3-fluid="true" | ||
> | ||
|
||
<f:be.pageRenderer | ||
includeCssFiles="{0: 'EXT:ew_collapsible_container/Resources/Public/Css/container.css'}" | ||
includeRequireJsModules="{0: 'TYPO3/CMS/EwCollapsibleContainer/ContainerPre12'}" /> | ||
|
||
<f:if condition="{grid}"> | ||
<f:comment>View\ContainerLayoutView</f:comment> | ||
<table style="width: 100%; table-layout: fixed;"> | ||
<f:for each="{grid}" as="row"> | ||
<tr> | ||
<f:for each="{row}" as="column"> | ||
<td class="t3-grid-cell" valign="top"{f:if(condition:"{column.colspan}", then: ' colspan="{column.colspan}"')}{f:if(condition:"{column.rowspan}", then: ' rowspan="{column.rowspan}"')}> | ||
<container:drawChildren uid="{uid}" colPos="{column.colPos}" /> | ||
</td> | ||
</f:for> | ||
</tr> | ||
</f:for> | ||
</table> | ||
</f:if> | ||
|
||
<f:if condition="{containerGrid}"> | ||
<f:comment>Backend\Preview\ContainerLayoutView (Fluid based page module)</f:comment> | ||
<f:render partial="PageLayout/Grid" arguments="{grid: containerGrid, hideRestrictedColumns: hideRestrictedColumns, newContentTitle: newContentTitle, newContentTitleShort: newContentTitleShort, allowEditContent: allowEditContent, collapsable: 1}" /> | ||
</f:if> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
class ContainerToggle { | ||
containerColumnToggle = '.t3js-toggle-container-column'; | ||
|
||
persistentStorage = null; | ||
|
||
storageKey = 'moduleData.list.containerExpanded'; | ||
|
||
constructor(PersistentStorage) { | ||
this.persistentStorage = PersistentStorage; | ||
this.initializeContainerToggle(); | ||
} | ||
|
||
/** | ||
* initialize the toggle icons to open listings of nested grid container structure in the list module | ||
*/ | ||
initializeContainerToggle() { | ||
const containers = Array.from(document.querySelectorAll(this.containerColumnToggle)); | ||
containers.forEach(container=> { | ||
container.addEventListener('click', event => this.toggleClicked(event)); | ||
}); | ||
} | ||
|
||
toggleClicked(event) { | ||
event.preventDefault(); | ||
|
||
let column = event.currentTarget, | ||
container = column.closest('td').dataset['colpos'], | ||
isExpanded = column.dataset['collapseState'] === 'expanded'; | ||
|
||
// Store collapse state in UC | ||
let storedModuleDataList = {}; | ||
|
||
if (this.persistentStorage.isset(this.storageKey)) { | ||
storedModuleDataList = this.persistentStorage.get(this.storageKey); | ||
} | ||
|
||
let expandConfig = {}; | ||
expandConfig[container] = isExpanded ? '1' : '0'; | ||
|
||
storedModuleDataList = Object.assign(storedModuleDataList, expandConfig); | ||
|
||
this.persistentStorage.set(this.storageKey, storedModuleDataList).then(() => { | ||
if (isExpanded) { | ||
column.closest('td').classList.add('collapsed'); | ||
} else { | ||
column.closest('td').classList.remove('collapsed'); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
define( | ||
[ | ||
'TYPO3/CMS/Backend/Storage/Persistent' | ||
], | ||
function(PersistentStorage) { | ||
return new ContainerToggle(PersistentStorage); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters