Skip to content
Snippets Groups Projects
Commit e21dc462 authored by Fabian Galinski's avatar Fabian Galinski :pouting_cat:
Browse files

Merge branch 'master' of gitlab.sgalinski.de:typo3/sg_news

parents d0cd79a7 7e2db04d
No related branches found
No related tags found
No related merge requests found
......@@ -2,29 +2,31 @@
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!
***************************************************************/
/***************************************************************
* 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\Core\Utility\GeneralUtility;
/**
* Controller that handles the news feed rendering
......@@ -42,7 +44,8 @@ class NewsFeedController extends AbstractController {
* @return void
*/
public function indexAction() {
$news = $this->newsRepository->findLastUpdatedOrHighlightedNewsByCategories(10, FALSE);
$categories = GeneralUtility::intExplode(',', $this->settings['showCategories'], TRUE);
$news = $this->newsRepository->findLastUpdatedOrHighlightedNewsByCategories(10, FALSE, $categories);
$this->view->assign('news', $news);
}
}
......@@ -32,6 +32,22 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper;
* ExtendedIfViewHelper
*/
class ExtendedIfViewHelper extends AbstractConditionViewHelper {
/**
* @return void
*/
public function initializeArguments() {
$this->registerArgument('condition', 'boolean', 'Condition to be evaluated.');
$this->registerArgument('or', 'boolean', 'First or condition');
$this->registerArgument('or2', 'boolean', 'Second or condition');
$this->registerArgument('or3', 'boolean', 'Third or condition');
$this->registerArgument('or4', 'boolean', 'Fourth or condition');
$this->registerArgument('and', 'boolean', 'First and condition');
$this->registerArgument('and2', 'boolean', 'Second and condition');
$this->registerArgument('and3', 'boolean', 'Third and condition');
$this->registerArgument('and4', 'boolean', 'Fourth and condition');
$this->registerArgument('negate', 'boolean', 'Negate complete condition');
}
/**
* renders <f:then> child if $condition or $or is true, otherwise renders <f:else> child.
*
......
......@@ -101,81 +101,78 @@ $imageColumns = [
],
];
$columns = array_merge([
'tx_sgnews_author' => [
'exclude' => TRUE,
'l10n_exclude' => TRUE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_author',
'config' => [
'type' => 'select',
'minitems' => 0,
'foreign_table' => 'fe_users',
'foreign_table_where' => 'ORDER BY fe_users.name',
'items' => [
['', ''],
],
'wizards' => [
'edit' => [
'type' => 'popup',
'title' => 'Edit',
'module' => ['name' => 'wizard_edit'],
'icon' => 'edit2.gif',
'popup_onlyOpenIfSelected' => 1,
$columns = array_merge(
[
'tx_sgnews_author' => [
'exclude' => TRUE,
'l10n_exclude' => TRUE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_author',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'fe_users',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
'items' => [
['', ''],
],
'suggest' => [
'type' => 'suggest',
'wizards' => [
'suggest' => [
'type' => 'suggest',
],
],
],
],
],
'tx_sgnews_related_news' => [
'exclude' => TRUE,
'l10n_exclude' => TRUE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_related_news',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'pages',
'size' => 5,
'minitems' => 0,
'maxitems' => 99,
'wizards' => [
'suggest' => [
'type' => 'suggest',
'tx_sgnews_related_news' => [
'exclude' => TRUE,
'l10n_exclude' => TRUE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_related_news',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'pages',
'size' => 5,
'minitems' => 0,
'maxitems' => 99,
'wizards' => [
'suggest' => [
'type' => 'suggest',
],
],
],
],
],
'tx_sgnews_highlighted' => [
'displayCond' => 'FIELD:tx_sgnews_never_highlighted:=:0',
'exclude' => TRUE,
'l10n_exclude' => TRUE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_highlighted',
'config' => [
'type' => 'check',
'tx_sgnews_highlighted' => [
'displayCond' => 'FIELD:tx_sgnews_never_highlighted:=:0',
'exclude' => TRUE,
'l10n_exclude' => TRUE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_highlighted',
'config' => [
'type' => 'check',
],
],
],
'tx_sgnews_never_highlighted' => [
'displayCond' => 'FIELD:tx_sgnews_highlighted:=:0',
'exclude' => TRUE,
'l10n_exclude' => TRUE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_never_highlighted',
'config' => [
'type' => 'check',
'tx_sgnews_never_highlighted' => [
'displayCond' => 'FIELD:tx_sgnews_highlighted:=:0',
'exclude' => TRUE,
'l10n_exclude' => TRUE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_never_highlighted',
'config' => [
'type' => 'check',
],
],
],
'lastUpdated' => [
'exclude' => TRUE,
'label' => 'LLL:EXT:cms/locallang_tca.xlf:pages.lastUpdated',
'config' => [
'type' => 'input',
'size' => '13',
'max' => '20',
'eval' => 'datetime',
'default' => $GLOBALS['EXEC_TIME'],
]
],
], $imageColumns);
'lastUpdated' => [
'exclude' => TRUE,
'label' => 'LLL:EXT:cms/locallang_tca.xlf:pages.lastUpdated',
'config' => [
'type' => 'input',
'size' => '13',
'max' => '20',
'eval' => 'datetime',
'default' => $GLOBALS['EXEC_TIME'],
]
],
], $imageColumns
);
// #
// # Pages
......@@ -216,7 +213,10 @@ $GLOBALS['TCA']['pages']['types'][116] = [
--div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.access;access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.behaviour,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.caching;caching,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.language;language,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous,
'
];
......@@ -236,7 +236,10 @@ $GLOBALS['TCA']['pages']['types'][117] = [
--div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.access;access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.behaviour,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.caching;caching,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.language;language,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous,
'
];
......@@ -260,7 +263,7 @@ if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('realurl')) {
$GLOBALS['TCA']['pages_language_overlay']['types'][116] = [
'showitem' => '--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
subtitle, description, tx_realurl_pathsegment,
subtitle, description, tx_realurl_pathsegment, author,
--div--;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
......
......@@ -9,7 +9,23 @@ newsFeed = PAGE
newsFeed {
typeNum = 78906523
10 < tt_content.list.20.sgnews_newsfeed
10 = USER
10 {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = SgNews
pluginName = NewsFeed
vendorName = SGalinski
controller = NewsFeed
action = index
view < plugin.tx_sgnews.view
persistence < plugin.tx_sgnews.persistence
features < plugin.tx_sgnews.features
legacy < plugin.tx_sgnews.legacy
settings {
# if not provided all categories are shown
showCategories =
}
}
config {
disableAllHeaderCode = 1
......
......@@ -33,10 +33,6 @@
<source>News Overview</source>
<target>News-Übersicht</target>
</trans-unit>
<trans-unit id="titlePageBrowserPlugin" approved="yes">
<source>Page Browser Plugin</source>
<target>Seitenbrowser-Plugin</target>
</trans-unit>
<trans-unit id="titleSingleViewPlugin" approved="yes">
<source>News Single View</source>
<target>News-Einzelansicht</target>
......
......@@ -27,9 +27,6 @@
<trans-unit id="titleOverviewPlugin">
<source>News Overview</source>
</trans-unit>
<trans-unit id="titlePageBrowserPlugin">
<source>Page Browser Plugin</source>
</trans-unit>
<trans-unit id="titleSingleViewPlugin">
<source>News Single View</source>
</trans-unit>
......
<?xml version="1.0" encoding="utf-8"?>{namespace sg=SGalinski\SgNews\ViewHelpers}
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
<title>News Feed</title>
<link href="{f:uri.page(pageUid: '{rootpageId}', absolute: '1')}" />
<link rel="self" type="application/atom+xml" href="{f:uri.page(pageUid: '{rootpageId}', absolute: '1', pageType: '78906523')}" />
<id>{f:uri.page(pageUid: '{rootpageId}', absolute: '1')}news.xml</id>
<subtitle type="html">{settings.siteName}</subtitle>
<link href="{f:uri.page(pageUid: '{settings.rootpageId}', absolute: '1')}" />
<link rel="self" type="application/atom+xml" href="{f:uri.page(pageUid: '{settings.rootpageId}', absolute: '1', pageType: '78906523')}" />
<id>{f:uri.page(pageUid: '{settings.rootpageId}', absolute: '1', pageType: '78906523')}</id>
<updated>{news.0.lastUpdated -> f:format.date(format: "Y-m-d\TH:i:s+01:00")}</updated>
<subtitle type="html">News Feed - {absoluteUrl}</subtitle>
<author>
<name>{settings.siteName}</name>
</author>
......@@ -18,4 +18,4 @@
<summary type="html">{singleNews.description}</summary>
</entry>
</f:for>
</feed>
\ No newline at end of file
</feed>
......@@ -4,7 +4,7 @@
"description": "News System",
"homepage": "https://www.sgalinski.de",
"license": ["GPL-2.0+"],
"version": "3.3.2",
"version": "3.3.3",
"support": {
},
"repositories": [
......
<?php
$EM_CONF[$_EXTKEY] = [
'title' => 'sgalinski News System',
'title' => 'News System',
'description' => 'News System',
'category' => 'plugin',
'author' => 'Stefan Galinski',
......@@ -19,11 +19,11 @@ $EM_CONF[$_EXTKEY] = [
'modify_tables' => '',
'clearCacheOnLoad' => 0,
'lockType' => '',
'version' => '3.3.2',
'version' => '3.3.3',
'constraints' => [
'depends' => [
'typo3' => '7.6.0-7.6.99',
'php' => '5.5.0-5.6.99',
'php' => '5.5.0-7.0.99',
],
'conflicts' => [],
'suggests' => [
......@@ -32,5 +32,4 @@ $EM_CONF[$_EXTKEY] = [
],
],
'suggests' => [],
'_md5_values_when_last_written' => '',
];
......@@ -28,17 +28,11 @@ TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titleListByCategoryPlugin'
);
TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'sg_news', 'PageBrowser',
'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titlePageBrowserPlugin'
);
// Removal of the unused plugin setting fields
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_overview'] = 'select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_listbycategory'] = 'select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_latest'] = 'select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_singleview'] = 'select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_pagebrowser'] = 'select_key,pages,recursive';
// Flex form assignment
$pluginSignature = str_replace('_', '', 'sg_news') . '_overview';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment