Commit 9ed950d3 authored by Christian Knauf's avatar Christian Knauf

[TASK] Feature list view 2.0.1

parent 296d6bd2
......@@ -42,30 +42,14 @@ class FeatureController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControll
*/
public function listFeaturesAction()
{
$featureArray=[];
if ($this->request->hasArgument('featureArea')) {
$featureArea=$this->request->getArgument('featureArea');
}
$features = $this->featureRepository->findByFilter($this->settings, $featureArea);
/* @var \T3o\Typo3Roadmap\Domain\Model\Feature $feature */
foreach ($features as $feature) {
$featureArray[$feature->getTypo3releasemajorversion()->getTitle()][$feature->getTypo3releaseminorversion()->getVersion()][]=$feature;
if($this->settings[featurearea]!=""){
$featureArea=$this->featureAreaRepository->findByUid($this->settings[featurearea]);
$this->view->assign('featureArea', $featureArea);
}
$this->view->assign('features', $featureArray);
}
/**
* action showFeature
*
* @param \T3o\Typo3Roadmap\Domain\Model\Feature $feature
* @return void
*/
public function showFeatureAction(\T3o\Typo3Roadmap\Domain\Model\Feature $feature)
{
$this->view->assign('feature', $feature);
$features = $this->featureRepository->findByFilter($this->settings);
$this->view->assign('features', $features);
}
/**
......@@ -98,14 +82,5 @@ class FeatureController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControll
$this->view->assign('featureAreas', $featureAreas);
}
/**
* action listFeatures
*
* @return void
*/
public function listFeatureAreasAction()
{
$featureAreas = $this->featureAreaRepository->findAll();
$this->view->assign('featureAreas', $featureAreas);
}
}
......@@ -42,7 +42,7 @@ class FeatureRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
* @param string $featureArea
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
*/
public function findByFilter($setting, $featureArea='')
public function findByFilter($setting)
{
$query = $this->createQuery();
$query->getQuerySettings()->setRespectStoragePage(false);
......@@ -62,10 +62,6 @@ class FeatureRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
$constraints[] = $query->equals('featureArea', (int)$setting['featurearea']);
}
if ($featureArea != '') {
$constraints[] = $query->equals('featureArea', (int)$featureArea);
}
$query->matching($query->logicalAnd($constraints));
return $query->execute();
......
......@@ -24,6 +24,15 @@
</config>
</TCEforms>
</settings.feature>
<settings.showFeatureArea>
<TCEforms>
<exclude>1</exclude>
<label>Show Feature Area</label>
<config>
<type>check</type>
</config>
</TCEforms>
</settings.showFeatureArea>
</el>
</ROOT>
</sDEF>
......
mod.wizards {
newContentElement {
wizardItems {
t3o {
elements {
typo3roadmap_features {
iconIdentifier = default-icon
title = LLL:EXT:typo3_roadmap/Resources/Private/Language/locallang_db.xlf:tx_typo3roadmap_domain_model_featurelist.contentelement.title
description = LLL:EXT:typo3_roadmap/Resources/Private/Language/locallang_db.xlf:tx_typo3roadmap_domain_model_featurelist.contentelement.description
tt_content_defValues {
CType = list
list_type = typo3roadmap_features
}
}
}
}
}
}
}
......@@ -4,12 +4,6 @@ plugin.tx_typo3roadmap {
partialRootPath = EXT:typo3_roadmap/Resources/Private/Partials/
layoutRootPath = EXT:typo3_roadmap/Resources/Private/Layouts/
}
settings {
# customsubcategory=100=General
# cat=typo3_roadmap/100/100; type=int; label = Features Area Page Id
featuresAreaPageId =
}
persistence {
storagePid = 185
}
......
......@@ -4,9 +4,6 @@ plugin.tx_typo3roadmap {
partialRootPath = {$plugin.tx_typo3roadmap_roadmap.view.partialRootPath}
layoutRootPath = {$plugin.tx_typo3roadmap_roadmap.view.layoutRootPath}
}
settings {
featuresAreaPageId = {$plugin.tx_typo3roadmap_roadmap.settings.featuresAreaPageId}
}
persistence {
storagePid = {$plugin.tx_typo3roadmap_roadmap.persistence.storagePid}
}
......
......@@ -91,6 +91,12 @@
<trans-unit id="tx_typo3roadmap_domain_model_feature.contentelement.description">
<source>Feature Contentelement</source>
</trans-unit>
<trans-unit id="tx_typo3roadmap_domain_model_featurelist.contentelement.title">
<source>Feature List</source>
</trans-unit>
<trans-unit id="tx_typo3roadmap_domain_model_featurelist.contentelement.description">
<source>Feature List Contentelement</source>
</trans-unit>
<trans-unit id="tx_typo3roadmap_domain_model_featurearea.contentelement.title">
<source>Feature Area</source>
</trans-unit>
......
......@@ -2,7 +2,7 @@
<div class="row">
<div class="col-8">
<h1 class="">{feature.header}</h1>
<p>Introduced in version {feature.typo3releaseminorversion.version}</p>
<p>Introduced in version {feature.typo3releaseminorversion.version} <f:if condition="{settings.showFeatureArea}"><f:link.typolink parameter="{feature.featureArea.page}">Feature Area</f:link.typolink></f:if></p>
<f:format.html>{feature.description}</f:format.html>
<p><f:link.typolink parameter="{feature.link}" class="btn btn-primary mr-3" target="_blank">Documentation</f:link.typolink></p>
</div>
......
......@@ -3,7 +3,9 @@
<div class="col-8">
<h1 class="">{featureArea.title}</h1>
<f:format.html>{featureArea.description}</f:format.html>
<p><f:link.action action="listFeatures" pluginName="featurearea" pageUid="{settings.featuresAreaPageId}" class="btn btn-primary mr-3" arguments="{featureArea : featureArea}">Features</f:link.action></p>
<f:if condition="{settings.featurearea}==''">
<p><f:link.typolink parameter="{featureArea.page}" class="btn btn-primary mr-3">Features</f:link.typolink></p>
</f:if>
</div>
<div class="col-4">
<f:for each="{featureArea.images}" as="image">
......
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default"/>
<f:section name="main">
<div class="container">
<f:for each="{featureAreas}" as="featureArea">
<f:render partial="Feature/ShowFeatureArea.html" arguments="{featureArea:featureArea}"/>
</f:for>
</div>
</f:section>
</html>
\ No newline at end of file
......@@ -2,23 +2,13 @@
<f:layout name="Default"/>
<f:section name="main">
<div class="container">
<f:if condition="{featureArea}">
<f:render partial="Feature/ShowFeatureArea.html" arguments="{featureArea:featureArea}"/>
</f:if>
<f:if condition="{features}">
<f:then>
<f:for each="{features}" key="majorVersion" as="featureVersion">
<h2>{majorVersion}</h2>
<f:for each="{featureVersion}" key="version" as="feature">
<h3>{version}</h3>
<f:for each="{feature}" as="feature2">
<div class="row">
<div class="col-12">
<f:link.action action="showFeature" pluginName="featurearea" pageUid="{settings.featuresAreaPageId}" arguments="{feature : feature2, featureArea:feature.featureArea}">
{feature2.header}
</f:link.action>
</div>
</div>
</f:for>
</f:for>
<f:for each="{features}" as="feature">
<f:render partial="Feature/ShowFeature.html" arguments="{_all}"/>
</f:for>
</f:then>
<f:else>
......
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default"/>
<f:section name="main">
<f:render partial="Feature/ShowFeature.html" arguments="{_all}"/>
</f:section>
</html>
\ No newline at end of file
......@@ -18,18 +18,7 @@ if (!defined('TYPO3_MODE')) {
'T3o.' . $_EXTKEY,
'Features',
[
'Feature' => 'listFeatures, showFeature'
],
[
'Feature' => ''
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'T3o.' . $_EXTKEY,
'Featurearea',
[
'Feature' => 'listFeatureAreas, showFeatureArea, listFeatures, showFeature'
'Feature' => 'listFeatures'
],
[
'Feature' => ''
......
......@@ -15,12 +15,6 @@ if (!defined('TYPO3_MODE')) {
'TYPO3 Features'
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'Featurearea',
'TYPO3 Feature Areas'
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'Featureshowrecords',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment