mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-25 23:16:10 +01:00
Refactoring
This commit is contained in:
parent
6d94f8ccc1
commit
2426267567
11 changed files with 589 additions and 197 deletions
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
namespace Wrm\Events\Controller;
|
namespace Wrm\Events\Controller;
|
||||||
|
|
||||||
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||||
use Wrm\Events\Domain\Model\Dto\DateDemand;
|
use Wrm\Events\Domain\Model\Dto\DateDemand;
|
||||||
use Wrm\Events\Domain\Repository\DateRepository;
|
use Wrm\Events\Domain\Repository\DateRepository;
|
||||||
use Wrm\Events\Domain\Repository\RegionRepository;
|
use Wrm\Events\Domain\Repository\RegionRepository;
|
||||||
|
@ -63,8 +64,17 @@ class DateController extends ActionController
|
||||||
*/
|
*/
|
||||||
public function listAction()
|
public function listAction()
|
||||||
{
|
{
|
||||||
|
if (($this->request->hasArgument('searchword') && $this->request->getArgument('searchword') != '') ||
|
||||||
|
($this->request->hasArgument('region') && $this->request->getArgument('region') != '') ||
|
||||||
|
($this->request->hasArgument('start') && $this->request->getArgument('start') != '') ||
|
||||||
|
($this->request->hasArgument('end') && $this->request->getArgument('end') != ''))
|
||||||
|
{
|
||||||
|
$demand = $this->createDemandFromSearch();
|
||||||
|
$dates = $this->dateRepository->findByDemand($demand);
|
||||||
|
} else {
|
||||||
$demand = $this->createDemandFromSettings();
|
$demand = $this->createDemandFromSettings();
|
||||||
$dates = $this->dateRepository->findByDemand($demand);
|
$dates = $this->dateRepository->findByDemand($demand);
|
||||||
|
}
|
||||||
$this->view->assign('dates', $dates);
|
$this->view->assign('dates', $dates);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,42 +83,19 @@ class DateController extends ActionController
|
||||||
*/
|
*/
|
||||||
public function searchAction()
|
public function searchAction()
|
||||||
{
|
{
|
||||||
|
$arguments = GeneralUtility::_GET('tx_events_datelist');
|
||||||
$searchword = null;
|
$searchword = $arguments['searchword'];
|
||||||
$regions = null;
|
$selRegion = $arguments['region'];
|
||||||
$selRegion = null;
|
$start = $arguments['start'];
|
||||||
$dates = null;
|
$end = $arguments['end'];
|
||||||
$start = null;
|
|
||||||
$end = null;
|
|
||||||
|
|
||||||
if ($this->request->hasArgument('searchword') && $this->request->getArgument('searchword') != '') {
|
|
||||||
$searchword = $this->request->getArgument('searchword');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->request->hasArgument('region') && $this->request->getArgument('region') != '') {
|
|
||||||
$selRegion = $this->request->getArgument('region');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->request->hasArgument('start') && $this->request->getArgument('start') != '') {
|
|
||||||
$start = date( "d.m.y", strtotime( $this->request->getArgument('start')));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->request->hasArgument('end') && $this->request->getArgument('end') != '') {
|
|
||||||
$end = date( "d.m.y", strtotime( $this->request->getArgument('end')));
|
|
||||||
}
|
|
||||||
|
|
||||||
$demand = $this->createDemandFromSearch();
|
|
||||||
$dates = $this->dateRepository->findByDemand($demand);
|
|
||||||
|
|
||||||
$regions = $this->regionRepository->findAll();
|
$regions = $this->regionRepository->findAll();
|
||||||
|
$this->view->assign('regions', $regions);
|
||||||
|
|
||||||
$this->view->assign('searchword', $searchword);
|
$this->view->assign('searchword', $searchword);
|
||||||
$this->view->assign('regions', $regions);
|
|
||||||
$this->view->assign('selRegion', $selRegion);
|
$this->view->assign('selRegion', $selRegion);
|
||||||
$this->view->assign('dates', $dates);
|
|
||||||
$this->view->assign('start', $start);
|
$this->view->assign('start', $start);
|
||||||
$this->view->assign('end', $end);
|
$this->view->assign('end', $end);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -172,13 +159,11 @@ class DateController extends ActionController
|
||||||
if ($this->request->hasArgument('searchword') && $this->request->getArgument('searchword') != '')
|
if ($this->request->hasArgument('searchword') && $this->request->getArgument('searchword') != '')
|
||||||
$demand->setSearchword((string)$this->request->getArgument('searchword'));
|
$demand->setSearchword((string)$this->request->getArgument('searchword'));
|
||||||
|
|
||||||
if ($this->request->hasArgument('start') && $this->request->getArgument('start') != '') {
|
if ($this->request->hasArgument('start') && $this->request->getArgument('start') != '')
|
||||||
$demand->setStart(date( "Y-m-d", strtotime( $this->request->getArgument('start'))));
|
$demand->setStart(strtotime($this->request->getArgument('start')));
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->request->hasArgument('end') && $this->request->getArgument('end') != '') {
|
if ($this->request->hasArgument('end') && $this->request->getArgument('end') != '')
|
||||||
$demand->setEnd(date( "Y-m-d", strtotime( $this->request->getArgument('end'))));
|
$demand->setEnd(strtotime($this->request->getArgument('end')));
|
||||||
}
|
|
||||||
|
|
||||||
$demand->setSortBy((string)$this->settings['sortByDate']);
|
$demand->setSortBy((string)$this->settings['sortByDate']);
|
||||||
$demand->setSortOrder((string)$this->settings['sortOrder']);
|
$demand->setSortOrder((string)$this->settings['sortOrder']);
|
||||||
|
|
236
Configuration/FlexForms/DateList.xml
Normal file
236
Configuration/FlexForms/DateList.xml
Normal file
|
@ -0,0 +1,236 @@
|
||||||
|
<T3DataStructure>
|
||||||
|
<sheets>
|
||||||
|
<sDEF>
|
||||||
|
<ROOT>
|
||||||
|
<TCEforms>
|
||||||
|
<sheetTitle>Options</sheetTitle>
|
||||||
|
</TCEforms>
|
||||||
|
<type>array</type>
|
||||||
|
<el>
|
||||||
|
<settings.sortByDate>
|
||||||
|
<TCEforms>
|
||||||
|
<exclude>1</exclude>
|
||||||
|
<label>Sort By</label>
|
||||||
|
<config>
|
||||||
|
<type>select</type>
|
||||||
|
<items type="array">
|
||||||
|
<numIndex index="0" type="array">
|
||||||
|
<numIndex index="0">Start</numIndex>
|
||||||
|
<numIndex index="1">start</numIndex>
|
||||||
|
</numIndex>
|
||||||
|
<numIndex index="1" type="array">
|
||||||
|
<numIndex index="0">End</numIndex>
|
||||||
|
<numIndex index="1">end</numIndex>
|
||||||
|
</numIndex>
|
||||||
|
</items>
|
||||||
|
</config>
|
||||||
|
</TCEforms>
|
||||||
|
</settings.sortByDate>
|
||||||
|
|
||||||
|
<settings.sortOrder>
|
||||||
|
<TCEforms>
|
||||||
|
<exclude>1</exclude>
|
||||||
|
<label>Sort Order</label>
|
||||||
|
<config>
|
||||||
|
<type>select</type>
|
||||||
|
<items type="array">
|
||||||
|
<numIndex index="0" type="array">
|
||||||
|
<numIndex index="0">
|
||||||
|
Ascending
|
||||||
|
</numIndex>
|
||||||
|
<numIndex index="1">ASC</numIndex>
|
||||||
|
</numIndex>
|
||||||
|
<numIndex index="1" type="array">
|
||||||
|
<numIndex index="0">
|
||||||
|
Descending
|
||||||
|
</numIndex>
|
||||||
|
<numIndex index="1">DESC</numIndex>
|
||||||
|
</numIndex>
|
||||||
|
</items>
|
||||||
|
<default>ASC</default>
|
||||||
|
</config>
|
||||||
|
</TCEforms>
|
||||||
|
</settings.sortOrder>
|
||||||
|
|
||||||
|
<settings.limit>
|
||||||
|
<TCEforms>
|
||||||
|
<exclude>1</exclude>
|
||||||
|
<label>Max Items</label>
|
||||||
|
<config>
|
||||||
|
<type>input</type>
|
||||||
|
<size>10</size>
|
||||||
|
<max>30</max>
|
||||||
|
<eval>trim</eval>
|
||||||
|
</config>
|
||||||
|
</TCEforms>
|
||||||
|
</settings.limit>
|
||||||
|
|
||||||
|
<settings.highlight>
|
||||||
|
<TCEforms>
|
||||||
|
<exclude>1</exclude>
|
||||||
|
<label>Highlights only</label>
|
||||||
|
<config>
|
||||||
|
<type>check</type>
|
||||||
|
<default>0</default>
|
||||||
|
</config>
|
||||||
|
</TCEforms>
|
||||||
|
</settings.highlight>
|
||||||
|
|
||||||
|
<settings.todayOnly>
|
||||||
|
<TCEforms>
|
||||||
|
<exclude>1</exclude>
|
||||||
|
<label>Today only</label>
|
||||||
|
<config>
|
||||||
|
<type>check</type>
|
||||||
|
<default>0</default>
|
||||||
|
</config>
|
||||||
|
</TCEforms>
|
||||||
|
</settings.todayOnly>
|
||||||
|
|
||||||
|
<settings.pagination>
|
||||||
|
<TCEforms>
|
||||||
|
<exclude>1</exclude>
|
||||||
|
<label>Show pagination</label>
|
||||||
|
<config>
|
||||||
|
<type>check</type>
|
||||||
|
<default>0</default>
|
||||||
|
</config>
|
||||||
|
</TCEforms>
|
||||||
|
</settings.pagination>
|
||||||
|
|
||||||
|
<settings.showPID>
|
||||||
|
<TCEforms>
|
||||||
|
<exclude>1</exclude>
|
||||||
|
<label>Detail page</label>
|
||||||
|
<config>
|
||||||
|
<type>group</type>
|
||||||
|
<internal_type>db</internal_type>
|
||||||
|
<allowed>pages</allowed>
|
||||||
|
<size>1</size>
|
||||||
|
<maxitems>1</maxitems>
|
||||||
|
<minitems>0</minitems>
|
||||||
|
<show_thumbs>1</show_thumbs>
|
||||||
|
</config>
|
||||||
|
</TCEforms>
|
||||||
|
</settings.showPID>
|
||||||
|
</el>
|
||||||
|
</ROOT>
|
||||||
|
</sDEF>
|
||||||
|
<sTemplate>
|
||||||
|
<ROOT>
|
||||||
|
<TCEforms>
|
||||||
|
<sheetTitle>Template</sheetTitle>
|
||||||
|
</TCEforms>
|
||||||
|
<type>array</type>
|
||||||
|
<el>
|
||||||
|
<settings.template>
|
||||||
|
<exclude>1</exclude>
|
||||||
|
<label>Layout option</label>
|
||||||
|
<config>
|
||||||
|
<type>select</type>
|
||||||
|
<items type="array">
|
||||||
|
<numIndex index="0" type="array">
|
||||||
|
<numIndex index="0">Default</numIndex>
|
||||||
|
<numIndex index="1">default</numIndex>
|
||||||
|
</numIndex>
|
||||||
|
<numIndex index="1" type="array">
|
||||||
|
<numIndex index="0">Costum</numIndex>
|
||||||
|
<numIndex index="1">costum</numIndex>
|
||||||
|
</numIndex>
|
||||||
|
<numIndex index="2" type="array">
|
||||||
|
<numIndex index="0">Table</numIndex>
|
||||||
|
<numIndex index="1">table</numIndex>
|
||||||
|
</numIndex>
|
||||||
|
<numIndex index="3" type="array">
|
||||||
|
<numIndex index="0">Grid</numIndex>
|
||||||
|
<numIndex index="1">grid</numIndex>
|
||||||
|
</numIndex>
|
||||||
|
</items>
|
||||||
|
<default>default</default>
|
||||||
|
</config>
|
||||||
|
</settings.template>
|
||||||
|
</el>
|
||||||
|
</ROOT>
|
||||||
|
</sTemplate>
|
||||||
|
<sConstrains>
|
||||||
|
<ROOT>
|
||||||
|
<TCEforms>
|
||||||
|
<sheetTitle>Regions & Categories</sheetTitle>
|
||||||
|
</TCEforms>
|
||||||
|
<type>array</type>
|
||||||
|
<el>
|
||||||
|
<settings.region>
|
||||||
|
<TCEforms>
|
||||||
|
<label>Region</label>
|
||||||
|
<config>
|
||||||
|
<type>select</type>
|
||||||
|
<foreign_table>tx_events_domain_model_region</foreign_table>
|
||||||
|
<foreign_table_where>AND tx_events_domain_model_region.deleted = 0 AND tx_events_domain_model_region.hidden = 0</foreign_table_where>
|
||||||
|
<size>3</size>
|
||||||
|
<minitems>0</minitems>
|
||||||
|
<maxitems>2</maxitems>
|
||||||
|
</config>
|
||||||
|
</TCEforms>
|
||||||
|
</settings.region>
|
||||||
|
|
||||||
|
<settings.categoryCombination>
|
||||||
|
<TCEforms>
|
||||||
|
<exclude>1</exclude>
|
||||||
|
<label>Combination</label>
|
||||||
|
<config>
|
||||||
|
<type>select</type>
|
||||||
|
<items type="array">
|
||||||
|
<numIndex index="0" type="array">
|
||||||
|
<numIndex index="0">And</numIndex>
|
||||||
|
<numIndex index="1">0</numIndex>
|
||||||
|
</numIndex>
|
||||||
|
<numIndex index="1" type="array">
|
||||||
|
<numIndex index="0">Or</numIndex>
|
||||||
|
<numIndex index="1">1</numIndex>
|
||||||
|
</numIndex>
|
||||||
|
</items>
|
||||||
|
<default>0</default>
|
||||||
|
</config>
|
||||||
|
</TCEforms>
|
||||||
|
</settings.categoryCombination>
|
||||||
|
|
||||||
|
<settings.categories>
|
||||||
|
<TCEforms>
|
||||||
|
<exclude>1</exclude>
|
||||||
|
<label>
|
||||||
|
Category
|
||||||
|
</label>
|
||||||
|
<config>
|
||||||
|
<type>select</type>
|
||||||
|
<autoSizeMax>20</autoSizeMax>
|
||||||
|
<foreign_table>sys_category</foreign_table>
|
||||||
|
<foreign_table_where> AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC</foreign_table_where>
|
||||||
|
<maxitems>1</maxitems>
|
||||||
|
<renderMode>tree</renderMode>
|
||||||
|
<size>8</size>
|
||||||
|
<treeConfig>
|
||||||
|
<appearance>
|
||||||
|
<expandAll>1</expandAll>
|
||||||
|
<showHeader>1</showHeader>
|
||||||
|
</appearance>
|
||||||
|
<parentField>parent</parentField>
|
||||||
|
</treeConfig>
|
||||||
|
</config>
|
||||||
|
</TCEforms>
|
||||||
|
</settings.categories>
|
||||||
|
|
||||||
|
<settings.includeSubcategories>
|
||||||
|
<TCEforms>
|
||||||
|
<exclude>1</exclude>
|
||||||
|
<label>Include Subcategories</label>
|
||||||
|
<config>
|
||||||
|
<type>check</type>
|
||||||
|
<default>0</default>
|
||||||
|
</config>
|
||||||
|
</TCEforms>
|
||||||
|
</settings.includeSubcategories>
|
||||||
|
</el>
|
||||||
|
</ROOT>
|
||||||
|
</sConstrains>
|
||||||
|
</sheets>
|
||||||
|
</T3DataStructure>
|
29
Configuration/FlexForms/Search.xml
Normal file
29
Configuration/FlexForms/Search.xml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<T3DataStructure>
|
||||||
|
<sheets>
|
||||||
|
<sSearch>
|
||||||
|
<ROOT>
|
||||||
|
<TCEforms>
|
||||||
|
<sheetTitle>Options</sheetTitle>
|
||||||
|
</TCEforms>
|
||||||
|
<type>array</type>
|
||||||
|
<el>
|
||||||
|
<settings.resultsPID>
|
||||||
|
<TCEforms>
|
||||||
|
<exclude>1</exclude>
|
||||||
|
<label>Results page</label>
|
||||||
|
<config>
|
||||||
|
<type>group</type>
|
||||||
|
<internal_type>db</internal_type>
|
||||||
|
<allowed>pages</allowed>
|
||||||
|
<size>1</size>
|
||||||
|
<maxitems>1</maxitems>
|
||||||
|
<minitems>0</minitems>
|
||||||
|
<show_thumbs>1</show_thumbs>
|
||||||
|
</config>
|
||||||
|
</TCEforms>
|
||||||
|
</settings.resultsPID>
|
||||||
|
</el>
|
||||||
|
</ROOT>
|
||||||
|
</sSearch>
|
||||||
|
</sheets>
|
||||||
|
</T3DataStructure>
|
|
@ -20,5 +20,37 @@ call_user_func(function () {
|
||||||
'FILE:EXT:events/Configuration/FlexForms/Pi1.xml'
|
'FILE:EXT:events/Configuration/FlexForms/Pi1.xml'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* Search Plugin */
|
||||||
|
|
||||||
|
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
|
||||||
|
'Wrm.Events',
|
||||||
|
'DateSearch',
|
||||||
|
'Events Date Search',
|
||||||
|
'EXT:events/Resources/Public/Icons/user_plugin_events.svg'
|
||||||
|
);
|
||||||
|
|
||||||
|
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['events_datesearch'] = 'pi_flexform';
|
||||||
|
|
||||||
|
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
|
||||||
|
'events_datesearch',
|
||||||
|
'FILE:EXT:events/Configuration/FlexForms/Search.xml'
|
||||||
|
);
|
||||||
|
|
||||||
|
/* Date List Plugin */
|
||||||
|
|
||||||
|
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
|
||||||
|
'Wrm.Events',
|
||||||
|
'DateList',
|
||||||
|
'Events Date List',
|
||||||
|
'EXT:events/Resources/Public/Icons/user_plugin_events.svg'
|
||||||
|
);
|
||||||
|
|
||||||
|
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['events_datelist'] = 'pi_flexform';
|
||||||
|
|
||||||
|
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
|
||||||
|
'events_datelist',
|
||||||
|
'FILE:EXT:events/Configuration/FlexForms/DateList.xml'
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,11 +21,13 @@
|
||||||
{date.event.region.title} | <f:format.date format="d. m. Y - H:i">{date.start}</f:format.date>
|
{date.event.region.title} | <f:format.date format="d. m. Y - H:i">{date.start}</f:format.date>
|
||||||
<h4>{date.event.title}</h4>
|
<h4>{date.event.title}</h4>
|
||||||
<p>{date.event.teaser}</p>
|
<p>{date.event.teaser}</p>
|
||||||
|
<f:comment>
|
||||||
<f:if condition="{date.event.highlight}">
|
<f:if condition="{date.event.highlight}">
|
||||||
<f:then>
|
<f:then>
|
||||||
<b>Hightlight</b>
|
<b>Hightlight</b>
|
||||||
</f:then>
|
</f:then>
|
||||||
</f:if>
|
</f:if>
|
||||||
|
</f:comment>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
|
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
|
||||||
|
|
||||||
|
|
||||||
<f:widget.paginate objects="{dates}" as="paginatedDates" configuration="{itemsPerPage: 25, insertAbove: 0, insertBelow: 1, maximumNumberOfLinks: 5}">
|
<f:widget.paginate objects="{dates}" as="paginatedDates" configuration="{itemsPerPage: 25, insertAbove: 0, insertBelow: 1, maximumNumberOfLinks: 5, addQueryStringMethod: 'POST,GET'}">
|
||||||
<f:for each="{paginatedDates}" as="date">
|
<f:for each="{paginatedDates}" as="date" iteration="index">
|
||||||
<div class="row mb-3">
|
<div class="row mt-3 mb-3 pb-3">
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<b><f:format.date format="H:i">{date.start}</f:format.date></b><br>
|
<b><f:format.date format="H:i">{date.start}</f:format.date></b><br>
|
||||||
<b><f:format.date format="%a">{date.start}</f:format.date></b><br>
|
<b><f:format.date format="%a">{date.start}</f:format.date></b><br>
|
||||||
|
@ -11,30 +11,45 @@
|
||||||
{date.event.region.title}<br>
|
{date.event.region.title}<br>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<h4>{date.event.title}</h4>
|
|
||||||
<h5>{date.event.teaser}</h5>
|
|
||||||
<f:format.crop maxCharacters="150">{date.event.details}</f:format.crop>
|
|
||||||
<f:if condition="{date.event.highlight}">
|
<f:if condition="{date.event.highlight}">
|
||||||
<f:then>
|
<f:then>
|
||||||
<b>Hightlight</b>
|
<b>Hightlight</b>
|
||||||
</f:then>
|
</f:then>
|
||||||
</f:if>
|
</f:if>
|
||||||
|
<h4>
|
||||||
|
<f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}">
|
||||||
|
{date.event.title}
|
||||||
|
</f:link.action>
|
||||||
|
</h4>
|
||||||
|
<p><strong>{date.event.teaser}</strong></p>
|
||||||
|
<f:format.crop maxCharacters="150">{date.event.details}</f:format.crop>
|
||||||
|
<pre style="margin-top:15px; font-size:80%;">
|
||||||
|
DEBUGGING:
|
||||||
|
GLOBAL EVENT ID: {date.event.globalId}
|
||||||
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-4">
|
||||||
<f:if condition="{date.event.images}">
|
<f:if condition="{date.event.images}">
|
||||||
<f:then>
|
<f:then>
|
||||||
<f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}">
|
<f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}">
|
||||||
<f:image src="{date.event.images.originalResource.originalFile.uid}" alt="{date.event.title}" title="{date.event.title}" width="480c" height="240c" class="img-fluid img-thumbnail"/>
|
<f:image src="{date.event.images.originalResource.originalFile.uid}" alt="" width="400c" height="280c" class="img-fluid img-thumbnail"/>
|
||||||
</f:link.action>
|
</f:link.action>
|
||||||
</f:then>
|
</f:then>
|
||||||
<f:else>
|
<f:else>
|
||||||
<f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}">
|
<f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}">
|
||||||
<f:image src="{settings.defaultImagePath}" alt="{date.event.title}" title="{date.event.title}" width="480c" height="320c" class="img-fluid img-thumbnail"/>
|
<img src="{settings.defaultImagePath}" alt="Dummy" width="480c" height="320c" class="img-fluid img-thumbnail"/>
|
||||||
</f:link.action>
|
</f:link.action>
|
||||||
</f:else>
|
</f:else>
|
||||||
</f:if>
|
</f:if>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<f:if condition="{index.isLast}">
|
||||||
|
<f:then>
|
||||||
|
</f:then>
|
||||||
|
<f:else>
|
||||||
|
<div class="mb-3 border-bottom"></div>
|
||||||
|
</f:else>
|
||||||
|
</f:if>
|
||||||
</f:for>
|
</f:for>
|
||||||
</f:widget.paginate>
|
</f:widget.paginate>
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
{namespace wrm=Wrm\Events\ViewHelpers}
|
{namespace wrm=Wrm\Events\ViewHelpers}
|
||||||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
|
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-8 mb-5">
|
<div class="col-12 mb-5">
|
||||||
<!-- TODO bg color classes not loaded in scss -->
|
<!-- TODO bg color classes not loaded in scss -->
|
||||||
<f:form action="search" controller="Date" method="post" id="events_search" name="events_search">
|
<f:form action="list" controller="Date" pluginName="DateList" method="get" addQueryString="1" id="events_search" name="events_search">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
@ -60,6 +61,5 @@
|
||||||
<f:form.submit value="Suchen" class="btn btn-primary" />
|
<f:form.submit value="Suchen" class="btn btn-primary" />
|
||||||
</div>
|
</div>
|
||||||
</f:form>
|
</f:form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -1,60 +1,68 @@
|
||||||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
|
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
|
||||||
|
<f:layout name="Default" />
|
||||||
|
<f:section name="content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 mb-5">
|
||||||
|
<!-- TODO bg color classes not loaded in scss -->
|
||||||
|
<f:form action="list" controller="Date" pluginName="DateList" method="get" addQueryString="1" id="events_search" name="events_search">
|
||||||
|
|
||||||
<f:render partial="Date/SearchForm" arguments="{searchword: searchword, dates: dates, regions: regions, selRegion: selRegion, start: start, end: end}"/>
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="searchword">Suchwort</label>
|
||||||
|
<f:form.textfield type="text" class="form-control" id="searchword" name="searchword" value="{searchword}" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<hr class="mt-2 mb-4">
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="start">Datum von</label>
|
||||||
|
<div class="input-group date" id="date_start" data-target-input="nearest">
|
||||||
|
<f:form.textfield type="text" class="form-control datetimepicker-input" id="start" name="start" value="{start}" additionalAttributes="{data-target: '#date_start'}" />
|
||||||
|
<div class="input-group-append" data-target="#date_start" data-toggle="datetimepicker">
|
||||||
|
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="end">Datum bis</label>
|
||||||
|
<div class="input-group date" id="date_end" data-target-input="nearest">
|
||||||
|
<f:form.textfield type="text" class="form-control datetimepicker-input" id="start" name="end" value="{end}" additionalAttributes="{data-target: '#date_end'}" />
|
||||||
|
<div class="input-group-append" data-target="#date_end" data-toggle="datetimepicker">
|
||||||
|
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<f:widget.paginate objects="{dates}" as="paginatedDates" configuration="{itemsPerPage: 25, insertAbove: 0, insertBelow: 1, maximumNumberOfLinks: 5, addQueryStringMethod: 'POST,GET'}">
|
<div class="row">
|
||||||
<f:for each="{paginatedDates}" as="date" iteration="index">
|
<div class="col-3">
|
||||||
<div class="row mt-3 mb-3 pb-3">
|
<div class="form-check">
|
||||||
<div class="col-2">
|
<f:form.radio class="form-check-input" name="region" value="{region.uid}" checked="{selRegion}==0" id="radio_0"/>
|
||||||
<b><f:format.date format="H:i">{date.start}</f:format.date></b><br>
|
<label class="form-check-label" for="radio_0">Alle Städte</label>
|
||||||
<b><f:format.date format="%a">{date.start}</f:format.date></b><br>
|
</div>
|
||||||
<b><f:format.date format="d.m.">{date.start}</f:format.date></b><br>
|
</div>
|
||||||
{date.event.region.title}<br>
|
|
||||||
</div>
|
<f:for each="{regions}" as="region">
|
||||||
<div class="col-6">
|
<div class="col-3">
|
||||||
<f:if condition="{date.event.highlight}">
|
<div class="form-check">
|
||||||
<f:then>
|
<f:form.radio class="form-check-input" name="region" value="{region.uid}" checked="{selRegion}=={region.uid}" id="radio_{region.uid}"/>
|
||||||
<b>Hightlight</b>
|
<label class="form-check-label" for="radio_{region.uid}">{region.title}</label>
|
||||||
</f:then>
|
|
||||||
</f:if>
|
|
||||||
<h4>
|
|
||||||
<f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}">
|
|
||||||
{date.event.title}
|
|
||||||
</f:link.action>
|
|
||||||
</h4>
|
|
||||||
<p><strong>{date.event.teaser}</strong></p>
|
|
||||||
<f:format.crop maxCharacters="150">{date.event.details}</f:format.crop>
|
|
||||||
<pre style="margin-top:15px; font-size:80%;">
|
|
||||||
DEBUGGING:
|
|
||||||
GLOBAL EVENT ID: {date.event.globalId}
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
<div class="col-4">
|
|
||||||
<f:if condition="{date.event.images}">
|
|
||||||
<f:then>
|
|
||||||
<f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}">
|
|
||||||
<f:image src="{date.event.images.originalResource.originalFile.uid}" alt="" width="400c" height="280c" class="img-fluid img-thumbnail"/>
|
|
||||||
</f:link.action>
|
|
||||||
</f:then>
|
|
||||||
<f:else>
|
|
||||||
<f:link.action pageUid="{settings.showPID}" action="show" controller="Date" arguments="{date: date}">
|
|
||||||
<img src="{settings.defaultImagePath}" alt="Dummy" width="480c" height="320c" class="img-fluid img-thumbnail"/>
|
|
||||||
</f:link.action>
|
|
||||||
</f:else>
|
|
||||||
</f:if>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<f:if condition="{index.isLast}">
|
|
||||||
<f:then>
|
|
||||||
</f:then>
|
|
||||||
<f:else>
|
|
||||||
<div class="mb-3 border-bottom"></div>
|
|
||||||
</f:else>
|
|
||||||
</f:if>
|
|
||||||
</f:for>
|
</f:for>
|
||||||
</f:widget.paginate>
|
</div>
|
||||||
|
<div class="form-group mt-3">
|
||||||
|
<f:form.submit value="Suchen" class="btn btn-primary" />
|
||||||
|
</div>
|
||||||
|
</f:form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</f:section>
|
||||||
|
|
||||||
</html>
|
</html>
|
68
Resources/Private/Templates/Date/SearchHtml.html
Normal file
68
Resources/Private/Templates/Date/SearchHtml.html
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
|
||||||
|
<f:layout name="Default" />
|
||||||
|
<f:section name="content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 mb-5">
|
||||||
|
<!-- TODO bg color classes not loaded in scss -->
|
||||||
|
<form action="{settings.resultPID}" controller="Date" extensionName="events" method="get" addQueryString="1" id="events_search" name="events_search">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="searchword">Suchwort</label>
|
||||||
|
<input type="text" class="form-control" id="searchword" name="searchword" value="{searchword}" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="start">Datum von</label>
|
||||||
|
<div class="input-group date" id="date_start" data-target-input="nearest">
|
||||||
|
<input type="text" class="form-control datetimepicker-input" id="start" name="start" value="{start}" additionalAttributes="{data-target: '#date_start'}" />
|
||||||
|
<div class="input-group-append" data-target="#date_start" data-toggle="datetimepicker">
|
||||||
|
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="end">Datum bis</label>
|
||||||
|
<div class="input-group date" id="date_end" data-target-input="nearest">
|
||||||
|
<input type="text" class="form-control datetimepicker-input" id="end" name="end" value="{end}" additionalAttributes="{data-target: '#date_end'}" />
|
||||||
|
<div class="input-group-append" data-target="#date_end" data-toggle="datetimepicker">
|
||||||
|
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-3">
|
||||||
|
<div class="form-check">
|
||||||
|
<input type="radio" class="form-check-input" name="region" value="{region.uid}" checked="{selRegion}==0" id="radio_0"/>
|
||||||
|
<label class="form-check-label" for="radio_0">Alle Städte</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<f:for each="{regions}" as="region">
|
||||||
|
<div class="col-3">
|
||||||
|
<div class="form-check">
|
||||||
|
<input type="radio" class="form-check-input" name="region" value="{region.uid}" checked="{selRegion}=={region.uid}" id="radio_{region.uid}"/>
|
||||||
|
<label class="form-check-label" for="radio_{region.uid}">{region.title}</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</f:for>
|
||||||
|
</div>
|
||||||
|
<div class="form-group mt-3">
|
||||||
|
<input type="submit" value="Suchen" class="btn btn-primary" />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</f:section>
|
||||||
|
|
||||||
|
</html>
|
|
@ -18,6 +18,31 @@ call_user_func(
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
|
||||||
|
'Wrm.Events',
|
||||||
|
'DateSearch',
|
||||||
|
[
|
||||||
|
'Date' => 'search'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
|
||||||
|
'Wrm.Events',
|
||||||
|
'DateList',
|
||||||
|
[
|
||||||
|
'Date' => 'list'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
|
||||||
|
|
||||||
|
$iconRegistry->registerIcon(
|
||||||
|
'events-plugin',
|
||||||
|
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
|
||||||
|
['source' => 'EXT:events/Resources/Public/Icons/user_plugin_events.svg']
|
||||||
|
);
|
||||||
|
|
||||||
// wizards
|
// wizards
|
||||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
|
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
|
||||||
'mod {
|
'mod {
|
||||||
|
@ -37,14 +62,6 @@ call_user_func(
|
||||||
}
|
}
|
||||||
}'
|
}'
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
|
|
||||||
|
|
||||||
$iconRegistry->registerIcon(
|
|
||||||
'events-plugin',
|
|
||||||
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
|
|
||||||
['source' => 'EXT:events/Resources/Public/Icons/user_plugin_events.svg']
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue