Skip to content

Commit

Permalink
#35 implement plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
digedag committed Oct 5, 2024
1 parent 0776fde commit b463b9a
Show file tree
Hide file tree
Showing 26 changed files with 535 additions and 86 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace System25\T3sports\Action;
namespace System25\T3sports\Frontend\Action;

use ArrayObject;
use Exception;
Expand All @@ -17,7 +17,7 @@
/***************************************************************
* Copyright notice
*
* (c) 2010-2020 Rene Nitzsche ([email protected])
* (c) 2010-2024 Rene Nitzsche ([email protected])
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
Expand Down Expand Up @@ -156,6 +156,6 @@ public function getTemplateName()

public function getViewClassName()
{
return \System25\T3sports\View\CoachStats::class;
return \System25\T3sports\Frontend\View\CoachStats::class;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace System25\T3sports\Action;
namespace System25\T3sports\Frontend\Action;

use Exception;
use Sys25\RnBase\Database\Connection;
Expand All @@ -11,7 +11,7 @@
/***************************************************************
* Copyright notice
*
* (c) 2010-2022 Rene Nitzsche ([email protected])
* (c) 2010-2024 Rene Nitzsche ([email protected])
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
Expand Down Expand Up @@ -86,6 +86,6 @@ protected function getTemplateName()

protected function getViewClassName()
{
return \System25\T3sports\View\DBStats::class;
return \System25\T3sports\Frontend\View\DBStats::class;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace System25\T3sports\Action;
namespace System25\T3sports\Frontend\Action;

use ArrayObject;
use Exception;
Expand All @@ -18,7 +18,7 @@
/***************************************************************
* Copyright notice
*
* (c) 2010-2023 Rene Nitzsche ([email protected])
* (c) 2010-2024 Rene Nitzsche ([email protected])
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
Expand Down Expand Up @@ -114,8 +114,7 @@ private function findData(RequestInterface $request, $viewData, $type)
* Pagebrowser vorbereiten.
* Für die Statistik benötigen wir eine spezielle Anfrage zu Ermittlung der Listenlänge.
*
* @param string $confid
* Die Confid des PageBrowsers. z.B. myview.org.pagebrowser ohne Punkt!
* @param string $confid Die Confid des PageBrowsers. z.B. myview.org.pagebrowser ohne Punkt!
* @param ConfigurationInterface $configurations
* @param ArrayObject $viewdata
* @param array $fields
Expand Down Expand Up @@ -163,6 +162,6 @@ protected function getTemplateName()

protected function getViewClassName()
{
return \System25\T3sports\View\PlayerStats::class;
return \System25\T3sports\Frontend\View\PlayerStats::class;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace System25\T3sports\Action;
namespace System25\T3sports\Frontend\Action;

use ArrayObject;
use Exception;
Expand All @@ -17,7 +17,7 @@
/***************************************************************
* Copyright notice
*
* (c) 2010-2022 Rene Nitzsche ([email protected])
* (c) 2010-2024 Rene Nitzsche ([email protected])
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
Expand Down Expand Up @@ -157,6 +157,6 @@ public function getTemplateName()

public function getViewClassName()
{
return \System25\T3sports\View\RefereeStats::class;
return \System25\T3sports\Frontend\View\RefereeStats::class;
}
}
77 changes: 77 additions & 0 deletions Classes/Frontend/Action/SeriesList.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php

namespace System25\T3sports\Frontend\Action;

use Sys25\RnBase\Frontend\Controller\AbstractAction;
use Sys25\RnBase\Frontend\Filter\BaseFilter;
use Sys25\RnBase\Frontend\Request\RequestInterface;
use Sys25\RnBase\Frontend\View\Marker\ListView;
use System25\T3sports\Repository\SeriesRepository;
use tx_rnbase;

/***************************************************************
* Copyright notice
*
* (c) 2010-2024 Rene Nitzsche ([email protected])
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

/**
* Controller.
*/
class SeriesList extends AbstractAction
{
private $seriesRepo;

public function __construct(?SeriesRepository $seriesRepo = null)
{
$this->seriesRepo = $seriesRepo ?: tx_rnbase::makeInstance(SeriesRepository::class);
}

/**
* @param RequestInterface $request
*
* @return string error msg or null
*/
protected function handleRequest(RequestInterface $request)
{
$viewData = $request->getViewContext();

$filter = BaseFilter::createFilter($request, $this->getConfId().'filter.');
$fields = [];
$options = [];
$filter->init($fields, $options);

$items = $this->seriesRepo->search($fields, $options);

$viewData->offsetSet('items', $items);

return null;
}

protected function getTemplateName()
{
return 'serieslist';
}

protected function getViewClassName()
{
return ListView::class;
}
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<?php

namespace System25\T3sports\Marker;
namespace System25\T3sports\Frontend\Marker;

use Sys25\RnBase\Frontend\Marker\BaseMarker;
use Sys25\RnBase\Frontend\Marker\FormatUtil;
use Sys25\RnBase\Frontend\Marker\MarkerUtility;
use Sys25\RnBase\Frontend\Marker\Templates;
use Sys25\RnBase\Utility\Misc;
use System25\T3sports\Frontend\Marker\ProfileMarker;
use System25\T3sports\Model\CoachStat;
use System25\T3sports\Model\Profile;
use tx_rnbase;
use tx_rnbase_util_FormatUtil;

/***************************************************************
* Copyright notice
*
* (c) 2010-2022 Rene Nitzsche ([email protected])
* (c) 2010-2024 Rene Nitzsche ([email protected])
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
Expand Down Expand Up @@ -42,7 +43,7 @@ class CoachStatsMarker extends BaseMarker
/**
* @param string $template das HTML-Template
* @param CoachStat $item
* @param tx_rnbase_util_FormatUtil $formatter der zu verwendente Formatter
* @param FormatUtil $formatter der zu verwendente Formatter
* @param string $confId Pfad der TS-Config des Spiels, z.B. 'listView.match.'
* @param string $marker Name des Markers für ein Spiel, z.B. MATCH
*
Expand All @@ -63,7 +64,7 @@ public function parseTemplate($template, $item, &$formatter, $confId, $marker =
], $this);

// Das Markerarray wird gefüllt
$ignore = self::findUnusedCols($item->getProperties(), $template, $marker);
$ignore = MarkerUtility::findUnusedAttributes($item, $template, $marker);
$markerArray = $formatter->getItemMarkerArrayWrapped($item->getProperties(), $confId, $ignore, $marker.'_');
$wrappedSubpartArray = [];
$subpartArray = [];
Expand Down Expand Up @@ -92,7 +93,7 @@ public function parseTemplate($template, $item, &$formatter, $confId, $marker =
*
* @param string $template
* @param CoachStat $item
* @param tx_rnbase_util_FormatUtil $formatter
* @param FormatUtil $formatter
* @param string $confId
* @param string $markerPrefix
*
Expand Down Expand Up @@ -144,7 +145,7 @@ private function prepareFields($item, $template, $markerPrefix)
* @param array $markerArray
* @param array $wrappedSubpartArray
* @param string $confId
* @param tx_rnbase_util_FormatUtil $formatter
* @param FormatUtil $formatter
*/
private function prepareLinks($item, $marker, &$markerArray, &$subpartArray, &$wrappedSubpartArray, $confId, &$formatter, $template)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

namespace System25\T3sports\Marker;
namespace System25\T3sports\Frontend\Marker;

use Sys25\RnBase\Frontend\Marker\BaseMarker;
use Sys25\RnBase\Frontend\Marker\FormatUtil;
use Sys25\RnBase\Frontend\Marker\MarkerUtility;
use Sys25\RnBase\Frontend\Marker\Templates;
use Sys25\RnBase\Utility\Misc;
use System25\T3sports\Frontend\Marker\ClubMarker;
Expand All @@ -13,12 +15,11 @@
use System25\T3sports\Model\PlayerStat;
use System25\T3sports\Model\Profile;
use tx_rnbase;
use tx_rnbase_util_FormatUtil;

/***************************************************************
* Copyright notice
*
* (c) 2010-2022 Rene Nitzsche ([email protected])
* (c) 2010-2024 Rene Nitzsche ([email protected])
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
Expand Down Expand Up @@ -46,7 +47,7 @@ class PlayerStatsMarker extends BaseMarker
/**
* @param string $template das HTML-Template
* @param PlayerStat $item
* @param tx_rnbase_util_FormatUtil $formatter der zu verwendente Formatter
* @param FormatUtil $formatter der zu verwendente Formatter
* @param string $confId Pfad der TS-Config des Spiels, z.B. 'listView.match.'
* @param string $marker Name des Markers für ein Spiel, z.B. MATCH
*
Expand All @@ -67,7 +68,7 @@ public function parseTemplate($template, $item, &$formatter, $confId, $marker =
], $this);

// Das Markerarray wird gefüllt
$ignore = self::findUnusedCols($item->getProperties(), $template, $marker);
$ignore = MarkerUtility::findUnusedAttributes($item, $template, $marker);
$markerArray = $formatter->getItemMarkerArrayWrapped($item->getProperties(), $confId, $ignore, $marker.'_');
$wrappedSubpartArray = [];
$subpartArray = [];
Expand Down Expand Up @@ -101,7 +102,7 @@ public function parseTemplate($template, $item, &$formatter, $confId, $marker =
*
* @param string $template
* @param PlayerStat $item
* @param tx_rnbase_util_FormatUtil $formatter
* @param FormatUtil $formatter
* @param string $confId
* @param string $markerPrefix
*
Expand All @@ -127,7 +128,7 @@ protected function addPlayer($template, $item, $formatter, $confId, $markerPrefi
*
* @param string $template
* @param PlayerStat $item
* @param tx_rnbase_util_FormatUtil $formatter
* @param FormatUtil $formatter
* @param string $confId
* @param string $markerPrefix
*
Expand All @@ -153,7 +154,7 @@ protected function addCompetition($template, $item, $formatter, $confId, $marker
*
* @param string $template
* @param PlayerStat $item
* @param tx_rnbase_util_FormatUtil $formatter
* @param FormatUtil $formatter
* @param string $confId
* @param string $markerPrefix
*
Expand Down Expand Up @@ -205,7 +206,7 @@ private function prepareFields($item, $template, $markerPrefix)
* @param array $markerArray
* @param array $wrappedSubpartArray
* @param string $confId
* @param tx_rnbase_util_FormatUtil $formatter
* @param FormatUtil $formatter
*/
private function prepareLinks($item, $marker, &$markerArray, &$subpartArray, &$wrappedSubpartArray, $confId, &$formatter, $template)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<?php

namespace System25\T3sports\Marker;
namespace System25\T3sports\Frontend\Marker;

use Sys25\RnBase\Frontend\Marker\BaseMarker;
use Sys25\RnBase\Frontend\Marker\FormatUtil;
use Sys25\RnBase\Frontend\Marker\MarkerUtility;
use Sys25\RnBase\Frontend\Marker\Templates;
use Sys25\RnBase\Utility\Misc;
use System25\T3sports\Frontend\Marker\ProfileMarker;
use System25\T3sports\Model\Profile;
use System25\T3sports\Model\RefereeStat;
use tx_rnbase;
use tx_rnbase_util_FormatUtil;

/***************************************************************
* Copyright notice
*
* (c) 2010-2022 Rene Nitzsche ([email protected])
* (c) 2010-2024 Rene Nitzsche ([email protected])
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
Expand Down Expand Up @@ -42,7 +43,7 @@ class RefereeStatsMarker extends BaseMarker
/**
* @param string $template das HTML-Template
* @param RefereeStat $item
* @param tx_rnbase_util_FormatUtil $formatter der zu verwendente Formatter
* @param FormatUtil $formatter der zu verwendente Formatter
* @param string $confId Pfad der TS-Config des Spiels, z.B. 'listView.match.'
* @param string $marker Name des Markers für ein Spiel, z.B. MATCH
*
Expand All @@ -63,7 +64,7 @@ public function parseTemplate($template, $item, &$formatter, $confId, $marker =
], $this);

// Das Markerarray wird gefüllt
$ignore = self::findUnusedCols($item->getProperty(), $template, $marker);
$ignore = MarkerUtility::findUnusedAttributes($item, $template, $marker);
$markerArray = $formatter->getItemMarkerArrayWrapped($item->getProperty(), $confId, $ignore, $marker.'_');
$wrappedSubpartArray = [];
$subpartArray = [];
Expand Down Expand Up @@ -92,7 +93,7 @@ public function parseTemplate($template, $item, &$formatter, $confId, $marker =
*
* @param string $template
* @param RefereeStat $item
* @param tx_rnbase_util_FormatUtil $formatter
* @param FormatUtil $formatter
* @param string $confId
* @param string $markerPrefix
*
Expand Down Expand Up @@ -144,7 +145,7 @@ private function prepareFields($item, $template, $markerPrefix)
* @param array $markerArray
* @param array $wrappedSubpartArray
* @param string $confId
* @param tx_rnbase_util_FormatUtil $formatter
* @param FormatUtil $formatter
*/
private function prepareLinks($item, $marker, &$markerArray, &$subpartArray, &$wrappedSubpartArray, $confId, &$formatter, $template)
{
Expand Down
Loading

0 comments on commit b463b9a

Please sign in to comment.