Commit 6050edeb authored by Fabian Galinski's avatar Fabian Galinski

[FEATURE] Respect the extension languagevisibility for the sitemap generation

parent ccb4e2bc
<?php
namespace SGalinski\DdGooglesitemapPlugin\Xclass;
/***************************************************************
* 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 2 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\ExtensionManagementUtility;
use TYPO3\Languagevisibility\Service\FrontendServices;
/**
* Xclass for the pages sitemap generator of dd_googlesitemap
*/
class PagesSitemapGenerator extends \DmitryDulepov\DdGooglesitemap\Generator\PagesSitemapGenerator {
/**
* Checks if the page should be included into the sitemap.
*
* @param array $pageInfo
* @return bool
*/
protected function shouldIncludePageInSitemap(array $pageInfo) {
$shouldInclude = TRUE;
if (ExtensionManagementUtility::isLoaded('languagevisibility')) {
$shouldInclude = FrontendServices::checkVisiblityForElement($pageInfo['uid'], 'pages', 0);
}
return $shouldInclude && !$pageInfo['no_search'] && !in_array($pageInfo['doktype'], $this->excludedPageTypes);
}
}
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"description": "Google Sitemap Plugin - Extends the extension dd_googlesitemap by a plugin", "description": "Google Sitemap Plugin - Extends the extension dd_googlesitemap by a plugin",
"homepage": "https://www.sgalinski.de", "homepage": "https://www.sgalinski.de",
"license": ["GPL-2.0+"], "license": ["GPL-2.0+"],
"version": "2.0.2", "version": "2.0.3",
"support": { "support": {
}, },
"require": { "require": {
......
...@@ -29,7 +29,7 @@ $EM_CONF[$_EXTKEY] = array( ...@@ -29,7 +29,7 @@ $EM_CONF[$_EXTKEY] = array(
'modify_tables' => '', 'modify_tables' => '',
'clearCacheOnLoad' => 0, 'clearCacheOnLoad' => 0,
'lockType' => '', 'lockType' => '',
'version' => '2.0.2', 'version' => '2.0.3',
'constraints' => array( 'constraints' => array(
'depends' => array( 'depends' => array(
'typo3' => '6.2.0-7.6.99', 'typo3' => '6.2.0-7.6.99',
......
...@@ -18,4 +18,6 @@ if (!defined('TYPO3_MODE')) { ...@@ -18,4 +18,6 @@ if (!defined('TYPO3_MODE')) {
) )
); );
?> // Xclasses
\ No newline at end of file $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['DmitryDulepov\DdGooglesitemap\Generator\PagesSitemapGenerator'] =
['className' => 'SGalinski\DdGooglesitemapPlugin\Xclass\PagesSitemapGenerator'];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment