Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • typo3/sg_news
1 result
Show changes
Commits on Source (6)
Showing
with 830 additions and 64 deletions
<?php
namespace SGalinski\SgNews\Controller;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* 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 SGalinski\SgNews\Domain\Model\News;
use SGalinski\SgNews\Domain\Repository\AuthorRepository;
use SGalinski\SgNews\Domain\Repository\CategoryRepository;
use SGalinski\SgNews\Domain\Repository\NewsRepository;
use SGalinski\SgNews\Service\HeaderMetaDataService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Controller that handles the news single view page
*/
class NewsByAuthorController extends AbstractController {
/**
* Renders the news author list.
*
* @return void
* @throws \InvalidArgumentException
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
*/
public function listAction() {
$newsAuthorsIds = GeneralUtility::intExplode(',', $this->settings['newsAuthors']);
if (\count($newsAuthorsIds) <= 0) {
return;
}
$authors = [];
$authorRepository = $this->objectManager->get(AuthorRepository::class);
foreach ($newsAuthorsIds as $newsAuthorsId) {
$author = $authorRepository->findByUid($newsAuthorsId);
if (!$author) {
continue;
}
$authors[] = $author;
}
if (\count($authors) <= 0) {
return;
}
$newsRepository = $this->objectManager->get(NewsRepository::class);
$news = $newsRepository->findAllByNewsAuthor($newsAuthorsIds);
if (\count($news) <= 0) {
return;
}
$categories = $newsMetaData = [];
$categoryRepository = $this->objectManager->get(CategoryRepository::class);
$excludedNewsIds = GeneralUtility::intExplode(',', $this->settings['excludedNews']);
foreach ($news as $newsEntry) {
/** @var News $newsEntry */
if (in_array($newsEntry->getUid(), $excludedNewsIds, TRUE)) {
continue;
}
$categoryId = $newsEntry->getPid();
if (!isset($categories[$categoryId])) {
$category = $categoryRepository->findByUid($categoryId);
if (!$category) {
continue;
}
$categories[$categoryId] = $category;
}
$newsMetaData[] = $this->getMetaDataForNews($newsEntry, $categories[$categoryId]);
}
$this->view->assign('newsMetaData', $newsMetaData);
$this->view->assign('authors', $authors);
}
}
......@@ -91,7 +91,7 @@ class SingleViewController extends AbstractController {
// $similarNewsMetaData[] = $this->getMetaDataForNews($similarNewsEntry, $category);
// }
$newsAuthor = $news->getAuthorFrontendUser();
$newsAuthor = $news->getNewsAuthor();
$newsMetaData = $this->getMetaDataForNews($news, $newsCategory);
if ($newsMetaData['image']) {
HeaderMetaDataService::addOgImageToHeader($newsMetaData['image']);
......
<?php
namespace SGalinski\SgNews\Domain\Model;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* 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 TYPO3\CMS\Extbase\Domain\Model\FrontendUser;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy;
/**
* Author
*/
class Author extends AbstractEntity {
/**
* @var string
*/
protected $name = '';
/**
* @var string
*/
protected $email = '';
/**
* @var string
*/
protected $description = '';
/**
* @lazy
* @var \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
protected $frontendUser;
/**
* @lazy
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
*/
protected $image;
/**
* @return string
*/
public function getName(): string {
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name): void {
$this->name = $name;
}
/**
* @return string
*/
public function getNameAndRespectFrontendUser(): string {
$frontendUser = $this->getFrontendUser();
if ($frontendUser) {
$name = $frontendUser->getName();
if (!empty($name)) {
return $name;
}
}
return $this->name;
}
/**
* @return string
*/
public function getEmail(): string {
return $this->email;
}
/**
* @param string $email
*/
public function setEmail(string $email): void {
$this->email = $email;
}
/**
* @return string
*/
public function getEmailAndRespectFrontendUser(): string {
$frontendUser = $this->getFrontendUser();
if ($frontendUser) {
$email = $frontendUser->getEmail();
if (!empty($email)) {
return $email;
}
}
return $this->email;
}
/**
* @return string
*/
public function getDescription(): string {
return $this->description;
}
/**
* @param string $description
*/
public function setDescription(string $description): void {
$this->description = $description;
}
/**
* @return FrontendUser
*/
public function getFrontendUser(): ?FrontendUser {
if ($this->frontendUser instanceof LazyLoadingProxy) {
$this->frontendUser->_loadRealInstance();
}
return $this->frontendUser;
}
/**
* @param FrontendUser $frontendUser
*/
public function setFrontendUser(FrontendUser $frontendUser): void {
$this->frontendUser = $frontendUser;
}
/**
* @return FileReference
*/
public function getImage(): ?FileReference {
if ($this->image instanceof LazyLoadingProxy) {
$this->image->_loadRealInstance();
}
return $this->image;
}
/**
* @param FileReference $image
*/
public function setImage(FileReference $image): void {
$this->image = $image;
}
/**
* @return string
*/
public function getImageAndRespectFrontendUser(): string {
$frontendUser = $this->getFrontendUser();
if ($frontendUser) {
$images = $frontendUser->getImage();
if ($images->count() > 0) {
return $images->current();
}
}
if ($this->image instanceof LazyLoadingProxy) {
$this->image->_loadRealInstance();
}
return $this->image;
}
}
......@@ -26,7 +26,6 @@ namespace SGalinski\SgNews\Domain\Model;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Extbase\Domain\Model\FrontendUser;
use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
......@@ -39,11 +38,6 @@ class News extends CategoryAndNews {
*/
protected $description = '';
/**
* @var string
*/
protected $author = '';
/**
* @var boolean
*/
......@@ -82,9 +76,9 @@ class News extends CategoryAndNews {
/**
* @lazy
* @var \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
* @var \SGalinski\SgNews\Domain\Model\Author
*/
protected $authorFrontendUser;
protected $newsAuthor;
/**
* @var int
......@@ -96,6 +90,11 @@ class News extends CategoryAndNews {
*/
protected $location;
/**
* @var int
*/
protected $contentFromAnotherPage = 0;
/**
* Constructor
*/
......@@ -105,21 +104,6 @@ class News extends CategoryAndNews {
$this->tags = new ObjectStorage();
}
/**
* @param string $author
* @return void
*/
public function setAuthor($author) {
$this->author = $author;
}
/**
* @return string
*/
public function getAuthor() {
return $this->author;
}
/**
* @param string $description
* @return void
......@@ -283,22 +267,21 @@ class News extends CategoryAndNews {
}
/**
* @param FrontendUser $authorFrontendUser
* @return void
* @return Author
*/
public function setAuthorFrontendUser(FrontendUser $authorFrontendUser) {
$this->authorFrontendUser = $authorFrontendUser;
public function getNewsAuthor(): ?Author {
if ($this->newsAuthor instanceof LazyLoadingProxy) {
$this->newsAuthor->_loadRealInstance();
}
return $this->newsAuthor;
}
/**
* @return FrontendUser
* @param Author $newsAuthor
*/
public function getAuthorFrontendUser() {
if ($this->authorFrontendUser instanceof LazyLoadingProxy) {
$this->authorFrontendUser->_loadRealInstance();
}
return $this->authorFrontendUser;
public function setNewsAuthor(Author $newsAuthor): void {
$this->newsAuthor = $newsAuthor;
}
/**
......@@ -329,4 +312,17 @@ class News extends CategoryAndNews {
$this->location = $location;
}
/**
* @return int
*/
public function getContentFromAnotherPage(): int {
return $this->contentFromAnotherPage;
}
/**
* @param int $contentFromAnotherPage
*/
public function setContentFromAnotherPage(int $contentFromAnotherPage): void {
$this->contentFromAnotherPage = $contentFromAnotherPage;
}
}
<?php
namespace SGalinski\SgNews\Domain\Repository;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* 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 SGalinski\SgNews\Domain\Repository\AbstractRepository;
/**
* Repository for the Author model.
*/
class AuthorRepository extends AbstractRepository {
}
......@@ -26,6 +26,7 @@ namespace SGalinski\SgNews\Domain\Repository;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use SGalinski\SgNews\Domain\Model\Author;
use SGalinski\SgNews\Domain\Model\News;
use TYPO3\CMS\Extbase\Persistence\Generic\QueryResult;
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
......@@ -35,6 +36,24 @@ use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
* News Repository
*/
class NewsRepository extends AbstractRepository {
/**
* Finds all news by the given authors.
*
* @param array $authorIds
*
* @return QueryResultInterface|NULL
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
*/
public function findAllByNewsAuthor(array $authorIds): ?QueryResultInterface {
if (count($authorIds) <= 0) {
return NULL;
}
$query = $this->createQuery();
$query->matching($query->in('newsAuthor', $authorIds));
return $query->execute();
}
/**
* Method returns all news by category id sorted by the field lastUpdated.
*
......
......@@ -25,10 +25,10 @@ namespace SGalinski\SgNews\UserFunction;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use SGalinski\SgNews\Domain\Model\Author;
use SGalinski\SgNews\Domain\Repository\AuthorRepository;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Domain\Model\FrontendUser;
use TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository;
use TYPO3\CMS\Extbase\Object\ObjectManager;
/**
......@@ -47,16 +47,15 @@ class AddAdditionalMailRecipients implements SingletonInterface {
* @throws \InvalidArgumentException
*/
public function addAdditionalMailRecipients(): string {
$newsAuthorUid = (int) $this->cObj->data['tx_sgnews_author'];
$newsAuthorUid = (int) $this->cObj->data['tx_sgnews_news_author'];
if ($newsAuthorUid > 0) {
/** @var ObjectManager $objectManager */
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
/** @var FrontendUserRepository $frontendUserRepository */
$frontendUserRepository = $objectManager->get(FrontendUserRepository::class);
/** @var FrontendUser $frontendUser */
$frontendUser = $frontendUserRepository->findByUid($newsAuthorUid);
if ($frontendUser) {
$email = $frontendUser->getEmail();
$authorRepository = $objectManager->get(AuthorRepository::class);
/** @var Author $author */
$author = $authorRepository->findByUid($newsAuthorUid);
if ($author) {
$email = $author->getEmailAndRespectFrontendUser();
if (!empty($email)) {
return $email;
}
......
......@@ -389,6 +389,7 @@ class BackendNewsUtility {
);
}
// @todo adapt author
if (isset($filters['search']) && trim($filters['search'])) {
$expressions = [
$queryBuilder->expr()->like('p.title', $queryBuilder->createNamedParameter('%' . trim($filters['search']) . '%')),
......
<?php
namespace SGalinski\SgNews\ViewHelpers;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (http://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the AY project. The AY 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 TYPO3\CMS\Extbase\Core\Bootstrap;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
/**
* Example:
* {namespace sgnews=SGalinski\SgNews\ViewHelpers}
* <sgnews:renderAuthorNews newsAuthors="123,321" excludedNews="123,423" />
*/
class RenderAuthorNewsViewHelper extends AbstractViewHelper {
/**
* Extbase Bootstrap
*
* @var Bootstrap
*/
protected $bootstrap;
/**
* @param Bootstrap $bootstrap
* @return void
*/
public function injectBootstrap(Bootstrap $bootstrap) {
$this->bootstrap = $bootstrap;
}
/**
* CommentThreadViewHelper constructor.
*/
public function __construct() {
$this->escapeOutput = FALSE;
$this->escapeChildren = FALSE;
}
/**
* Initialize arguments.
*
* @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
* @return void
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
*/
public function initializeArguments() {
$this->registerArgument('newsAuthors', 'string', 'A list with author uids', TRUE);
$this->registerArgument('excludedNews', 'string', 'A list with excluded news uids');
}
/**
* Renders the Comment plugin. The view helper arguments configures the behavior.
*
* @return mixed
*/
public function render() {
$configuration = [
'extensionName' => 'SgNews',
'vendorName' => 'SGalinski',
'pluginName' => 'NewsByAuthor',
'controllerName' => 'NewsByAuthor',
'action' => 'list'
];
if ($this->arguments['newsAuthors']) {
$configuration['settings']['newsAuthors'] = $this->arguments['newsAuthors'];
}
if ($this->arguments['excludedNews']) {
$configuration['settings']['excludedNews'] = $this->arguments['excludedNews'];
}
return $this->bootstrap->run('', $configuration);
}
}
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<main>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:plugin.flexForm</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<settings.newsAuthors>
<TCEforms>
<label>LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:plugin.flexForm.newsAuthor</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>tx_sgnews_domain_model_author</allowed>
<size>5</size>
<minitems>1</minitems>
<maxitems>99</maxitems>
<wizards>
<suggest>
<type>suggest</type>
</suggest>
</wizards>
</config>
</TCEforms>
</settings.newsAuthors>
<settings.excludedNews>
<TCEforms>
<label>LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:plugin.flexForm.excludedNews</label>
<config>
<type>select</type>
<renderType>selectMultipleSideBySide</renderType>
<size>5</size>
<maxitems>99</maxitems>
<foreign_table>pages</foreign_table>
<foreign_table_where>AND pages.sys_language_uid IN (-1, 0) AND pages.doktype = 116 ORDER BY pages.title</foreign_table_where>
</config>
</TCEforms>
</settings.excludedNews>
</el>
</ROOT>
</main>
</sheets>
</T3DataStructure>
......@@ -69,7 +69,7 @@ call_user_func(
--palette--;;standard,
--palette--;;titleDescriptionAndHighlightFlag,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:' . $table . '.palettes.editorial;editorialWithNewsAuthor,
tx_sgnews_related_news, tx_sgnews_tags,
tx_sgnews_content_from_another_page, tx_sgnews_related_news, tx_sgnews_tags,
--div--;' . $localLangDbPath . $table . '.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:' . $table . '.tabs.metadata,
......@@ -212,14 +212,40 @@ call_user_func(
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
),
],
'tx_sgnews_author' => [
'tx_sgnews_news_author' => [
'exclude' => TRUE,
'l10n_exclude' => TRUE,
'label' => $localLangDbPath . $table . '.tx_sgnews_author',
'label' => $localLangDbPath . $table . '.tx_sgnews_news_author',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'fe_users',
'allowed' => 'tx_sgnews_domain_model_author',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
'items' => [
['', ''],
],
'wizards' => [
'suggest' => [
'type' => 'suggest',
],
],
'fieldControl' => [
'addRecord' => [
'disabled' => FALSE,
],
],
],
],
'tx_sgnews_content_from_another_page' => [
'exclude' => TRUE,
'l10n_exclude' => TRUE,
'label' => $localLangDbPath . $table . '.tx_sgnews_content_from_another_page',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'pages',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
......@@ -360,10 +386,7 @@ call_user_func(
];
$GLOBALS['TCA'][$table]['palettes']['editorialWithNewsAuthor'] = [
'showitem' => 'tx_sgnews_author;' . $localLangDbPath . $table . '.tx_sgnews_author.inPalette,
--linebreak--,
author;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:' . $table . '.author_formlabel,
author_email;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:' . $table . '.author_email_formlabel,
'showitem' => 'tx_sgnews_news_author,
--linebreak--, lastUpdated;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:' . $table . '.lastUpdated_formlabel,
tx_sgnews_date_end,
--linebreak--,tx_sgnews_likes,--linebreak--,tx_sgnews_location',
......@@ -407,6 +430,7 @@ call_user_func(
'tx_languagevisibility_visibility',
'lastUpdated',
'tx_sgnews_date_end',
'tx_sgnews_content_from_another_page',
])
) {
$GLOBALS['TCA'][$table]['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::NEWS_DOKTYPE]['columnsOverrides'][$languageExcludeField]['l10n_mode'] = 'exclude';
......
......@@ -44,11 +44,18 @@ call_user_func(
'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_backend.xlf:pageTypeTitlePluginCategory.news'
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$extKey,
'NewsByAuthor',
'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_backend.xlf:newsFromAuthorPlugin'
);
// Removal of the unused plugin setting fields
$GLOBALS['TCA'][$table]['types']['list']['subtypes_excludelist']['sgnews_overview'] = 'select_key,pages,recursive';
$GLOBALS['TCA'][$table]['types']['list']['subtypes_excludelist']['sgnews_listbycategory'] = 'select_key,pages,recursive';
$GLOBALS['TCA'][$table]['types']['list']['subtypes_excludelist']['sgnews_latest'] = 'select_key,pages,recursive';
$GLOBALS['TCA'][$table]['types']['list']['subtypes_excludelist']['sgnews_singleview'] = 'select_key,pages,recursive';
$GLOBALS['TCA'][$table]['types']['list']['subtypes_excludelist']['sgnews_newsbyauthor'] = 'select_key,pages,recursive';
// Flex form assignment
$pluginSignature = str_replace('_', '', $extKey) . '_overview';
......@@ -68,5 +75,11 @@ call_user_func(
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
$pluginSignature, 'FILE:EXT:' . $extKey . '/Configuration/FlexForms/Latest.xml'
);
$pluginSignature = str_replace('_', '', $extKey) . '_newsbyauthor';
$GLOBALS['TCA'][$table]['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
$pluginSignature, 'FILE:EXT:' . $extKey . '/Configuration/FlexForms/NewsByAuthor.xml'
);
}, 'sg_news', 'tt_content'
);
<?php
/**
*
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* 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!
*/
return [
'ctrl' => [
'title' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:tx_sgnews_domain_model_author',
'label' => 'frontend_user',
'label_alt' => 'name, email',
'label_alt_force' => TRUE,
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'searchFields' => 'name, email, frontend_user, description',
'dividers2tabs' => TRUE,
'delete' => 'deleted',
'enablecolumns' => [
'disabled' => 'hidden',
],
'default_sortby' => 'crdate DESC',
'iconfile' => 'EXT:sg_news/Resources/Public/Icons/module-sgnews.svg'
],
'interface' => [
'showRecordFieldList' => 'hidden, crdate, name, email, description, frontend_user, image',
],
'types' => [
'1' => [
'showitem' => 'hidden;;1, frontend_user, --palette--;;authorInfos, description'
],
],
'palettes' => [
'authorInfos' => [
'showitem' => 'name, email, --linebreak--, image',
'canNotCollapse' => TRUE,
],
],
'columns' => [
'pid' => [
'exclude' => FALSE,
'label' => 'PID',
'config' => [
'type' => 'none',
]
],
'crdate' => [
'exclude' => FALSE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:tx_sgnews_domain_model_author.crdate',
'config' => [
'type' => 'input',
'max' => '20',
'eval' => 'datetime',
'default' => $GLOBALS['EXEC_TIME'],
]
],
'hidden' => [
'exclude' => TRUE,
'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:hidden.I.0',
'config' => [
'type' => 'check',
],
],
'frontend_user' => [
'exclude' => TRUE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:tx_sgnews_domain_model_author.frontend_user',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'maxitems' => 1,
'size' => 1,
'allowed' => 'fe_users',
'wizards' => [
'suggest' => [
'type' => 'suggest',
],
],
]
],
'name' => [
'displayCond' => 'FIELD:frontend_user:<=:0',
'exclude' => FALSE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:tx_sgnews_domain_model_author.name',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
]
],
'email' => [
'displayCond' => 'FIELD:frontend_user:<=:0',
'exclude' => FALSE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:tx_sgnews_domain_model_author.email',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim'
]
],
'description' => [
'exclude' => FALSE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:tx_sgnews_domain_model_author.description',
'config' => [
'type' => 'text',
'cols' => 30,
'rows' => 10
]
],
'image' => [
'displayCond' => 'FIELD:frontend_user:<=:0',
'exclude' => TRUE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:tx_sgnews_domain_model_author.image',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'files', [
'appearance' => [
'useSortable' => TRUE,
],
'minitems' => 0,
'maxitems' => 1,
]
),
],
]
];
......@@ -31,6 +31,16 @@ mod {
list_type = sgnews_listbycategory
}
}
author {
iconIdentifier = sg_news-module
title = LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titleNewsByAuthorPlugin
description = LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titleNewsByAuthorPlugin
tt_content_defValues {
CType = list
list_type = sgnews_newsbyauthor
}
}
}
show = *
}
......
......@@ -9,13 +9,14 @@ config.tx_extbase {
tx_sgnews_highlighted.mapOnProperty = highlighted
tx_sgnews_never_highlighted.mapOnProperty = neverHighlighted
tx_sgnews_related_news.mapOnProperty = relatedNews
tx_sgnews_author.mapOnProperty = authorFrontendUser
tx_sgnews_news_author.mapOnProperty = newsAuthor
lastUpdated.mapOnProperty = lastUpdated
crdate.mapOnProperty = creationDate
tx_sgnews_teaser1_image.mapOnProperty = teaser1Image
tx_sgnews_teaser2_image.mapOnProperty = teaser2Image
tx_sgnews_tags.mapOnProperty = tags
tx_sgnews_likes.mapOnProperty = likes
tx_sgnews_content_from_another_page.mapOnProperty = contentFromAnotherPage
tx_sgnews_location.mapOnProperty = location
tx_sgnews_date_end.mapOnProperty = dateEnd
}
......
......@@ -42,6 +42,16 @@ page.headerData {
lib.mainContent < styles.content.get
lib.mainContent.select.where = colPos=1
lib.contentFromAnotherPage = CONTENT
lib.contentFromAnotherPage {
table = tt_content
select {
where = colPos=1
pidInList = TEXT
pidInList.data = FIELD:tx_sgnews_content_from_another_page
}
}
plugin.tx_sgnews {
view {
templateRootPaths {
......
......@@ -13,6 +13,10 @@
<source>Please upload an image first and save the form!</source>
<target>Bitte lade zuerst ein Bild hoch und speichere anschließend das Formular!</target>
</trans-unit>
<trans-unit id="newsFromAuthorPlugin" approved="yes">
<source>[News] News from author</source>
<target>[News] News vom Author</target>
</trans-unit>
<trans-unit id="pageType.category" approved="yes">
<source>Category</source>
<target>Kategorie</target>
......@@ -29,6 +33,10 @@
<source>List News by Category/Tag.</source>
<target>Liste News aus Kategorien/Tags</target>
</trans-unit>
<trans-unit id="titleNewsByAuthorPlugin" approved="yes">
<source>List News by Author.</source>
<target>Liste News vom Author</target>
</trans-unit>
<trans-unit id="titleOverviewPlugin" approved="yes">
<source>News Overview</source>
<target>News Übersicht</target>
......
......@@ -29,13 +29,13 @@
<source><![CDATA[Pagetitle (automatically generated from Last Update + Headline)]]></source>
<target><![CDATA[Seitentitel (automatisch generiert aus Letzte Aktualisierung + Schlagzeile)]]></target>
</trans-unit>
<trans-unit id="pages.tx_sgnews_author" approved="yes">
<trans-unit id="pages.tx_sgnews_news_author" approved="yes">
<source><![CDATA[Author]]></source>
<target><![CDATA[Autor]]></target>
</trans-unit>
<trans-unit id="pages.tx_sgnews_author.inPalette" approved="yes">
<source><![CDATA[Author (use the free text field if the author not in the list)]]></source>
<target><![CDATA[Autor (benutze das Freitextfeld, falls der Autor nicht in der Liste ist)]]></target>
<trans-unit id="pages.tx_sgnews_content_from_another_page" approved="yes">
<source><![CDATA[Show the content from another page]]></source>
<target><![CDATA[Zeige den Inhalt einer anderen Seite an]]></target>
</trans-unit>
<trans-unit id="pages.tx_sgnews_date_end" approved="yes">
<source><![CDATA[Date until]]></source>
......@@ -101,6 +101,14 @@
<source><![CDATA[Only show news published before]]></source>
<target><![CDATA[Zeige nur News veröffentlicht vor]]></target>
</trans-unit>
<trans-unit id="plugin.flexForm.excludedNews" approved="yes">
<source><![CDATA[News which are excluded from the list]]></source>
<target><![CDATA[News, welche nicht in der Liste dargestellt werden]]></target>
</trans-unit>
<trans-unit id="plugin.flexForm.newsAuthor" approved="yes">
<source><![CDATA[News Author]]></source>
<target><![CDATA[News Autor]]></target>
</trans-unit>
<trans-unit id="plugin.flexForm.orderInPageTree" approved="yes">
<source><![CDATA[Order in pagetree]]></source>
<target><![CDATA[Reihenfolge im Seitenbaum]]></target>
......@@ -189,6 +197,34 @@
<source><![CDATA[Include only news subpages of the page containing this overview]]></source>
<target><![CDATA[Beachte nur News-Unterseiten der Seite, die diese Übersicht beinhaltet]]></target>
</trans-unit>
<trans-unit id="tx_sgnews_domain_model_author" approved="yes">
<source><![CDATA[Author]]></source>
<target><![CDATA[Autor]]></target>
</trans-unit>
<trans-unit id="tx_sgnews_domain_model_author.crdate" approved="yes">
<source><![CDATA[Creation Date]]></source>
<target><![CDATA[Erstellungsdatum]]></target>
</trans-unit>
<trans-unit id="tx_sgnews_domain_model_author.description" approved="yes">
<source><![CDATA[Description]]></source>
<target><![CDATA[Beschreibung]]></target>
</trans-unit>
<trans-unit id="tx_sgnews_domain_model_author.email" approved="yes">
<source><![CDATA[Email]]></source>
<target><![CDATA[E-Mail]]></target>
</trans-unit>
<trans-unit id="tx_sgnews_domain_model_author.frontend_user" approved="yes">
<source><![CDATA[Frontend User (The other fields will be hidden, after selecting one)]]></source>
<target><![CDATA[Frontend-Benutzer (Die anderen Felder werden versteckt, wenn einer selektiert ist)]]></target>
</trans-unit>
<trans-unit id="tx_sgnews_domain_model_author.image" approved="yes">
<source><![CDATA[Image]]></source>
<target><![CDATA[Bild]]></target>
</trans-unit>
<trans-unit id="tx_sgnews_domain_model_author.name" approved="yes">
<source><![CDATA[Name]]></source>
<target><![CDATA[Name]]></target>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
</xliff>
......@@ -12,6 +12,9 @@
<trans-unit id="coordinatePicker.missingImage">
<source>Please upload an image first and save the form!</source>
</trans-unit>
<trans-unit id="newsFromAuthorPlugin">
<source>[News] News from author</source>
</trans-unit>
<trans-unit id="pageTypeTitlePlugin.news">
<source>[News] Plugins</source>
</trans-unit>
......@@ -42,6 +45,9 @@
<trans-unit id="titleListByCategoryPlugin">
<source>News by Category/Tag</source>
</trans-unit>
<trans-unit id="titleNewsByAuthorPlugin">
<source>List News by Author.</source>
</trans-unit>
<trans-unit id="descriptionListByCategoryPlugin">
<source>List news by category/tag</source>
</trans-unit>
......
......@@ -24,11 +24,11 @@
<trans-unit id="pages.title">
<source><![CDATA[Pagetitle (automatically generated from Last Update + Headline)]]></source>
</trans-unit>
<trans-unit id="pages.tx_sgnews_author">
<source><![CDATA[Author]]></source>
<trans-unit id="pages.tx_sgnews_content_from_another_page">
<source><![CDATA[Show the content from another page]]></source>
</trans-unit>
<trans-unit id="pages.tx_sgnews_author.inPalette">
<source><![CDATA[Author (use the free text field if the author not in the list)]]></source>
<trans-unit id="pages.tx_sgnews_news_author">
<source><![CDATA[Author]]></source>
</trans-unit>
<trans-unit id="pages.tx_sgnews_date_end">
<source><![CDATA[Date until]]></source>
......@@ -78,6 +78,12 @@
<trans-unit id="plugin.flexForm.endtime">
<source><![CDATA[Only show news published before]]></source>
</trans-unit>
<trans-unit id="plugin.flexForm.excludedNews">
<source><![CDATA[News which are excluded from the list]]></source>
</trans-unit>
<trans-unit id="plugin.flexForm.newsAuthor">
<source><![CDATA[News Author]]></source>
</trans-unit>
<trans-unit id="plugin.flexForm.orderInPageTree">
<source><![CDATA[Order in pagetree]]></source>
</trans-unit>
......@@ -144,6 +150,27 @@
<trans-unit id="plugin.overview.flexForm.onlyNewsWithinThisPageSection">
<source><![CDATA[Include only news subpages of the page containing this overview]]></source>
</trans-unit>
<trans-unit id="tx_sgnews_domain_model_author">
<source><![CDATA[Author]]></source>
</trans-unit>
<trans-unit id="tx_sgnews_domain_model_author.crdate">
<source><![CDATA[Creation Date]]></source>
</trans-unit>
<trans-unit id="tx_sgnews_domain_model_author.description">
<source><![CDATA[Description]]></source>
</trans-unit>
<trans-unit id="tx_sgnews_domain_model_author.email">
<source><![CDATA[Email]]></source>
</trans-unit>
<trans-unit id="tx_sgnews_domain_model_author.frontend_user">
<source><![CDATA[Frontend User (The other fields will be hidden, after selecting one)]]></source>
</trans-unit>
<trans-unit id="tx_sgnews_domain_model_author.image">
<source><![CDATA[Image]]></source>
</trans-unit>
<trans-unit id="tx_sgnews_domain_model_author.name">
<source><![CDATA[Name]]></source>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
</xliff>