Skip to content
Snippets Groups Projects
Commit 6f50eb6f authored by Matthias Adrowski's avatar Matthias Adrowski
Browse files

Merge branch 'feature_Upgrade-to-TYPO3-11' into 'master'

Feature upgrade to typo3 11

See merge request !38
parents 9ac5a6bc 4a30b13d
No related branches found
No related tags found
1 merge request!38Feature upgrade to typo3 11
Showing
with 380 additions and 556 deletions
<?php
namespace SGalinski\SgNews\ViewHelpers\Backend\Widget\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 TYPO3\CMS\Extbase\Persistence\Generic\Query;
use TYPO3\CMS\Fluid\ViewHelpers\Be\Widget\Controller\PaginateController as FluidPaginateController;
/**
* Class PaginateController
*/
class PaginateController extends FluidPaginateController {
/**
* @var mixed
*/
protected $objects;
/**
* Renders the paginator
*
* @param int $currentPage
* @return void
* @throws \InvalidArgumentException
*/
public function indexAction($currentPage = 1) {
// set current page
$this->currentPage = (int) $currentPage;
if ($this->currentPage < 1) {
$this->currentPage = 1;
}
if ($this->currentPage > $this->numberOfPages) {
// set $modifiedObjects to NULL if the page does not exist
$modifiedObjects = NULL;
} else {
// modify query
$this->itemsPerPage = (int) $this->configuration['itemsPerPage'];
$this->offset = $this->itemsPerPage * ($this->currentPage - 1);
if (is_array($this->objects)) {
$modifiedObjects = [];
for ($index = $this->offset; $index < $this->offset + $this->itemsPerPage; $index++) {
if (isset($this->objects[$index])) {
$modifiedObjects[] = $this->objects[$index];
} else {
break;
}
}
} else {
/** @var Query $query */
$query = $this->objects->getQuery();
$query->setLimit($this->itemsPerPage);
if ($this->currentPage > 1) {
$query->setOffset($this->offset);
}
$modifiedObjects = $query->execute();
}
}
$this->view->assign(
'contentArguments', [
$this->widgetConfiguration['as'] => $modifiedObjects
]
);
$this->view->assign('configuration', $this->configuration);
$this->view->assign('pagination', $this->buildPagination());
}
/**
* Returns an array with the keys "pages", "current", "numberOfPages",
* "nextPage" & "previousPage"
*
* @return array
*/
protected function buildPagination(): array {
$pagination = parent::buildPagination();
$pagination['totalObjects'] = count($this->objects);
return $pagination;
}
}
<?php
namespace SGalinski\SgNews\ViewHelpers\Backend\Widget;
/***************************************************************
* 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\ViewHelpers\Backend\Widget\Controller\PaginateController;
use TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper;
/**
* Class PaginateViewHelper
*/
class PaginateViewHelper extends AbstractWidgetViewHelper {
/**
* @var PaginateController
*/
protected $controller;
/**
* Initializes the controller
*
* @param PaginateController $controller
*/
public function injectPaginateController(PaginateController $controller) {
$this->controller = $controller;
}
/**
* Initialize the ViewHelper arguments
*/
public function initializeArguments() {
parent::initializeArguments();
$this->registerArgument('objects', 'mixed', 'The objects to paginate', TRUE);
$this->registerArgument('as', 'string', 'The name of the variable inside the pagination', TRUE);
$this->registerArgument(
'configuration',
'array',
'The configuration of the pagination',
FALSE,
[
'itemsPerPage' => 10,
'insertAbove' => FALSE,
'insertBelow' => TRUE,
'recordsLabel' => ''
]
);
}
/**
* Renders the paginator
*
* @return string
* @throws \TYPO3\CMS\Fluid\Core\Widget\Exception\MissingControllerException
*/
public function render(): string {
return $this->initiateSubRequest();
}
}
......@@ -36,7 +36,6 @@ use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
* <sg:getReadingTime content="" />
*/
class GetReadingTimeViewHelper extends AbstractViewHelper {
/**
* Register the ViewHelper arguments
*/
......
......@@ -19,7 +19,7 @@ class RelatedViewHelper extends AbstractViewHelper {
/**
* @var bool
*/
protected $escapeOutput = false;
protected $escapeOutput = FALSE;
/**
* Initialize the view helper arguments
......@@ -45,7 +45,8 @@ class RelatedViewHelper extends AbstractViewHelper {
TRUE
);
$this->registerArgument(
'iteration', 'string',
'iteration',
'string',
'The name of the variable to store iteration information (index, cycle, isFirst, isLast, isEven, isOdd)'
);
$this->registerArgument(
......@@ -68,7 +69,9 @@ class RelatedViewHelper extends AbstractViewHelper {
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
*/
public static function renderStatic(
array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$newsService = GeneralUtility::makeInstance(NewsService::class);
$categoryRepository = GeneralUtility::makeInstance(CategoryRepository::class);
......
......@@ -61,7 +61,7 @@ class RenderAuthorNewsViewHelper extends AbstractViewHelper {
/**
* Initialize arguments.
*
* @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
* @return void
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
*/
......
......@@ -58,7 +58,9 @@ class PageRenderer extends \TYPO3\CMS\Core\Page\PageRenderer {
if (is_array($this->headerDataRegex)) {
foreach ($this->headerDataRegex as $regex) {
$this->headerData = preg_replace(
'/' . $regex['pattern'] . '/is', $regex['replacement'], $this->headerData
'/' . $regex['pattern'] . '/is',
$regex['replacement'],
$this->headerData
);
}
}
......@@ -72,7 +74,9 @@ class PageRenderer extends \TYPO3\CMS\Core\Page\PageRenderer {
* @param string $substituteHash
* @return string
*/
public function renderJavaScriptAndCssForProcessingOfUncachedContentObjects($cachedPageContent, $substituteHash
public function renderJavaScriptAndCssForProcessingOfUncachedContentObjects(
$cachedPageContent,
$substituteHash
): string {
$this->executeHeaderRegularExpressions();
return parent::renderJavaScriptAndCssForProcessingOfUncachedContentObjects($cachedPageContent, $substituteHash);
......
<?php
return [
'sg_news:migrateNews' => [
'class' => \SGalinski\SgNews\Command\MigrateNewsCommandController::class
]
];
<?php
declare(strict_types=1);
// if you need to change this, keep in mind the changes need to be done in
......
services:
_defaults:
autowire: true
autoconfigure: true
public: true
_defaults:
autowire: true
autoconfigure: true
public: false
SGalinski\SgNews\:
resource: '../Classes/*'
SGalinski\SgNews\:
resource: '../Classes/*'
SGalinski\SgNews\Preview\PreviewRenderer:
public: true
# Commands
SGalinski\SgNews\Command\MigrateNewsCommandController:
tags:
- name: 'console.command'
command: 'sg_news:migrateNews'
<?php
defined('TYPO3') or die();
/**
*
* Copyright notice
......@@ -56,121 +57,68 @@ foreach (
];
}
if (version_compare(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('sg_seo'), '5.0.0', '>=')) {
$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::NEWS_DOKTYPE] = [
'showitem' => '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;standard,
--palette--;;titleDescriptionAndHighlightFlag,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.editorial;editorialWithNewsAuthor,
tx_sgnews_content_from_another_page, tx_sgnews_related_news, tx_sgnews_tags,
--div--;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.tabs.seo,
--palette--;;seo,
--palette--;;robots,
--palette--;;canonical,
--palette--;;sitemap,
--div--;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.tabs.socialmedia,
--palette--;;opengraph,
--palette--;;twittercards,
--div--;' . $localLangDbPath . 'pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--palette--;;media,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.abstract;abstract,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.appearance,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.layout;layout,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.access;access,
--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.miscellaneous;miscellaneous,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
--palette--;;language
'
];
} else {
$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::NEWS_DOKTYPE] = [
'showitem' => '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;standard,
--palette--;;titleDescriptionAndHighlightFlag,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.editorial;editorialWithNewsAuthor,
tx_sgnews_content_from_another_page, tx_sgnews_related_news, tx_sgnews_tags,
--div--;' . $localLangDbPath . 'pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--palette--;;media,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
tx_projectbase_devnullrobots_flags,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.abstract;abstract,
tx_projectbase_seo_titletag,tx_projectbase_seo_canonicaltag,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.appearance,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.layout;layout,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.access;access,
--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.miscellaneous;miscellaneous,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
--palette--;;language
'
];
}
if (version_compare(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('sg_seo'), '5.0.0', '>=')) {
$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::CATEGORY_DOKTYPE] = [
'showitem' => '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;standard,
title, slug, tx_projectbase_path_segment, tx_projectbase_excludefromsluggeneration, tx_realurl_pathsegment, tx_realurl_exclude,
--div--;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.tabs.seo,
--palette--;;seo,
--palette--;;robots,
--palette--;;canonical,
--palette--;;sitemap,
--div--;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.tabs.socialmedia,
--palette--;;opengraph,
--palette--;;twittercards,
--div--;' . $localLangDbPath . 'pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--palette--;;media,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.abstract;abstract,
seo_title,canonical_link, ' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('yoast_seo') || \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('seo') ? '':'description,') . '
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.appearance,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.layout;layout,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.access;access,
--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.miscellaneous;miscellaneous,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
--palette--;;language
'
];
} else {
$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::CATEGORY_DOKTYPE] = [
'showitem' => '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;standard,
title, slug, tx_projectbase_path_segment, tx_projectbase_excludefromsluggeneration, tx_realurl_pathsegment, tx_realurl_exclude,
--div--;' . $localLangDbPath . 'pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--palette--;;media,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
tx_projectbase_devnullrobots_flags,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.abstract;abstract,
tx_projectbase_seo_titletag,tx_projectbase_seo_canonicaltag, ' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('yoast_seo') || \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('seo') ? '':'description,') . '
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.appearance,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.layout;layout,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.access;access,
--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.miscellaneous;miscellaneous,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
--palette--;;language
'
];
}
$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::NEWS_DOKTYPE] = [
'showitem' => '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;standard,
--palette--;;titleDescriptionAndHighlightFlag,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.editorial;editorialWithNewsAuthor,
tx_sgnews_content_from_another_page, tx_sgnews_related_news, tx_sgnews_tags,
--div--;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.tabs.seo,
--palette--;;seo,
--palette--;;robots,
--palette--;;canonical,
--palette--;;sitemap,
--div--;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.tabs.socialmedia,
--palette--;;opengraph,
--palette--;;twittercards,
--div--;' . $localLangDbPath . 'pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--palette--;;media,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.abstract;abstract,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.appearance,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.layout;layout,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.access;access,
--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.miscellaneous;miscellaneous,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
--palette--;;language
'
];
$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::CATEGORY_DOKTYPE] = [
'showitem' => '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;standard,
title, slug, tx_projectbase_path_segment, tx_projectbase_excludefromsluggeneration, tx_realurl_pathsegment, tx_realurl_exclude,
--div--;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.tabs.seo,
--palette--;;seo,
--palette--;;robots,
--palette--;;canonical,
--palette--;;sitemap,
--div--;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.tabs.socialmedia,
--palette--;;opengraph,
--palette--;;twittercards,
--div--;' . $localLangDbPath . 'pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--palette--;;media,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.abstract;abstract,
seo_title,canonical_link, ' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('yoast_seo') || \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('seo') ? '' : 'description,') . '
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.appearance,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.layout;layout,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.access;access,
--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.miscellaneous;miscellaneous,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
--palette--;;language
'
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
'pages',
......@@ -178,11 +126,7 @@ if (version_compare(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExten
'tx_sgnews_teaser1_image' => [
'exclude' => TRUE,
'label' => $localLangDbPath . 'pages.tx_sgnews_teaser1_image',
'description' => (version_compare(
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('sg_seo'),
'5.0.0',
'>=')
) ? 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:teaser_description' : null,
'description' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:teaser_description',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'tx_sgnews_teaser1_image',
[
......@@ -190,32 +134,32 @@ if (version_compare(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExten
'foreign_types' => [
'0' => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
]
],
......@@ -232,11 +176,7 @@ if (version_compare(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExten
'tx_sgnews_teaser2_image' => [
'exclude' => TRUE,
'label' => $localLangDbPath . 'pages.tx_sgnews_teaser2_image',
'description' => (version_compare(
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('sg_seo'),
'5.0.0',
'>=')
) ? 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:teaser_description' : null,
'description' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:teaser_description',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'tx_sgnews_teaser2_image',
[
......@@ -244,32 +184,32 @@ if (version_compare(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExten
'foreign_types' => [
'0' => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
'showitem' => '
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette'
]
],
......@@ -460,7 +400,7 @@ if (version_compare(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExten
$GLOBALS['TCA']['pages']['palettes']['titleDescriptionAndHighlightFlag'] = [
'showitem' => 'subtitle;' . $localLangDbPath . 'pages.subtitle.inPalette,
--linebreak--, title,
' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('yoast_seo') || \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('seo') ? '':'--linebreak--, description,') . '
' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('yoast_seo') || \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('seo') ? '' : '--linebreak--, description,') . '
--linebreak--, slug,
--linebreak--, tx_projectbase_path_segment, tx_projectbase_excludefromsluggeneration,
--linebreak--, tx_realurl_pathsegment, tx_realurl_exclude,
......@@ -478,64 +418,38 @@ $GLOBALS['TCA']['pages']['palettes']['editorialWithNewsAuthor'] = [
];
foreach ($GLOBALS['TCA']['pages']['columns'] as $languageExcludeField => $_) {
if (version_compare(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('sg_seo'), '5.0.0', '>=')) {
$fieldNames = [
'doktype',
'title',
'subtitle',
'description',
'slug',
'tx_projectbase_path_segment',
'tx_projectbase_excludefromsluggeneration',
'tx_sgnews_location',
'tx_sgnews_teaser1_image',
'tx_sgnews_teaser2_image',
'tx_sgnews_tags',
'abstract',
'seo_title',
'canonical_link',
'hidden',
'sys_language_uid',
'tx_languagevisibility_visibility',
'lastUpdated',
'tx_sgnews_date_end',
'tx_sgnews_highlighted',
'tx_sgnews_never_highlighted',
'tx_sgnews_comments_enable',
'og_title',
'og_description',
'og_image',
'twitter_title',
'twitter_description',
'twitter_image',
'twitter_card'
];
} else {
$fieldNames = [
'doktype',
'title',
'subtitle',
'description',
'slug',
'tx_projectbase_path_segment',
'tx_projectbase_excludefromsluggeneration',
'tx_sgnews_location',
'tx_sgnews_teaser1_image',
'tx_sgnews_teaser2_image',
'tx_sgnews_tags',
'abstract',
'tx_projectbase_seo_titletag',
'tx_projectbase_seo_canonicaltag',
'hidden',
'sys_language_uid',
'tx_languagevisibility_visibility',
'lastUpdated',
'tx_sgnews_date_end',
'tx_sgnews_highlighted',
'tx_sgnews_never_highlighted',
'tx_sgnews_comments_enable'
];
}
$fieldNames = [
'doktype',
'title',
'subtitle',
'description',
'slug',
'tx_projectbase_path_segment',
'tx_projectbase_excludefromsluggeneration',
'tx_sgnews_location',
'tx_sgnews_teaser1_image',
'tx_sgnews_teaser2_image',
'tx_sgnews_tags',
'abstract',
'seo_title',
'canonical_link',
'hidden',
'sys_language_uid',
'tx_languagevisibility_visibility',
'lastUpdated',
'tx_sgnews_date_end',
'tx_sgnews_highlighted',
'tx_sgnews_never_highlighted',
'tx_sgnews_comments_enable',
'og_title',
'og_description',
'og_image',
'twitter_title',
'twitter_description',
'twitter_image',
'twitter_card'
];
if (!in_array($languageExcludeField, $fieldNames)) {
$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::NEWS_DOKTYPE]['columnsOverrides'][$languageExcludeField]['l10n_mode'] = 'exclude';
}
......
<?php
defined('TYPO3') or die();
/**
*
* Copyright notice
......@@ -25,5 +27,7 @@
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'sg_news', 'Configuration/TypoScript/Frontend', 'News System'
'sg_news',
'Configuration/TypoScript/Frontend',
'News System'
);
<?php
defined('TYPO3') or die();
/**
*
* Copyright notice
......@@ -58,20 +60,29 @@ $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['sgnews_n
// Flex form assignment
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['sgnews_overview'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
'sgnews_overview', 'FILE:EXT:sg_news/Configuration/FlexForms/Overview.xml'
'sgnews_overview',
'FILE:EXT:sg_news/Configuration/FlexForms/Overview.xml'
);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['sgnews_listbycategory'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
'sgnews_listbycategory', 'FILE:EXT:sg_news/Configuration/FlexForms/ListByCategory.xml'
'sgnews_listbycategory',
'FILE:EXT:sg_news/Configuration/FlexForms/ListByCategory.xml'
);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['sgnews_latest'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
'sgnews_latest', 'FILE:EXT:sg_news/Configuration/FlexForms/Latest.xml'
'sgnews_latest',
'FILE:EXT:sg_news/Configuration/FlexForms/Latest.xml'
);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['sgnews_newsbyauthor'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
'sgnews_newsbyauthor', 'FILE:EXT:sg_news/Configuration/FlexForms/NewsByAuthor.xml'
'sgnews_newsbyauthor',
'FILE:EXT:sg_news/Configuration/FlexForms/NewsByAuthor.xml'
);
$GLOBALS['TCA']['tt_content']['types']['list']['previewRenderer']['sgnews_overview'] = \SGalinski\SgNews\Preview\PreviewRenderer::class;
$GLOBALS['TCA']['tt_content']['types']['list']['previewRenderer']['sgnews_listbycategory'] = \SGalinski\SgNews\Preview\PreviewRenderer::class;
$GLOBALS['TCA']['tt_content']['types']['list']['previewRenderer']['sgnews_latest'] = \SGalinski\SgNews\Preview\PreviewRenderer::class;
$GLOBALS['TCA']['tt_content']['types']['list']['previewRenderer']['sgnews_newsbyauthor'] = \SGalinski\SgNews\Preview\PreviewRenderer::class;
......@@ -34,7 +34,6 @@ $configuration = [
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'searchFields' => 'name, email, description, website',
'dividers2tabs' => TRUE,
'delete' => 'deleted',
'enablecolumns' => [
'disabled' => 'hidden',
......@@ -48,7 +47,7 @@ $configuration = [
'interface' => [],
'types' => [
'1' => [
'showitem' => 'hidden;;1, --palette--;;authorInfos, path_segment, description'
'showitem' => 'hidden,--palette--;;1,--palette--;;authorInfos,path_segment,description'
],
],
'palettes' => [
......@@ -164,7 +163,8 @@ $configuration = [
'l10n_mode' => 'exclude',
'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', [
'files',
[
'appearance' => [
'useSortable' => TRUE,
],
......@@ -192,8 +192,5 @@ $configuration = [
],
]
];
if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '10.3.0', '<')) {
$configuration['interface']['showRecordFieldList'] = 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, crdate, name, email, description, website, image, path_segment';
}
return $configuration;
config.tx_extbase {
persistence {
classes {
# @deprecated This configuration does not work in TYPO3 10 at all, you need to also change
# Configuration/Extbase/Persistence/Classes.php
SGalinski\SgNews\Domain\Model\News {
mapping {
tableName = pages
recordType = 116
columns {
tx_sgnews_highlighted.mapOnProperty = highlighted
tx_sgnews_never_highlighted.mapOnProperty = neverHighlighted
tx_sgnews_related_news.mapOnProperty = relatedNews
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
}
}
}
SGalinski\SgNews\Domain\Model\Category {
mapping {
tableName = pages
recordType = 117
columns {
tx_sgnews_teaser1_image.mapOnProperty = teaser1Image
tx_sgnews_teaser2_image.mapOnProperty = teaser2Image
}
}
}
SGalinski\SgNews\Domain\Model\Tag {
mapping {
tableName = sys_category
}
}
SGalinski\SgNews\Domain\Model\FileReference {
mapping {
tableName = sys_file_reference
}
}
}
}
}
......@@ -21,6 +21,6 @@ plugin.tx_sgnews {
sortDirection = DESC
# This enables the output of related news in regards to the news category or tags
enableAutomaticRelatedNews = 0
enableAutomaticRelatedNews = 1
}
}
......@@ -8,7 +8,7 @@ Repository: https://gitlab.sgalinski.de/typo3/sg_news
Please report bugs here: https://gitlab.sgalinski.de/typo3/sg_news
TYPO3 version: >=9.5
TYPO3 version: >=10.4
## About
......
{namespace core = TYPO3\CMS\Core\ViewHelpers}
{namespace sg=SGalinski\SgNews\ViewHelpers}
<f:be.container
includeRequireJsModules="{
0: 'TYPO3/CMS/Backend/ContextMenu',
1: 'TYPO3/CMS/Backend/Tooltip',
2: 'TYPO3/CMS/SgNews/Backend'}">
<div class="module" data-module-id="" data-module-name="">
<div class="module-docheader t3js-module-docheader">
<div class="module-docheader-bar module-docheader-bar-navigation t3js-module-docheader-bar t3js-module-docheader-bar-navigation">
<div class="module-docheader-bar-column-left">
<f:for each="{docHeader.menus}" as="menu">
<f:be.menus.actionMenu additionalAttributes="{name: menu.identifier}">
<f:for each="{menu.menuItems}" as="menuItem">
<option value="{menuItem.href}" {f:if(condition: '{menuItem.active}', then: 'selected="selected"')}>{menuItem.title}</option>
<f:if condition="{V11}">
<f:then>
<f:be.pageRenderer includeRequireJsModules="{
0: 'TYPO3/CMS/Backend/ContextMenu',
1: 'TYPO3/CMS/Backend/Tooltip',
2: 'TYPO3/CMS/SgNews/Backend'}"
/>
<h1>
<f:render section="headline" />
</h1>
<f:render section="content" />
</f:then>
<f:else>
<f:be.container
includeRequireJsModules="{
0: 'TYPO3/CMS/Backend/ContextMenu',
1: 'TYPO3/CMS/Backend/Tooltip',
2: 'TYPO3/CMS/SgNews/Backend'}">
<div class="module" data-module-id="" data-module-name="">
<div class="module-docheader t3js-module-docheader">
<div class="module-docheader-bar module-docheader-bar-navigation t3js-module-docheader-bar t3js-module-docheader-bar-navigation">
<div class="module-docheader-bar-column-left">
<f:for each="{docHeader.menus}" as="menu">
<f:be.menus.actionMenu additionalAttributes="{name: menu.identifier}">
<f:for each="{menu.menuItems}" as="menuItem">
<option value="{menuItem.href}" {f:if(condition: '{menuItem.active}', then: 'selected="selected"')}>{menuItem.title}</option>
</f:for>
</f:be.menus.actionMenu>
</f:for>
</f:be.menus.actionMenu>
</f:for>
</div>
<div class="module-docheader-bar-column-right">
<span class="typo3-docheader-pagePath">
<f:if condition="{typo3Version} < 9000000">
<f:then>
<f:translate key="LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.path" />: <f:format.raw>{docHeader.metaInformation.path}</f:format.raw>
</f:then>
<f:else>
<f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.path" />: <f:format.raw>{docHeader.metaInformation.path}</f:format.raw>
</f:else>
</f:if>
</span>
<f:format.raw>{docHeader.metaInformation.recordInformation}</f:format.raw>
</div>
<div class="module-docheader-bar-column-right">
<span class="typo3-docheader-pagePath">
<f:if condition="{typo3Version} < 9000000">
<f:then>
<f:translate key="LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.path" />: <f:format.raw>{docHeader.metaInformation.path}</f:format.raw>
</f:then>
<f:else>
<f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.path" />: <f:format.raw>{docHeader.metaInformation.path}</f:format.raw>
</f:else>
</f:if>
</span>
<f:format.raw>{docHeader.metaInformation.recordInformation}</f:format.raw>
</div>
</div>
<div class="module-docheader-bar module-docheader-bar-buttons t3js-module-docheader-bar t3js-module-docheader-bar-buttons">
<div class="module-docheader-bar-column-left">
</div>
<div class="module-docheader-bar-column-right">
<f:render partial="ButtonBar" arguments="{buttons:docHeader.buttons.right}" />
</div>
</div>
</div>
</div>
<div class="module-docheader-bar module-docheader-bar-buttons t3js-module-docheader-bar t3js-module-docheader-bar-buttons">
<div class="module-docheader-bar-column-left">
</div>
<div class="module-docheader-bar-column-right">
<f:render partial="ButtonBar" arguments="{buttons:docHeader.buttons.right}" />
<div id="typo3-docbody">
<div id="typo3-inner-docbody">
<h1>
<f:render section="headline" />
</h1>
<f:render section="content" />
</div>
</div>
</div>
</div>
<div id="typo3-docbody">
<div id="typo3-inner-docbody">
<h1>
<f:render section="headline" />
</h1>
<f:render section="content" />
</div>
</div>
</f:be.container>
</f:be.container>
</f:else>
</f:if>
<f:form action="index" controller="Backend" method="post" objectName="filters" object="{filters}">
<div class="row">
<f:if condition="{showCategoryFilter}">
<div class="col-xs-4">
<div class="col-sm-4">
<div class="form-group">
<label for="filter-categories">
<f:translate key="backend.filters.categories" />
......@@ -11,7 +11,7 @@
</div>
</div>
</f:if>
<div class="col-xs-{f:if(condition: showCategoryFilter, then: '4', else: '6')}">
<div class="col-sm-{f:if(condition: showCategoryFilter, then: '4', else: '6')}">
<div class="form-group">
<label for="filter-tags">
<f:translate key="backend.filters.tags" />
......@@ -20,16 +20,16 @@
<small><f:format.raw><f:translate key="backend.filters.tags.description" /></f:format.raw></small>
</div>
</div>
<div class="col-xs-{f:if(condition: showCategoryFilter, then: '4', else: '6')}">
<div class="col-sm-{f:if(condition: showCategoryFilter, then: '4', else: '6')}">
<div class="form-group">
<label for="filter-search"><f:translate key="backend.filters.search" /></label>
<f:form.textfield class="form-control" property="search" id="filter-search" />
</div>
<div class="media">
<div class="media-buttons">
<div class="pull-right divider">
<f:form.button class="btn btn-success form-control" type="submit"><f:translate key="backend.filter" /></f:form.button>
</div>
<div class="pull-right divider">
<div class="pull-right divider" style="margin-right: 15px">
<f:form.button id="filter-reset-btn" class="btn btn-danger form-control" type="reset"><f:translate key="backend.filter.reset" /></f:form.button>
</div>
</div>
......
{namespace core=TYPO3\CMS\Core\ViewHelpers}
{namespace sg=SGalinski\SgMail\ViewHelpers}
<nav class="pagination-wrap">
<ul class="pagination pagination-block">
<f:if condition="{pagination.previousPageNumber} && {pagination.previousPageNumber} >= {pagination.firstPageNumber}">
<f:then>
<li class="page-item">
<a href="{f:uri.action(action:actionName, arguments:{currentPage: 1})}" title="{f:translate(key:'widget.pagination.first')}" class="page-link">
<core:icon identifier="actions-view-paging-first" />
</a>
</li>
<li class="page-item">
<a href="{f:uri.action(action:actionName, arguments:{currentPage: pagination.previousPageNumber})}" title="{f:translate(key:'widget.pagination.previous')}" class="page-link">
<core:icon identifier="actions-view-paging-previous" />
</a>
</li>
</f:then>
<f:else>
<li class="page-item disabled">
<span class="page-link">
<core:icon identifier="actions-view-paging-first" />
</span>
</li>
<li class="page-item disabled">
<span class="page-link">
<core:icon identifier="actions-view-paging-previous" />
</span>
</li>
</f:else>
</f:if>
<li class="page-item">
<span class="page-link">
<f:if condition="{recordsLabel}">
<f:then>
{recordsLabel}
</f:then>
<f:else>
<f:translate key="widget.pagination.records" />
</f:else>
</f:if>
{pagination.startRecordNumber} - {pagination.endRecordNumber} / {paginator.totalItems}
</span>
</li>
<li class="page-item">
<span class="page-link">
<f:translate key="widget.pagination.page" />
<form id="paginator-form-{position}" onsubmit="goToPage{position}(this); return false;" style="display:inline;">
<script type="text/javascript">
function goToPage{position}(formObject) {
var page = formObject.elements['paginator-target-page'].value;
var url = '{f:uri.action(action:actionName, arguments:{currentPage: 987654321}) -> f:format.raw()}';
if (page > {pagination.lastPageNumber}) {
page = {pagination.lastPageNumber};
}
else
if (page < 1) {
page = 1;
}
url = url.replace('987654321', page);
self.location.href = url;
}
</script>
<f:form.textfield id="paginator-{position}" name="paginator-target-page" additionalAttributes="{min: '1'}" class="form-control input-sm paginator-input" size="5" value="{currentPage}" type="number" />
</form>
/ {pagination.lastPageNumber}
</span>
</li>
<f:if condition="{pagination.nextPageNumber} && {pagination.nextPageNumber} <= {pagination.lastPageNumber}">
<f:then>
<li class="page-item">
<a class="page-link" href="{f:uri.action(action:actionName, arguments:{currentPage: pagination.nextPageNumber})}" title="{f:translate(key:'widget.pagination.next')}">
<core:icon identifier="actions-view-paging-next" />
</a>
</li>
<li class="page-item">
<a class="page-link" href="{f:uri.action(action:actionName, arguments:{currentPage: pagination.lastPageNumber})}" title="{f:translate(key:'widget.pagination.last')}">
<core:icon identifier="actions-view-paging-last" />
</a>
</li>
</f:then>
<f:else>
<li class="page-item disabled">
<span class="page-link">
<core:icon identifier="actions-view-paging-next" />
</span>
</li>
<li class="page-item disabled">
<span class="page-link">
<core:icon identifier="actions-view-paging-last" />
</span>
</li>
</f:else>
</f:if>
<li class="page-item">
<a class="page-link" href="{f:uri.action(action:actionName, arguments:{currentPage: currentPage})}" title="{f:translate(key:'widget.pagination.refresh')}">
<core:icon identifier="actions-refresh" />
</a>
</li>
</ul>
</nav>
......@@ -45,55 +45,54 @@
<div class="panel panel-default recordlist">
<div class="table-fit">
<table data-table="pages" class="table table-striped table-hover">
<sg:backend.widget.paginate objects="{news}" as="paginatedNews" configuration="{insertAbove: 1, itemsPerPage: 20}">
<tbody>
<f:for each="{paginatedNews}" as="singleNews">
<tr data-uid="{singleNews.uid}">
<td nowrap="nowrap" class="col-icon">
<f:format.raw>
<sg:backend.recordIcon table="pages" row="{singleNews}" />
</f:format.raw>
</td>
<td nowrap="nowrap">
<f:alias map="{newsItemTags: '{sg:backend.newsItemTags(uid: singleNews.uid, languageUid: language)}'}">
<f:if condition="{singleNews.translation_uid}">
<f:then>
<be:link.editRecord uid="{singleNews.translation_uid}" table="pages">
<span>
<f:if condition="{singleNews.translation_title}">
<f:then>
{singleNews.translation_title}
</f:then>
<f:else>
{singleNews.title}
</f:else>
</f:if>
<f:if condition="{newsItemTags}">({newsItemTags})</f:if>
</span>
</be:link.editRecord>
</f:then>
<f:else>
<be:link.editRecord uid="{singleNews.uid}" table="pages">
<span>
{singleNews.title}
<f:if condition="{newsItemTags}">({newsItemTags})</f:if>
</span>
</be:link.editRecord>
</f:else>
</f:if>
</f:alias>
<br />
<sg:backend.translationLinks pageUid="{pageUid}" table="pages" uid="{singleNews.uid}" />
</td>
<td nowrap="nowrap" class="col-control">
<f:format.raw>
<sg:backend.control table="pages" row="{singleNews}" />
</f:format.raw>
</td>
</tr>
</f:for>
</tbody>
</sg:backend.widget.paginate>
<f:render partial="Backend/Pagination" arguments="{pagination: pagination, paginator: paginator, actionName: 'index', currentPage: currentPage}"/>
<tbody>
<f:for each="{paginator.paginatedItems}" as="singleNews">
<tr data-uid="{singleNews.uid}">
<td nowrap="nowrap" class="col-icon">
<f:format.raw>
<sg:backend.recordIcon table="pages" row="{singleNews}" />
</f:format.raw>
</td>
<td nowrap="nowrap">
<f:alias map="{newsItemTags: '{sg:backend.newsItemTags(uid: singleNews.uid, languageUid: language)}'}">
<f:if condition="{singleNews.translation_uid}">
<f:then>
<be:link.editRecord uid="{singleNews.translation_uid}" table="pages">
<span>
<f:if condition="{singleNews.translation_title}">
<f:then>
{singleNews.translation_title}
</f:then>
<f:else>
{singleNews.title}
</f:else>
</f:if>
<f:if condition="{newsItemTags}">({newsItemTags})</f:if>
</span>
</be:link.editRecord>
</f:then>
<f:else>
<be:link.editRecord uid="{singleNews.uid}" table="pages">
<span>
{singleNews.title}
<f:if condition="{newsItemTags}">({newsItemTags})</f:if>
</span>
</be:link.editRecord>
</f:else>
</f:if>
</f:alias>
<br />
<sg:backend.translationLinks pageUid="{pageUid}" table="pages" uid="{singleNews.uid}" />
</td>
<td nowrap="nowrap" class="col-control">
<f:format.raw>
<sg:backend.control table="pages" row="{singleNews}" />
</f:format.raw>
</td>
</tr>
</f:for>
</tbody>
</table>
</div>
</div>
......
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