Skip to content

Commit

Permalink
Merge branch 'surfcamp-team-jacuzzi-fil'
Browse files Browse the repository at this point in the history
# Conflicts:
#	local_packages/psi/Resources/Public/Css/main.css
  • Loading branch information
filippos-gmk committed Apr 12, 2024
2 parents 2dfbd00 + cecb7c2 commit 6e82d98
Show file tree
Hide file tree
Showing 6 changed files with 713 additions and 5 deletions.
59 changes: 59 additions & 0 deletions local_packages/psi/Classes/ViewHelpers/SubpagesViewHelper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

namespace Jacuzzi\Psi\ViewHelpers;

use TYPO3\CMS\Core\Database\Connection;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
class SubpagesViewHelper extends AbstractViewHelper
{

use CompileWithRenderStatic;

/**
* Initialize arguments
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('uid', 'int', 'the UID of the Page to Look for Subpages', true);
}

/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
*/
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
): array {

$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('pages');
$resultsArray = [];
$id = (int)$arguments['uid'];

$results = $queryBuilder
->select('*')
->from('pages')
->where(
$queryBuilder->expr()->eq(
'pid',
$queryBuilder->createNamedParameter($id, Connection::PARAM_INT)
)
)
->executeQuery();

while ($row = $results->fetchAssociative()) {
array_push($resultsArray, $row);
}
return $resultsArray;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
<source>Download</source>
<target>Descargar</target>
</trans-unit>
<trans-unit id="news-readmore" resname="news-readmore">
<source>Read more</source>
<target>Sigue leyendo</target>
</trans-unit>
</body>
</file>
</xliff>
3 changes: 3 additions & 0 deletions local_packages/psi/Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
<trans-unit id="download-button" resname="download-button">
<source>Download</source>
</trans-unit>
<trans-unit id="news-readmore" resname="news-readmore">
<source>Read more</source>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
{data.header}
{namespace uzi=Jacuzzi\Psi\ViewHelpers}
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:variable name="subpages"><uzi:subpages uid="{data.pages}"/></f:variable>
<f:if condition="{subpages}">
<f:then>
<div class="latestnews-container">
<div class="latestnews-inner">
<ul class="latestnews-wrap">
<f:for as="page" each="{subpages}">
<li class="latestnews-single profile__card">
<div class="latestnews-single-header">
<f:if condition="{page.eventdatetime}">
<f:then>
<p><f:format.date format="d.m.Y" date="{page.eventdatetime}"></f:format.date></p>
</f:then>
</f:if>
<f:if condition="{page.location}">
<f:then>
<p>{page.location}</p>
</f:then>
</f:if>
</div>
<h4 class="latestnews-single-title">
{page.title}
</h4>
<f:link.page class="latestnews-single-link" pageUid="{page.uid}">
<f:translate key="news-readmore" extensionName="psi"/>
<svg class="svg-icon" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path d="M640 768c-12.8 0-21.333333-4.266667-29.866667-12.8-17.066667-17.066667-17.066667-42.666667 0-59.733333l213.333333-213.333333c17.066667-17.066667 42.666667-17.066667 59.733333 0s17.066667 42.666667 0 59.733333l-213.333333 213.333333C661.333333 763.733333 652.8 768 640 768z" />
<path d="M853.333333 554.666667c-12.8 0-21.333333-4.266667-29.866667-12.8l-213.333333-213.333333c-17.066667-17.066667-17.066667-42.666667 0-59.733333s42.666667-17.066667 59.733333 0l213.333333 213.333333c17.066667 17.066667 17.066667 42.666667 0 59.733333C874.666667 550.4 866.133333 554.666667 853.333333 554.666667z" />
<path d="M853.333333 554.666667 170.666667 554.666667c-25.6 0-42.666667-17.066667-42.666667-42.666667s17.066667-42.666667 42.666667-42.666667l682.666667 0c25.6 0 42.666667 17.066667 42.666667 42.666667S878.933333 554.666667 853.333333 554.666667z" />
</svg>
</f:link.page>
</li>
</f:for>
</ul>
</div>
</div>
</f:then>
</f:if>
</html>
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:form action="login" actionUri="{actionUri}" target="_top" fieldNamePrefix="">
<f:form.submit value="{f:translate(key: 'logout')}" name="submit" id="tx-felogin-input-logout"/>


<div class="felogin-hidden">
<f:form.hidden name="logintype" value="logout"/>
Expand Down
Loading

0 comments on commit 6e82d98

Please sign in to comment.