Skip to content

Commit

Permalink
fix: reintegration of settings into flexform
Browse files Browse the repository at this point in the history
  • Loading branch information
Lebeau09 committed Oct 22, 2024
1 parent 9ae5e3e commit 8e9d957
Show file tree
Hide file tree
Showing 2 changed files with 359 additions and 0 deletions.
54 changes: 54 additions & 0 deletions Classes/Persistence/Order.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php


namespace Fab\NaturalGallery\Persistence;



/**
* Order class for order that will apply to a query
*/
class Order
{
/**
* The orderings
*
* @var array
*/
protected array $orderings = [];

/**
* Constructs a new Order
*
* @para array $orders
* @param array $orders
*/
public function __construct(array $orders = array())
{
foreach ($orders as $order => $direction) {
$this->addOrdering($order, $direction);
}
}

/**
* Add ordering
*
* @param string $order The order
* @param string $direction ASC / DESC
* @return void
*/
public function addOrdering(string $order, string $direction): void
{
$this->orderings[$order] = $direction;
}

/**
* Returns the order
*
* @return array The order
*/
public function getOrderings(): array
{
return $this->orderings;
}
}
305 changes: 305 additions & 0 deletions Configuration/FlexForm/NaturalGallery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,83 @@
<sheetTitle>LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:flexform.tab.source</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<settings.folders>
<TCEforms>
<label>LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.folders</label>
<config>
<type>input</type>
<size>40</size>
<eval>trim</eval>
<wizards type="array">
<link type="array">
<type>popup</type>
<icon>link_popup.gif</icon>
<module type="array">
<name>wizard_element_browser</name>
<urlParameters type="array">
<mode>wizard</mode>
<act>file</act>
</urlParameters>
</module>
<params>
<blindLinkOptions>page,url,mail,spec,file</blindLinkOptions>
</params>

<JSopenParams>height=900,width=900,status=0,menubar=0,scrollbars=1</JSopenParams>
</link>
</wizards>
</config>
</TCEforms>
</settings.folders>
<settings.additionalEquals>
<TCEforms>
<label>LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.additionalEquals</label>
<config>
<type>input</type>
</config>
</TCEforms>
</settings.additionalEquals>

<settings.sorting>
<TCEforms>
<label>LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.sorting</label>
<config>
<type>input</type>
</config>
</TCEforms>
</settings.sorting>
<settings.direction>
<TCEforms>
<label>LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.direction</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<items>
<numIndex index="0" type="array">
<numIndex index="0"></numIndex>
<numIndex index="1"></numIndex>
</numIndex>

<numIndex index="1" type="array">
<numIndex index="0">
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.direction.descending
</numIndex>
<numIndex index="1">DESC</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.direction.ascending
</numIndex>
<numIndex index="1">ASC</numIndex>
</numIndex>
</items>
<size>1</size>
<maxitems>1</maxitems>
</config>
</TCEforms>
</settings.direction>
</el>
</ROOT>
</selection>

Expand All @@ -31,6 +108,153 @@
<sheetTitle>LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:flexform.tab.imageSettings</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<settings.thumbnailFormat>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.thumbnailFormat
</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<items type="array">
<numIndex index="1" type="array">
<numIndex index="0">
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.thumbnailFormat.natural
</numIndex>
<numIndex index="1">natural</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.thumbnailFormat.square
</numIndex>
<numIndex index="1">square</numIndex>
</numIndex>
</items>
<minitems>0</minitems>
<maxitems>1</maxitems>
</config>
</TCEforms>
</settings.thumbnailFormat>
<settings.lightbox>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.lightbox
</label>
<config>
<type>check</type>
<default>1</default>
</config>
</TCEforms>
</settings.lightbox>
<settings.showLabels>
<TCEforms>
<label>LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.showLabels</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<items>
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.showLabels.hover</numIndex>
<numIndex index="1">hover</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.showLabels.true</numIndex>
<numIndex index="1">true</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.showLabels.false</numIndex>
<numIndex index="1">false</numIndex>
</numIndex>
</items>
<size>1</size>
<maxitems>1</maxitems>
</config>
</TCEforms>
</settings.showLabels>
<settings.imagesPerRow>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.imagesPerRow
</label>
<config>
<type>input</type>
<default>4</default>
<eval>trim</eval>
</config>
</TCEforms>
</settings.imagesPerRow>
<settings.limit>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.limit
</label>
<config>
<type>input</type>
<default>0</default>
<eval>trim</eval>
</config>
</TCEforms>
</settings.limit>
<settings.margin>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.margin
</label>
<config>
<type>input</type>
<default>1</default>
<eval>trim</eval>
</config>
</TCEforms>
</settings.margin>
<settings.round>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.round
</label>
<config>
<type>input</type>
<eval>trim</eval>
</config>
</TCEforms>
</settings.round>
<settings.rowHeight>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.rowHeight
</label>
<config>
<type>input</type>
<default>350</default>
<eval>trim</eval>
</config>
</TCEforms>
</settings.rowHeight>
<settings.enlargedImageMaximumWidth>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.enlargedImageMaximumWidth
</label>
<config>
<type>input</type>
<default>1600</default>
<eval>trim</eval>
</config>
</TCEforms>
</settings.enlargedImageMaximumWidth>
<settings.enlargedImageMaximumHeight>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.enlargedImageMaximumHeight
</label>
<config>
<type>input</type>
<eval>trim</eval>
</config>
</TCEforms>
</settings.enlargedImageMaximumHeight>
</el>
</ROOT>

</imageSettings>
Expand All @@ -41,6 +265,87 @@
<sheetTitle>LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:flexform.tab.filterBar</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<settings.showCount>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.showCount
</label>
<config>
<type>check</type>
<default>0</default>
</config>
</TCEforms>
</settings.showCount>
<settings.searchFilter>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.searchFilter
</label>
<config>
<type>check</type>
<default>0</default>
</config>
</TCEforms>
</settings.searchFilter>
<settings.categoriesFilter>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.categoriesFilter
</label>
<config>
<type>check</type>
<default>0</default>
</config>
</TCEforms>
</settings.categoriesFilter>
<settings.showNone>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.showNone
</label>
<config>
<type>check</type>
<default>0</default>
</config>
</TCEforms>
</settings.showNone>
<settings.showOthers>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.showOthers
</label>
<config>
<type>check</type>
<default>0</default>
</config>
</TCEforms>
</settings.showOthers>
<settings.categories>
<TCEforms>
<label>
LLL:EXT:natural_gallery/Resources/Private/Language/locallang.xlf:settings.categories
</label>
<config>
<type>select</type>
<renderType>selectMultipleSideBySide</renderType>
<autoSizeMax>50</autoSizeMax>
<foreign_table>sys_category</foreign_table>
<foreign_table_where> AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.sorting ASC</foreign_table_where>
<maxitems>9999</maxitems>
<renderMode>tree</renderMode>
<size>10</size>
<treeConfig>
<appearance>
<expandAll>1</expandAll>
<showHeader>1</showHeader>
</appearance>
<parentField>parent</parentField>
</treeConfig>
</config>
</TCEforms>
</settings.categories>
</el>
</ROOT>
</filterBar>

Expand Down

0 comments on commit 8e9d957

Please sign in to comment.