Merge branch 'release/2020.01-09'

This commit is contained in:
Björn Fromme
2020-01-28 17:40:03 +01:00
10 changed files with 358 additions and 1 deletions
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
## Description: Deploy project from within container
## Usage: deploy
php vendor/bin/dep deploy
@@ -4,7 +4,7 @@
<header/>
<body>
<trans-unit id="mlang_tabs_tab">
<source>E&amp;P</source>
<source>E&amp;P Funktionen</source>
</trans-unit>
<trans-unit id="mlang_labels_tabdescr">
<source>Produktspezifische Funktionen</source>
@@ -0,0 +1,85 @@
<?php
namespace EP\EpTheme\Controller;
/***************************************************************
*
* Copyright notice
*
* (c) 2020 Björn Fromme <[email protected]>, dreipunktnull
*
* 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 3 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!
***************************************************************/
use EP\EpTheme\Domain\Repository\PageRepository;
use TYPO3\CMS\Backend\View\BackendTemplateView;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
class BackendController extends ActionController
{
/**
* Backend Template Container
*
* @var BackendTemplateView
*/
protected $defaultViewObjectName = BackendTemplateView::class;
/**
* BackendTemplateContainer
*
* @var BackendTemplateView
*/
protected $view;
/**
* @var int
*/
protected $pageUid;
/**
* @var PageRepository
*/
protected $pageRepository;
/**
* @param PageRepository $pageRepository
*/
public function __construct(PageRepository $pageRepository)
{
parent::__construct();
$this->pageRepository = $pageRepository;
}
public function initializeAction()
{
$this->pageUid = (integer)GeneralUtility::_GET('id');
parent::initializeAction();
}
public function listPagesAction()
{
$pages = $this->pageRepository->findPagesByPid($this->pageUid);
$this->view->assign('pages', $pages);
}
}
@@ -0,0 +1,134 @@
<?php
namespace EP\EpTheme\Domain\Model;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
class Page extends AbstractEntity
{
/**
* @var int
*/
protected $uid;
/**
* @var int
*/
protected $pid;
/**
* @var bool
*/
protected $hidden;
/**
* @var string
*/
protected $title;
/**
* @var string
*/
protected $seoTitle;
/**
* @var string
*/
protected $description;
/**
* @return int
*/
public function getUid()
{
return $this->uid;
}
/**
* @param int $uid
*/
public function setUid($uid)
{
$this->uid = $uid;
}
/**
* @return int
*/
public function getPid()
{
return $this->pid;
}
/**
* @param int $pid
*/
public function setPid($pid)
{
$this->pid = $pid;
}
/**
* @return bool
*/
public function isHidden()
{
return $this->hidden;
}
/**
* @param bool $hidden
*/
public function setHidden($hidden)
{
$this->hidden = $hidden;
}
/**
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* @param string $title
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* @return string
*/
public function getSeoTitle()
{
return $this->seoTitle;
}
/**
* @param string $seoTitle
*/
public function setSeoTitle($seoTitle)
{
$this->seoTitle = $seoTitle;
}
/**
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* @param string $description
*/
public function setDescription($description)
{
$this->description = $description;
}
}
@@ -0,0 +1,37 @@
<?php
namespace EP\EpTheme\Domain\Repository;
use TYPO3\CMS\Extbase\Persistence\Repository;
class PageRepository extends Repository
{
/**
* @var array
*/
protected $defaultOrderings = [
'sorting' => 'ASC',
];
/**
* @param int $pid
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
*/
public function findPagesByPid($pid)
{
$query = $this->createQuery();
$query
->getQuerySettings()
->setRespectStoragePage(false)
->setIgnoreEnableFields(true)
->setIncludeDeleted(false)
->setRespectSysLanguage(false)
;
$query->matching($query->logicalAnd([
$query->equals('pid', $pid),
$query->equals('doktype', \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_DEFAULT)
]));
return $query->execute();
}
}
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1415814815" source-language="en" datatype="plaintext" original="messages" date="2013-07-04T16:35:47Z" product-name="documentation">
<header/>
<body>
<trans-unit id="mlang_tabs_tab">
<source>E&amp;P SEO Übersicht</source>
</trans-unit>
<trans-unit id="mlang_labels_tabdescr">
<source>Page title und Meta Description Übersicht</source>
</trans-unit>
<trans-unit id="mlang_labels_tablabel">
<source>Seiten</source>
</trans-unit>
</body>
</file>
</xliff>
@@ -0,0 +1 @@
<f:render section="Main" />
@@ -0,0 +1,55 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
<f:layout name="Page/Backend"/>
<f:section name="Main">
<h1>SEO Übersicht</h1>
<f:be.widget.paginate objects="{pages}" as="pageinatedPages" configuration="{itemsPerPage: 20}">
<table class="table table-striped">
<thead>
<tr>
<th>Seite</th>
<th>SEO Title</th>
<th>Meta Description</th>
<th></th>
</tr>
</thead>
<tbody>
<f:for each="{pageinatedPages}" as="page">
<tr>
<td style="white-space: nowrap">
<f:spaceless>
{page.title}
<f:if condition="{page.hidden}">
<core:icon identifier="actions-ban" size="small" />
</f:if>
</f:spaceless>
</td>
<td>
{page.seoTitle}
</td>
<td>
{page.description}
</td>
<td>
<div class="btn-group">
<a href="{be:uri.editRecord(table: 'pages', uid: page.uid)}"
title="" class="btn btn-default">
<core:icon identifier="actions-document-open"/>
bearbeiten
</a>
</div>
</td>
</tr>
</f:for>
</tbody>
</table>
</f:be.widget.paginate>
</f:section>
</html>
@@ -21,4 +21,19 @@ call_user_func(function () {
['source' => 'EXT:ep_theme/Resources/Public/images/logo.svg']
);
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'EP.EpTheme',
'web',
'management',
'after:list',
[
'Backend' => 'listPages',
],
[
'access' => 'user,group',
'labels' => 'LLL:EXT:ep_theme/Resources/Private/Language/locallang_mod.xlf',
'icon' => 'EXT:ep_products/Resources/Public/Icons/logo.svg'
]
);
});
@@ -0,0 +1,7 @@
config.tx_extbase.persistence.classes {
EP\EpTheme\Domain\Model\Page {
mapping {
tableName = pages
}
}
}