Commit d94d4b9f authored by Fabian Galinski's avatar Fabian Galinski

[FEATURE] Initial commit

parents
<?php
namespace SGalinski\DdGoogleSitemapPlugin\Controller;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (http://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;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
/**
* Controller for google sitemap
*/
class GoogleSitemapController extends ActionController {
const DEFAULT_SITEMAP_TYPE = 'pages';
/**
* Calls the function in dd_goooglesitemap, which generates the sitemap
*
* @return void
*/
public function indexAction() {
$sitemapType = $this->getSitemapType();
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dd_googlesitemap']['sitemap'][$sitemapType])) {
$userFuncRef = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dd_googlesitemap']['sitemap'][$sitemapType];
$params = array();
GeneralUtility::callUserFunction($userFuncRef, $params, $this);
}
else {
header('HTTP/1.0 400 Bad request', true, 400);
header('Content-type: text/plain');
echo 'No generator found for type \'' . $sitemapType . '\'';
}
$this->view = NULL;
}
/**
* Determines what sitemap should be send
*
* @return string
*/
protected function getSitemapType() {
$type = GeneralUtility::_GP('sitemap');
return ($type ?: $this::DEFAULT_SITEMAP_TYPE);
}
}
?>
\ No newline at end of file
googleSitemapPage = PAGE
googleSitemapPage {
typeNum = 165165
10 < tt_content.list.20.ddgooglesitemapplugin_googlesitemap
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:text/xml
no_cache = 1
xhtml_cleaning = 0
}
}
# This setting is needed, because in other plugins this is not loaded yet
plugin.tx_ddgooglesitemapplugin {
features {
skipDefaultArguments = 1
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2013-09-27T18:42:17Z">
<header>
<type>module</type>
<description>General language labels used in frontend and backend.</description>
<generator>LFEditor</generator>
<authorName>Fabian Galinski</authorName>
<authorEmail>fabian@sgalinski.de</authorEmail>
</header>
<body>
</body>
</file>
</xliff>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2013-09-27T16:19:51Z">
<header>
<type>module</type>
<description>Language labels for the backend module belonging to extension 'rs_googlemaps'</description>
<generator>LFEditor</generator>
<authorName>Fabian Galinski</authorName>
<authorEmail>fabian@sgalinski.de</authorEmail>
</header>
<body>
<trans-unit id="titleGoogleSitemapPlugin" approved="yes" xml:space="preserve">
<source>Google Sitemap</source>
<target>Google Sitemap</target>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2013-09-27T17:01:36Z">
<header>
<type>database</type>
<description>Language labels for database tables/fields belonging to extension 'rs_googlemaps'</description>
<generator>LFEditor</generator>
<authorName>Fabian Galinski</authorName>
<authorEmail>fabian@sgalinski.de</authorEmail>
</header>
<body>
</body>
</file>
</xliff>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2013-09-27T18:42:17Z">
<header>
<type>module</type>
<description>General language labels used in frontend and backend.</description>
<generator>LFEditor</generator>
<authorName>Fabian Galinski</authorName>
<authorEmail>fabian@sgalinski.de</authorEmail>
</header>
<body>
</body>
</file>
</xliff>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2013-09-27T16:19:51Z">
<header>
<type>module</type>
<description>Language labels for the backend module belonging to extension 'rs_googlemaps'</description>
<generator>LFEditor</generator>
<authorName>Fabian Galinski</authorName>
<authorEmail>fabian@sgalinski.de</authorEmail>
</header>
<body>
<trans-unit id="titleGoogleSitemapPlugin" xml:space="preserve">
<source>Google Sitemap</source>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2013-09-27T17:01:36Z">
<header>
<type>database</type>
<description>Language labels for database tables/fields belonging to extension 'rs_googlemaps'</description>
<generator>LFEditor</generator>
<authorName>Fabian Galinski</authorName>
<authorEmail>fabian@sgalinski.de</authorEmail>
</header>
<body>
</body>
</file>
</xliff>
\ No newline at end of file
<?php
/***************************************************************
* Extension Manager/Repository config file for ext "dd_googlesitemap_plugin".
*
* Auto generated 16-04-2013 17:30
*
* Manual updates:
* Only the data in the array - everything else is removed by next
* writing. "version" and "dependencies" must not be touched!
***************************************************************/
$EM_CONF[$_EXTKEY] = array(
'title' => 'Google Sitemap Plugin',
'description' => 'Extends the extension dd_googlesitemap by a plugin',
'category' => 'plugin',
'author' => 'Fabian Galinski',
'author_email' => 'fabian@sgalinski.de',
'author_company' => 'sgalinski Internet Services',
'shy' => '',
'dependencies' => 'dd_googlesitemap',
'conflicts' => '',
'priority' => '',
'module' => '',
'state' => 'stable',
'internal' => '',
'uploadfolder' => 0,
'createDirs' => '',
'modify_tables' => '',
'clearCacheOnLoad' => 0,
'lockType' => '',
'version' => '1.0.0',
'constraints' => array(
'depends' => array(
'typo3' => '6.1.0-6.1.99',
'php' => '5.4.0-5.4.99',
'dd_googlesitemap' => '1.3.0-',
),
'conflicts' => array(
),
'suggests' => array(
),
),
'suggests' => array(
),
'_md5_values_when_last_written' => '',
);
?>
\ No newline at end of file
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
/** @noinspection PhpUndefinedVariableInspection */
// plugin configurations
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'SGalinski.dd_googlesitemap_plugin',
'GoogleSitemap',
array(
'GoogleSitemap' => 'index',
),
array(
'GoogleSitemap' => '',
)
);
?>
\ No newline at end of file
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
/** @noinspection PhpUndefinedVariableInspection */
// static extension templates
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'dd_googlesitemap_plugin', 'Configuration/TypoScript/Frontend', 'Google Sitemap Plugin'
);
// frontend plugin registrations
TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'dd_googlesitemap_plugin', 'GoogleSitemap',
'LLL:EXT:dd_googlesitemap_plugin/Resources/Private/Language/locallang_backend.xlf:titleGoogleSitemapPlugin'
);
?>
\ No newline at end of file
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