Initial import of version 0.9.0 10/32110/1
authorJavor Issapov <javor.issapov@diemedialen.de>
Tue, 12 Aug 2014 08:01:12 +0000 (10:01 +0200)
committerJavor Issapov <javor.issapov@diemedialen.de>
Tue, 12 Aug 2014 13:27:43 +0000 (15:27 +0200)
Change-Id: Ic26d8ace0119ff14760942a4c65edd85228a6657

45 files changed:
.gitignore [new file with mode: 0644]
Classes/Controller/SitemapController.php [new file with mode: 0644]
Classes/Domain/Model/Pages.php [new file with mode: 0644]
Classes/Domain/Model/Sitemap.php [new file with mode: 0644]
Classes/Domain/Repository/PagesRepository.php [new file with mode: 0644]
Classes/Domain/Repository/SitemapRepository.php [new file with mode: 0644]
Classes/Domain/Session/BackendSession.php [new file with mode: 0644]
Classes/Utility/PageData.php [new file with mode: 0644]
Classes/Utility/SitemapRenderer.php [new file with mode: 0644]
Configuration/TCA/Sitemap.php [new file with mode: 0644]
Configuration/TypoScript/constants.txt [new file with mode: 0644]
Configuration/TypoScript/setup.txt [new file with mode: 0644]
Documentation/Administrator/Index.rst [new file with mode: 0644]
Documentation/ChangeLog/Index.rst [new file with mode: 0644]
Documentation/Images/AdministratorManual/ExtensionManager.png [new file with mode: 0644]
Documentation/Images/UserManual/BackendModule.png [new file with mode: 0644]
Documentation/Images/UserManual/BackendView.png [new file with mode: 0644]
Documentation/Includes.txt [new file with mode: 0644]
Documentation/Index.rst [new file with mode: 0644]
Documentation/Introduction/Index.rst [new file with mode: 0644]
Documentation/Settings.yml [new file with mode: 0644]
Documentation/User/Index.rst [new file with mode: 0644]
Documentation/conf.py [new file with mode: 0644]
Resources/Private/.htaccess [new file with mode: 0644]
Resources/Private/Language/de.locallang.xlf [new file with mode: 0644]
Resources/Private/Language/de.locallang_csh_tx_dmgooglesitemap_domain_model_sitemap.xlf [new file with mode: 0644]
Resources/Private/Language/locallang.xlf [new file with mode: 0644]
Resources/Private/Language/locallang_csh_tx_dmgooglesitemap_domain_model_sitemap.xlf [new file with mode: 0644]
Resources/Private/Language/locallang_db.xlf [new file with mode: 0644]
Resources/Private/Language/locallang_pagelist.xlf [new file with mode: 0644]
Resources/Private/Layouts/Default.html [new file with mode: 0644]
Resources/Private/Partials/FormErrors.html [new file with mode: 0644]
Resources/Private/Partials/Sitemap/FormFields.html [new file with mode: 0644]
Resources/Private/Partials/Sitemap/page.html [new file with mode: 0644]
Resources/Private/Templates/Sitemap/Edit.html [new file with mode: 0644]
Resources/Private/Templates/Sitemap/List.html [new file with mode: 0644]
Resources/Public/Icons/relation.gif [new file with mode: 0644]
Resources/Public/Icons/tx_dmgooglesitemap_domain_model_sitemap.gif [new file with mode: 0644]
ext_conf_template.txt [new file with mode: 0644]
ext_emconf.php [new file with mode: 0644]
ext_icon.gif [new file with mode: 0644]
ext_localconf.php [new file with mode: 0644]
ext_tables.php [new file with mode: 0644]
ext_tables.sql [new file with mode: 0644]
ext_typoscript_setup.txt [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..60a1d15
--- /dev/null
@@ -0,0 +1,3 @@
+.buildpath
+.project
+.settings/
\ No newline at end of file
diff --git a/Classes/Controller/SitemapController.php b/Classes/Controller/SitemapController.php
new file mode 100644 (file)
index 0000000..259bf65
--- /dev/null
@@ -0,0 +1,235 @@
+<?php
+namespace DieMedialen\Dynamicgooglesitemap\Controller;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2014 Javor Issapov <javor.issapov@diemedialen.de>, Die Medialen GmbH
+ *  
+ *  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!
+ ***************************************************************/
+
+/**
+ *
+ * @package dynamicgooglesitemap
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
+ *
+ */
+class SitemapController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
+
+
+       /**
+        * @var \DieMedialen\Dynamicgooglesitemap\Domain\Session\BackendSession
+        * @inject
+        */
+       protected $backendSession;
+       
+       /**
+        * @var \DieMedialen\Dynamicgooglesitemap\Domain\Repository\SitemapRepository
+        * @inject
+        */
+       protected $sitemapRepository;
+
+       /**
+        * @var \DieMedialen\Dynamicgooglesitemap\Domain\Repository\PagesRepository
+        * @inject
+        */
+       protected $pagesRepository;
+       
+       /**
+        * @var \array
+        */
+       protected $flags = array();
+       
+       /**
+        * action list
+        *
+        * @param string $domain
+        * @dontvalidate $domain
+        * 
+        * @return void
+        */
+       public function listAction($domain = NULL) {
+               
+               $pid = \TYPO3\CMS\Core\Utility\MathUtility::convertToPositiveInteger($_GET['id']);
+               
+               if($pid == 0) {
+                       $this->view->assign('nopid', TRUE);
+                       $this->view->assign('nopid_msg', $this->translate('tx_dynamicgooglesitemap_domain_model_sitemap.nopage'));
+               } else {
+                       
+                       if(empty($domain)) {
+                               $sessionDomain = $this->backendSession->get('domain');
+                               if(!empty($sessionDomain)){
+                                       $domain = $sessionDomain;
+                               } else {
+                                       $domain = $this->getDomain($pid);
+                                       $this->backendSession->save('domain', $domain);
+                               }
+                       } else {
+                               $this->backendSession->save('domain', $domain);
+                       }
+                       
+                       $pages = $this->pagesRepository->getSubpages($pid);
+                       $pagesArray = $this->getSitemapForPages($pages, $domain);
+                       
+                       $this->view->assign('domain', $domain);
+                       $this->view->assign('domains', $this->getDomains());
+                       $this->view->assign('item', $pagesArray);
+                       $this->view->assign('nopid', FALSE);
+                       
+               }
+       }
+
+       /**
+        * action edit
+        *
+        * @param \DieMedialen\Dynamicgooglesitemap\Domain\Model\Sitemap $sitemap
+        * @return void
+        */
+       public function editAction(\DieMedialen\Dynamicgooglesitemap\Domain\Model\Sitemap $sitemap) {
+               $this->view->assign('sitemap', $sitemap);
+       }
+
+       /**
+        * action update
+        *
+        * @param \DieMedialen\Dynamicgooglesitemap\Domain\Model\Sitemap $sitemap
+        * 
+        * @return void
+        */
+       public function updateAction(\DieMedialen\Dynamicgooglesitemap\Domain\Model\Sitemap $sitemap ) {
+               $this->sitemapRepository->update($sitemap);
+               $this->flashMessageContainer->add($this->translate('tx_dynamicgooglesitemap_domain_model_sitemap.sitemap.update'));
+               $this->redirect('list');
+       }
+
+       /**
+        * action delete
+        *
+        * @param \DieMedialen\Dynamicgooglesitemap\Domain\Model\Sitemap $sitemap
+        * @return void
+        */
+       public function deleteAction(\DieMedialen\Dynamicgooglesitemap\Domain\Model\Sitemap $sitemap) {
+               $this->sitemapRepository->remove($sitemap);
+               $this->flashMessageContainer->add($this->translate('tx_dynamicgooglesitemap_domain_model_sitemap.sitemap.remove'));
+               $this->redirect('list');
+       }
+       
+       /**
+        * Delete All Sitemaps Action
+        * 
+        * @return void
+        */
+       public function deleteAllAction(){
+               $sessionDomain = $this->backendSession->get('domain');
+               if(empty($sessionDomain)){
+                       $this->sitemapRepository->removeAll();
+               } else {
+                       $this->sitemapRepository->removeAllByDomain($sessionDomain);
+               }
+               $this->flashMessageContainer->add($this->translate('tx_dynamicgooglesitemap_domain_model_sitemap.sitemap.allremove'));
+               $this->redirect('list');
+       }
+       
+       /**
+        * Get All Sitemap Entrieys for pages.
+        * 
+        * @param array $pages
+        * @param string $domain
+        * @param integer $level
+        * @return array <boolean, multitype:Ambigous <> array >
+        */
+       private function getSitemapForPages(array $pages, $domain, $level = 0){
+               $item = array();
+               
+               $sitemaps = $this->sitemapRepository->findForPage($pages['page']->getUid(),$domain);
+               
+               foreach($sitemaps as $sitemap) {
+                       $langId = $sitemap->getSysLanguageUid();
+                       if($langId  > 0) {
+                               if(empty($this->flags[$langId])){
+                                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('flag', 'sys_language', 'uid = ' . $langId );
+                                       $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+                                       $this->flags[$langId] = $row['flag'];
+                               }
+                               $sitemap->setSysLanguageFlag($this->flags[$langId]);
+                       }
+               }
+               
+               $item['page'] = $pages['page'];
+               for ($i = 0; $i < $level; $i++) {
+                       $item['level'][] = true;
+               }
+               if($sitemaps->count() > 0) {
+                       $item['sitemaps'] = $sitemaps; 
+               }
+               
+               if(count($pages['subpages']) > 0){
+                       $level++;
+                       foreach ($pages['subpages'] as $subpage) {
+                               $item['subpages'][] = $this->getSitemapForPages($subpage, $domain, $level);
+                       }
+               }
+               
+               return $item;
+       }
+       
+       /**
+        * Get Domain for current Page. 
+        * If there is no domain entry, return the PHP HTTP Host.
+        * 
+        * @param integer $pid
+        * @return string
+        */
+       private function getDomain($pid){
+               $rootLine = \TYPO3\CMS\Backend\Utility\BackendUtility::BEgetRootLine($pid, '', TRUE);
+               $domainRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::firstDomainrecord($rootLine);
+               
+               if (!empty($domainRecord)) { return $domainRecord; }
+               return \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('HTTP_HOST');
+       }
+       
+       /**
+        * Get Domain for current Page. 
+        * If there is no domain entry, return the PHP HTTP Host.
+        * 
+        * @return string
+        */
+       private function getDomains(){
+               $domains = array();
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('domainName', 'sys_domain', "redirectTo = '' AND hidden = 0");
+               while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){
+                       $domains[$row['domainName']] = $row['domainName'];
+               }
+               
+               return $domains;
+       }
+       
+       /**
+        * translation shortcut
+        *
+        * @param string $label
+        * @return Ambigous <string, NULL, string, unknown>
+        */
+       private function translate($label) {
+               return \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($label, 'dynamicgooglesitemap');
+       }
+}
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Model/Pages.php b/Classes/Domain/Model/Pages.php
new file mode 100644 (file)
index 0000000..6eca89c
--- /dev/null
@@ -0,0 +1,220 @@
+<?php
+namespace DieMedialen\Dynamicgooglesitemap\Domain\Model;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2014 Javor Issapov <javor.issapov@diemedialen.de>, Die Medialen GmbH
+ *  
+ *  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!
+ ***************************************************************/
+
+/**
+ *
+ *
+ * @package dynamicgooglesitemap
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
+ *
+ */
+class Pages extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
+       
+       /**
+        * uid
+        * @var integer
+        * @validate NotEmpty
+        */
+       protected $uid;
+       
+       /**
+        * pid
+        * @var integer
+        * @validate NotEmpty
+        */
+       protected $pid;
+       
+       /**
+        * sorting
+        * @var integer
+        * @validate NotEmpty
+        */
+       protected $sorting;
+       
+       /**
+        * title
+        * @var string
+        *
+        */
+       protected $title;
+       
+       /**
+        * doktype
+        * @var integer
+        */
+       protected $doktype;
+       
+       /**
+        * shortcutMode
+        * @var integer
+        */
+       protected $shortcutMode;
+       
+       /**
+        * hidden
+        * @var integer
+        */
+       protected $hidden;
+       
+       /**
+        * navHide
+        * @var integer
+        */
+       protected $navHide;
+       
+       /**
+        * feGroup
+        * @var integer
+        */
+       protected $feGroup;
+       
+       /**
+        * isSiteroot
+        * @var integer
+        */
+       protected $isSiteroot;
+       
+       
+       
+       /**
+        * Returns the pid
+        *
+        * @return int $pid
+        */
+       public function getPid() {
+               return $this->pid;
+       }
+       
+       /**
+        * Returns the sorting
+        *
+        * @return int $sorting
+        */
+       public function getSorting() {
+               return $this->sorting;
+       }
+       
+       /**
+        * Returns the title
+        *
+        * @return string $title
+        */
+       public function getTitle() {
+               return $this->title;
+       }
+       
+       /**
+        * Returns the Doktime as Integer
+        * 
+        * @return integer $doktype
+        */
+       public function getDoktype(){
+               return $this->doktype;
+       }
+       
+       /**
+        * @return integer $shortcutMode
+        */
+       public function getShortcutMode(){
+               return $this->shortcutMode;
+       }
+       
+       /**
+        * @return integer $hidden
+        */
+       public function getHidden(){
+               return $this->hidden;
+       }
+       
+       /**
+        * @return integer $navHide
+        */
+       public function getNavHide(){
+               return $this->navHide;
+       }
+       
+       /**
+        * @return integer $feGroup
+        */
+       public function getFeGroup(){
+               return $this->feGroup;
+       }
+       
+       /**
+        * @return integer $isSiteroot
+        */
+       public function getIsSiteroot(){
+               return $this->isSiteroot;
+       }
+       
+       /**
+        * Returns the CSS Class for the page icon 
+        * depending on the page Doctype
+        *
+        * @return string $css
+        */
+       public function getPageCssClass(){
+               
+               $doktype = array(
+                       1 => '-page-default',
+                       3 => '-page-shortcut-external',
+                       4 => '-page-shortcut',
+                       6 => '-page-backend-users',
+                       7 => '-page-mountpoint',
+                       199 => '-spacer',
+                       254 => '-folder-default',
+                       255 => '-page-recycler',
+               );
+               
+               $suffix = '';
+               
+               if($this->isSiteroot) {
+                       if($this->doktype == 4 && $this->shortcutMode > 0) {
+                               $suffix = '-page-shortcut-root';
+                       } else {
+                               $suffix = '-page-domain';
+                       }
+               } else {
+                       if($this->doktype == 1 && $this->navHide) {
+                               $suffix = '-page-not-in-menu';
+                       } else {
+                               $suffix = $doktype[$this->doktype];
+                       }
+               } 
+               
+               $css = 't3-icon-pagetree' . $suffix;
+               
+               if($this->doktype != 1 && $this->navHide) {
+                       $css .= '-hideinmenu';
+               }
+               
+               return $css;
+       }
+       
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Model/Sitemap.php b/Classes/Domain/Model/Sitemap.php
new file mode 100644 (file)
index 0000000..18a4a4a
--- /dev/null
@@ -0,0 +1,293 @@
+<?php
+namespace DieMedialen\Dynamicgooglesitemap\Domain\Model;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2014 Javor Issapov <javor.issapov@diemedialen.de>, Die Medialen GmbH
+ *  
+ *  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!
+ ***************************************************************/
+
+/**
+ *
+ *
+ * @package dynamicgooglesitemap
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
+ *
+ */
+class Sitemap extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
+
+       /**
+        * The coresponding page ID
+        *
+        * @var integer
+        */
+       protected $forPage;
+
+       /**
+        * The URL.
+        *
+        * @var string
+        * @validate NotEmpty
+        */
+       protected $requestUri;
+       
+       /**
+        * The HTTP Host
+        *
+        * @var string
+        * @validate NotEmpty
+        */
+       protected $httpHost;
+       
+       /**
+        * The Content Hash
+        *
+        * @var string
+        * @validate NotEmpty
+        */
+       protected $contentHash;
+
+       /**
+        * Priority of the url in context to the whole  sitemap.
+        *
+        * @var integer
+        */
+       protected $priority;
+
+       /**
+        * Date when the content of the url was last changed.
+        *
+        * @var \DateTime
+        */
+       protected $lastmod;
+       
+       /**
+        * $_GET Params for this URL
+        * 
+        * @var string
+        */
+       protected $urlParams;
+       
+       /**
+        * sys_language_uid 
+        * 
+        * @var integer
+        */
+       protected $sysLanguageUid;
+       
+       /**
+        * Flag short name from language
+        * 
+        * @var string
+        */
+       protected $sysLanguageFlag;
+
+       /**
+        * Returns the forPage
+        *
+        * @return integer $forPage
+        */
+       public function getForPage() {
+               return $this->forPage;
+       }
+
+       /**
+        * Sets the forPage
+        *
+        * @param integer $forPage
+        * @return void
+        */
+       public function setForPage($forPage) {
+               $this->forPage = $forPage;
+       }
+
+       /**
+        * Returns the url
+        *
+        * @return string $requestUri
+        */
+       public function getRequestUri() {
+               return $this->requestUri;
+       }
+
+       /**
+        * Sets the url
+        *
+        * @param string $requestUri
+        * @return void
+        */
+       public function setRequestUri($requestUri) {
+               $this->requestUri = $requestUri;
+       }
+       
+       /**
+        * Returns the HTTP Host
+        *
+        * @return string $httpHost
+        */
+       public function getHttpHost() {
+               return $this->httpHost;
+       }
+
+       /**
+        * Sets the HTTP Host
+        *
+        * @param string $httpHost
+        * @return void
+        */
+       public function setHttpHost($httpHost) {
+               $this->httpHost = $httpHost;
+       }
+       
+       /**
+        * Returns the Content Hash
+        *
+        * @return string $contentHash
+        */
+       public function getContentHash() {
+               return $this->contentHash;
+       }
+
+       /**
+        * Sets the Content Hash
+        *
+        * @param string $contentHash
+        * @return void
+        */
+       public function setContentHash($contentHash) {
+               $this->contentHash = $contentHash;
+       }
+
+       /**
+        * Returns the priority
+        *
+        * @return integer $priority
+        */
+       public function getPriority() {
+               return $this->priority;
+       }
+
+       /**
+        * Sets the priority
+        *
+        * @param integer $priority
+        * @return void
+        */
+       public function setPriority($priority) {
+               $this->priority = $priority;
+       }
+
+       /**
+        * Returns the lastmod
+        *
+        * @return \DateTime $lastmod
+        */
+       public function getLastmod() {
+               return $this->lastmod;
+       }
+
+       /**
+        * Sets the lastmod
+        *
+        * @param \DateTime $lastmod
+        * @return void
+        */
+       public function setLastmod($lastmod) {
+               $this->lastmod = $lastmod;
+       }
+
+       /**
+        * Returns the URL Params
+        * 
+        * @return string
+        */
+       public function getUrlParams(){
+               return $this->urlParams;
+       }
+       
+       /**
+        * Sets the URL Params
+        * 
+        * @param string $urlParams
+        * @return void
+        */
+       public function setUrlParams($urlParams) {
+               $this->urlParams = $urlParams;
+       }
+
+       /**
+        * Returns the sysLanguageUid
+        * 
+        * @return integer
+        */
+       public function getSysLanguageUid(){
+               return $this->sysLanguageUid;
+       }
+
+       /**
+        * Sets the sysLanguageUid
+        * 
+        * @param integer $sysLanguageUid
+        * @return void
+        */
+       public function setSysLanguageUid($sysLanguageUid) {
+               $this->sysLanguageUid = $sysLanguageUid;
+       }
+       
+       /**
+        * Returns the sysLanguageFlag
+        * 
+        * @return string
+        */
+       public function getSysLanguageFlag(){
+               return $this->sysLanguageFlag;
+       }
+
+       /**
+        * Sets the sysLanguageFlag
+        * 
+        * @param string $sysLanguageFlag
+        * @return void
+        */
+       public function setSysLanguageFlag($sysLanguageFlag) {
+               $this->sysLanguageFlag = $sysLanguageFlag;
+       }
+       
+       /**
+        * Returns a trimed string of the URL Params.
+        * 
+        * @return string
+        */
+       public function getUrlParamsTrimed(){
+               return \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($this->urlParams, 50);
+       }
+       
+       /**
+        * Returns a trimed string of the Request URI.
+        * 
+        * @return string
+        */
+       public function getRequestUriTrimed(){
+               return \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($this->requestUri, 50);
+       }
+       
+}
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Repository/PagesRepository.php b/Classes/Domain/Repository/PagesRepository.php
new file mode 100644 (file)
index 0000000..ba20e99
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+namespace DieMedialen\Dynamicgooglesitemap\Domain\Repository;
+/***************************************************************
+ *  Copyright notice
+*
+*  (c) 2010-2013 Extbase Team (http://forge.typo3.org/projects/typo3v4-mvc)
+*  Extbase is a backport of TYPO3 Flow. All credits go to the TYPO3 Flow team.
+*  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.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  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!
+***************************************************************/
+/**
+ * A Frontend User repository
+*
+* @api
+*/
+class PagesRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
+
+       /**
+        *
+        * @param integer $pid
+        * @return TYPO3\CMS\Extbase\Persistence\Generic\QueryResult
+        */
+       public function findByPid($pid) {
+               
+               $query = $this->createQuery();
+               $query->getQuerySettings()->setRespectStoragePage(FALSE)->setIgnoreEnableFields(TRUE);
+               $query->matching($query->equals('pid', $pid));
+               
+               return $query->execute();
+       }
+       
+       /**
+        * 
+        * @param mixed $page
+        * @return multitype:
+        */
+       function getSubpages($page) {
+               $pagesArray = Array();
+               
+               if(is_int($page)) {
+                       $currentPage = $this->findByUid($page);
+               } else {
+                       $currentPage = $page;
+               }
+               
+               $subpages = $this->findByPid($currentPage->getUid());
+               $subpagesArray = array();
+               
+               foreach($subpages as $key => $subpage) {
+                       $subpagesArray[] = $this->getSubpages($subpage);
+               }
+               
+               $pagesArray['page'] = $currentPage;
+               $pagesArray['subpages'] = $subpagesArray;
+               
+               return $pagesArray; 
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Repository/SitemapRepository.php b/Classes/Domain/Repository/SitemapRepository.php
new file mode 100644 (file)
index 0000000..3d5a7ff
--- /dev/null
@@ -0,0 +1,135 @@
+<?php
+namespace DieMedialen\Dynamicgooglesitemap\Domain\Repository;
+/***************************************************************
+ *  Copyright notice
+*
+*  (c) 2010-2013 Extbase Team (http://forge.typo3.org/projects/typo3v4-mvc)
+*  Extbase is a backport of TYPO3 Flow. All credits go to the TYPO3 Flow team.
+*  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.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  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!
+***************************************************************/
+/**
+ * A Frontend User repository
+*
+* @api
+*/
+class SitemapRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
+       
+       /**
+        * Set Default Query Settings
+        *
+        * @return void
+        */
+       public function initializeObject() {
+               /** @var $querySettings \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings */
+               $querySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings');
+               $querySettings->setRespectStoragePage(FALSE);
+               $querySettings->setIgnoreEnableFields(FALSE);
+               $querySettings->setRespectSysLanguage(FALSE);
+               $this->setDefaultQuerySettings($querySettings);
+               
+               $this->setDefaultOrderings(array(
+                       'for_page' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING,
+                       'request_uri' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING,
+               ));
+               
+       }
+       
+       /**
+        * Returns all objects of this repository.
+        *
+        * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface|array
+        * @api
+        */
+       public function findAll() {
+               $query = $this->createQuery();
+               $result = $query->execute();
+               return $result;
+       }
+
+       /**
+        * Finds an object matching the given identifier.
+        *
+        * @param integer $uid The identifier of the object to find
+        * @return object The matching object if found, otherwise NULL
+        * @api
+        */
+       public function findByUid($uid) {
+               
+               $query = $this->createQuery();
+               $result = $query->matching($query->equals('uid', $uid))->execute()->getFirst();
+               
+               return $result;
+       }
+
+       /**
+        * Finds an object matching the given identifier.
+        *
+        * @param integer $uid The identifier of the object to find
+        * @return object The matching object if found, otherwise NULL
+        * @api
+        */
+       public function findByDomain($domain) {
+               
+               $query = $this->createQuery();
+               $result = $query->matching($query->like('http_host', '%'.$domain))->execute();
+               
+               return $result;
+       }
+       
+       /**
+        * Removes all objects for the given domain
+        *
+        * @return void
+        * @api
+        */
+       public function removeAllByDomain($domain) {
+               foreach ($this->findByDomain($domain) AS $object) {
+                       $this->remove($object);
+               }
+       }
+       
+       /**
+        * Return all Sitemap entrys for a given page and domain.
+        * 
+        * @param integer $uid the id of the page
+        * @param string $domain damain for filtering.
+        * @return object The matching object if found, otherwise NULL
+        * @api
+        */
+       public function findForPage($uid,$domain) {
+
+               $query = $this->createQuery();
+               $query->matching(
+                       $query->logicalAnd(
+                               $query->equals('for_page', $uid),
+                               $query->like('http_host', '%'.$domain)
+                       )
+               );
+               $query->setOrderings(array(
+                       'sys_language_uid' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING
+               ));
+               
+               return $query->execute();
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Session/BackendSession.php b/Classes/Domain/Session/BackendSession.php
new file mode 100644 (file)
index 0000000..1cc929d
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+namespace DieMedialen\Dynamicgooglesitemap\Domain\Session;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2014 Javor Issapov <javor.issapov@diemedialen.de>, Die Medialen GmbH
+ *  
+ *  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!
+ ***************************************************************/
+class BackendSession extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
+       
+       /**
+        * @var string
+        */
+       protected $sessionKey = 'tx_dynamicgooglesitemap';
+       
+       /**
+        * @param string $sessionKey
+        * @return void
+        */
+       public function setSessionKey($sessionKey) {
+               $this->sessionKey = $sessionKey;
+       }
+       
+       /**
+        * @return string
+        */
+       public function getSessionKey() {
+               return $this->sessionKey;
+       }
+       
+       /**
+        * @param string $key
+        * @param mixed $value
+        * @return void
+        */
+       public function save($key, $value) {
+               $data = $GLOBALS['BE_USER']->getSessionData($this->sessionKey);
+               $data[$key] = $value;
+               $GLOBALS['BE_USER']->setAndSaveSessionData($this->sessionKey, $data);
+       }
+       
+       /**
+        * @param string $key
+        * @return mixed
+        */
+       public function get($key) {
+               $data = $GLOBALS['BE_USER']->getSessionData($this->sessionKey);
+               if(isset($data[$key])){
+                       return $data[$key];
+               }
+               return NULL;
+       }
+       
+       /**
+        * @param string $key
+        * @return void
+        */
+       public function delete($key) {
+               $data = $GLOBALS['BE_USER']->getSessionData($this->sessionKey);
+               unset($data[$key]);
+               $GLOBALS['BE_USER']->setAndSaveSessionData($this->sessionKey, $data);
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Utility/PageData.php b/Classes/Utility/PageData.php
new file mode 100644 (file)
index 0000000..72ea605
--- /dev/null
@@ -0,0 +1,111 @@
+<?php
+namespace DieMedialen\Dynamicgooglesitemap\Utility;
+
+class PageData {
+       
+       /**
+        * Table name where the Sitemap are stored.
+        * @var string
+        */
+       private $table = 'tx_dynamicgooglesitemap_domain_model_sitemap';
+       
+       /**
+        * Gather all needed Data and Insert or Update into Database.
+        * 
+        * @param array $params
+        * @return void
+        */
+       public function getData(&$params) {
+               
+               $tsConfig = $GLOBALS['TSFE']->tmpl->setup['config.'];
+               $gpVars = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET();
+               
+               $pageUid = intval($GLOBALS['TSFE']->page['uid']);
+               $doktype = intval($GLOBALS['TSFE']->page['doktype']);
+               $feAuth = intval($GLOBALS['TSFE']->page['fe_group']);
+               $gpVars['id'] = $pageUid;
+               $contentHash = md5($params['bodyContent']);
+               
+               $lang = 0;
+               if(isset($gpVars['L'])){
+                       $lang = intval($gpVars['L']);
+               }
+               
+               $langKey = 'x-default';
+               if(
+                       !empty($tsConfig['sys_language_uid']) && 
+                       intval($tsConfig['sys_language_uid']) == $lang && 
+                       !empty($tsConfig['language'])
+               ) {
+                       $langKey = $tsConfig['language'];
+               }
+               
+               // Ignore non-standard pages or pages where a login is required.
+               // We don't want secured pages to appear on the sitemap.
+               if(empty($pageUid) || $doktype != 1 || $feAuth != 0) {return;}
+               
+               $lastChanged = intval($GLOBALS['TSFE']->page['SYS_LASTCHANGED']);
+               if($lastChanged == 0) {$lastChanged = time();}
+               
+               $httpHost = $_SERVER['HTTP_HOST'];
+               $requestUri = $_SERVER['REQUEST_URI'];
+               $urlParams = $this->getGetParams($gpVars);
+
+               $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow ('*', $this->table, 'http_host = \'' .  $httpHost . '\' AND for_page = ' . $pageUid . ' AND url_params = \'' . $urlParams . '\' AND sys_language_uid = \'' . $lang . '\' ');
+               if($row == NULL) {
+                       $insertArray = array(
+                                       'for_page' => $pageUid,
+                                       'url_params' => $urlParams,
+                                       'http_host' => $httpHost,
+                                       'request_uri' => $requestUri,
+                                       'content_hash' => $contentHash,
+                                       'lastmod' => $lastChanged,
+                                       'sys_language_uid' => $lang,
+                                       'lang_key' => $tsConfig['language']
+                       );
+                       $res = $GLOBALS['TYPO3_DB']->exec_INSERTquery($this->table, $insertArray);
+               } else if($row['content_hash'] != $contentHash || $row['request_uri'] != $requestUri ) {
+
+                       $where_clause = 'for_page = ' . $pageUid. ' AND url_params = \'' . $urlParams . '\' AND sys_language_uid = ' . $tsConfig['sys_language_uid'];
+                       $field_values = array(
+                               'request_uri' => $requestUri,
+                               'lastmod' => $lastChanged
+                       );
+                       $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery( $this->table, $where_clause, $field_values);
+               }
+               
+       }
+       
+       /**
+        * 
+        * This function rebuilds the GET Parameters some of the parameters can be ignored. 
+        *  Configurable through the Extensions Configuration.
+        * 
+        * @param array $params
+        * @return string
+        */
+       private function getGetParams($params){
+               
+               $confArray = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dynamicgooglesitemap']);
+               $ignoreParams = explode(',', $confArray['ignoreParams']);
+               $ignoreParams[] = 'L';
+               
+               ksort($params);
+               $str = "";
+               foreach ($params as $key => $value) {
+                       #if($key == 'id') {continue;}
+                       if(in_array($key,$ignoreParams)) {continue;}
+                       if(is_array($value)){
+                               ksort($value);
+                               foreach ($value as $k => $v) {
+                                       if(!empty($v)){ $str .= '&' . $key . '['. $k .']='. $v; }
+                               }
+                       } else {
+                               if(!empty($value)){ $str .= '&' . $key . '=' . $value ; }
+                       }
+               }
+               return urldecode($str);
+       }
+       
+}
+?>
\ No newline at end of file
diff --git a/Classes/Utility/SitemapRenderer.php b/Classes/Utility/SitemapRenderer.php
new file mode 100644 (file)
index 0000000..d3590fc
--- /dev/null
@@ -0,0 +1,112 @@
+<?php
+namespace DieMedialen\Dynamicgooglesitemap\Utility;
+
+header('Content-Type: application/xml; charset=utf-8');
+
+class SitemapRenderer {
+       
+       private $table = 'tx_dynamicgooglesitemap_domain_model_sitemap';
+       
+       // mapping the names form extension configuration (sorting) to actual table fields.
+       private $field = array('UID' => 's.for_page', 'PageTitle' => 'p.title', 'URL' => 's.request_uri', 'LastChanged' => 's.lastmod' );
+       
+       function main() {
+               
+               $this->initTSFE();
+               $httpHost = $_SERVER['HTTP_HOST'];
+               $confArray = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dynamicgooglesitemap']);
+               $orderBy = $this->field[$confArray['sorting']];
+               
+               $respectEnableFields = ' AND p.hidden=0 AND (p.starttime<=' . time() . ') AND (p.endtime=0 OR p.endtime>' . time() . ') AND p.deleted=0';
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       '*', 
+                       'pages p, tx_dynamicgooglesitemap_domain_model_sitemap s', 
+                       'p.uid = s.for_page AND http_host = \'' . $httpHost . '\'' . $respectEnableFields,
+                       '', // Group By
+                       $orderBy
+               );
+               
+               // collect all sitemap entryies in one array for easy rendering if site has more than one language.
+               $sitemap = array();
+               while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){
+                       $sitemap[$row['url_params']][$row['sys_language_uid']] = $row;
+               }
+               
+               echo '<?xml version="1.0" encoding="UTF-8"?>'. "\n";
+               echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">' . "\n";
+               
+               foreach($sitemap as $page) {
+                       $date = new \DateTime();
+                       
+                       /**
+                        * Google Sitemap needs a entry for each language with cross reference to all other languages
+                        * For mor informations visit: 
+                        *              https://support.google.com/webmasters/answer/189077
+                        *              https://support.google.com/webmasters/answer/2620865
+                        *
+                        */
+                       if(count($page) > 1) {
+                               foreach($page as $lang) {
+                                       $date->setTimestamp($lang['SYS_LASTCHANGED']);
+                                       $prio = sprintf('%0.1F', intval($lang['priority']) / 10);
+                                       
+                                       echo "\t" . '<url>' . "\n";
+                                               echo "\t\t" . '<loc><![CDATA[http://' . $lang['http_host'] . $lang['request_uri'] . ']]></loc>' . "\n";
+                                               foreach($page as $ref) {
+                                                       echo "\t\t" . '<xhtml:link rel="alternate" hreflang="' . $ref['lang_key'] . '" href="http://' . $ref['http_host'] . str_replace('&', '&amp;', str_replace('&amp;', '&', $ref['request_uri'])) . '" />' . "\n";
+                                               }
+                                               echo "\t\t" . '<lastmod>' . $date->format('Y-m-d') . '</lastmod>' . "\n";
+                                               echo "\t\t" . '<changefreq>monthly</changefreq>' . "\n";
+                                               echo "\t\t" . '<priority>' . $prio . '</priority>' . "\n";
+                                       echo "\t" . '</url>' . "\n";
+                               }
+                               
+                       } else {
+                               foreach($page as $lang) {
+                                       $date->setTimestamp($lang['SYS_LASTCHANGED']);
+                                       $prio = sprintf('%0.1F', intval($lang['priority']) / 10);
+                                       echo "\t" . '<url>' . "\n";
+                                               echo "\t\t" . '<loc><![CDATA[http://' . $lang['http_host'] . $lang['request_uri'] . ']]></loc>' . "\n";
+                                               echo "\t\t" . '<lastmod>' . $date->format('Y-m-d') . '</lastmod>' . "\n";
+                                               echo "\t\t" . '<changefreq>monthly</changefreq>' . "\n";
+                                               echo "\t\t" . '<priority>' . $prio . '</priority>' . "\n";
+                                       echo "\t" . '</url>' . "\n";
+                               }
+                       }
+               }
+               echo '</urlset>';
+       }
+       
+       /**
+        * Taken form http://typo3.org/documentation/snippets/sd/466/
+        */
+       function initTSFE(){
+               
+               /** @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $TSFE */
+               $TSFE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], 0, 0);
+                
+               // Initialize Language
+               \TYPO3\CMS\Frontend\Utility\EidUtility::initLanguage();
+                
+               // Initialize FE User.
+               $TSFE->initFEuser();
+                
+               // Important: no Cache for Ajax stuff
+               $TSFE->set_no_cache();
+               $TSFE->checkAlternativeIdMethods();
+               $TSFE->determineId();
+               $TSFE->initTemplate();
+               $TSFE->getConfigArray();
+               
+               // not instancieated??
+               //\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadCachedTca();
+               $TSFE->cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer');
+               $TSFE->settingLanguage();
+               $TSFE->settingLocale();
+       }
+}
+
+$sitemap = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('DieMedialen\Dynamicgooglesitemap\Utility\SitemapRenderer');
+$sitemap->main();
+
+?>
\ No newline at end of file
diff --git a/Configuration/TCA/Sitemap.php b/Configuration/TCA/Sitemap.php
new file mode 100644 (file)
index 0000000..f44962a
--- /dev/null
@@ -0,0 +1,134 @@
+<?php
+if (!defined ('TYPO3_MODE')) {
+       die ('Access denied.');
+}
+
+$TCA['tx_dynamicgooglesitemap_domain_model_sitemap'] = array(
+       'ctrl' => $TCA['tx_dynamicgooglesitemap_domain_model_sitemap']['ctrl'],
+       'interface' => array(
+               'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, for_page, http_host, request_uri, content_hash, url_params, priority, lastmod, lang_key',
+       ),
+       'types' => array(
+               '1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, for_page, http_host, request_uri, content_hash,  url_params, priority, lastmod, lang_key'),
+       ),
+       'palettes' => array(
+               '1' => array('showitem' => ''),
+       ),
+       'columns' => array(
+               'sys_language_uid' => array(
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language',
+                       'config' => array(
+                               'type' => 'select',
+                               'foreign_table' => 'sys_language',
+                               'foreign_table_where' => 'ORDER BY sys_language.title',
+                               'items' => array(
+                                       array('LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1),
+                                       array('LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0)
+                               ),
+                       ),
+               ),
+               'l10n_parent' => array(
+                       'displayCond' => 'FIELD:sys_language_uid:>:0',
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent',
+                       'config' => array(
+                               'type' => 'select',
+                               'items' => array(
+                                       array('', 0),
+                               ),
+                               'foreign_table' => 'tx_dynamicgooglesitemap_domain_model_sitemap',
+                               'foreign_table_where' => 'AND tx_dynamicgooglesitemap_domain_model_sitemap.pid=###CURRENT_PID### AND tx_dynamicgooglesitemap_domain_model_sitemap.sys_language_uid IN (-1,0)',
+                       ),
+               ),
+               'l10n_diffsource' => array(
+                       'config' => array(
+                               'type' => 'passthrough',
+                       ),
+               ),
+               't3ver_label' => array(
+                       'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel',
+                       'config' => array(
+                               'type' => 'input',
+                               'size' => 30,
+                               'max' => 255,
+                       )
+               ),
+               'for_page' => array(
+                       'exclude' => 0,
+                       'label' => 'LLL:EXT:dynamicgooglesitemap/Resources/Private/Language/locallang_db.xlf:tx_dynamicgooglesitemap_domain_model_sitemap.for_page',
+                       'config' => array(
+                               'type' => 'input',
+                               'size' => 4,
+                               'eval' => 'int'
+                       ),
+               ),
+               'http_host' => array(
+                       'exclude' => 0,
+                       'label' => 'LLL:EXT:dynamicgooglesitemap/Resources/Private/Language/locallang_db.xlf:tx_dynamicgooglesitemap_domain_model_sitemap.url',
+                       'config' => array(
+                               'type' => 'input',
+                               'size' => 255,
+                               'eval' => 'trim,required'
+                       ),
+               ),
+               'request_uri' => array(
+                       'exclude' => 0,
+                       'label' => 'LLL:EXT:dynamicgooglesitemap/Resources/Private/Language/locallang_db.xlf:tx_dynamicgooglesitemap_domain_model_sitemap.url',
+                       'config' => array(
+                               'type' => 'input',
+                               'size' => 255,
+                               'eval' => 'trim,required'
+                       ),
+               ),
+               'content_hash' => array(
+                       'exclude' => 0,
+                       'label' => 'LLL:EXT:dynamicgooglesitemap/Resources/Private/Language/locallang_db.xlf:tx_dynamicgooglesitemap_domain_model_sitemap.url',
+                       'config' => array(
+                               'type' => 'input',
+                               'size' => 32,
+                               'eval' => 'trim,required'
+                       ),
+               ),
+               'lang_key' => array(
+                       'exclude' => 0,
+                       'label' => 'LLL:EXT:dynamicgooglesitemap/Resources/Private/Language/locallang_db.xlf:tx_dynamicgooglesitemap_domain_model_sitemap.url',
+                       'config' => array(
+                               'type' => 'input',
+                               'size' => 10,
+                               'eval' => 'trim,required'
+                       ),
+               ),
+               'url_params' => array(
+                       'exclude' => 0,
+                       'label' => 'LLL:EXT:dynamicgooglesitemap/Resources/Private/Language/locallang_db.xlf:tx_dynamicgooglesitemap_domain_model_sitemap.url_params',
+                       'config' => array(
+                               'type' => 'input',
+                               'size' => 255,
+                               'eval' => 'trim'
+                       ),
+               ),
+               'priority' => array(
+                       'exclude' => 0,
+                       'label' => 'LLL:EXT:dynamicgooglesitemap/Resources/Private/Language/locallang_db.xlf:tx_dynamicgooglesitemap_domain_model_sitemap.priority',
+                       'config' => array(
+                               'type' => 'input',
+                               'size' => 4,
+                               'eval' => 'int'
+                       ),
+               ),
+               'lastmod' => array(
+                       'exclude' => 0,
+                       'label' => 'LLL:EXT:dynamicgooglesitemap/Resources/Private/Language/locallang_db.xlf:tx_dynamicgooglesitemap_domain_model_sitemap.lastmod',
+                       'config' => array(
+                               'type' => 'input',
+                               'size' => 7,
+                               'eval' => 'date',
+                               'checkbox' => 1,
+                               'default' => time()
+                       ),
+               ),
+       ),
+);
+
+?>
\ No newline at end of file
diff --git a/Configuration/TypoScript/constants.txt b/Configuration/TypoScript/constants.txt
new file mode 100644 (file)
index 0000000..4413734
--- /dev/null
@@ -0,0 +1,14 @@
+module.tx_dynamicgooglesitemap {
+       view {
+               # cat=module.tx_dynamicgooglesitemap/file; type=string; label=Path to template root (BE)
+               templateRootPath = EXT:dynamicgooglesitemap/Resources/Private/Backend/Templates/
+               # cat=module.tx_dynamicgooglesitemap/file; type=string; label=Path to template partials (BE)
+               partialRootPath = EXT:dynamicgooglesitemap/Resources/Private/Backend/Partials/
+               # cat=module.tx_dynamicgooglesitemap/file; type=string; label=Path to template layouts (BE)
+               layoutRootPath = EXT:dynamicgooglesitemap/Resources/Private/Backend/Layouts/
+       }
+       persistence {
+               # cat=module.tx_dynamicgooglesitemap//a; type=string; label=Default storage PID
+               storagePid =
+       }
+}
\ No newline at end of file
diff --git a/Configuration/TypoScript/setup.txt b/Configuration/TypoScript/setup.txt
new file mode 100644 (file)
index 0000000..dd7d5d0
--- /dev/null
@@ -0,0 +1,11 @@
+# Module configuration
+module.tx_dynamicgooglesitemap {
+       persistence {
+               storagePid = {$module.tx_dynamicgooglesitemap.persistence.storagePid}
+       }
+       view {
+               templateRootPath = {$module.tx_dynamicgooglesitemap.view.templateRootPath}
+               partialRootPath = {$module.tx_dynamicgooglesitemap.view.partialRootPath}
+               layoutRootPath = {$module.tx_dynamicgooglesitemap.view.layoutRootPath}
+       }
+}
\ No newline at end of file
diff --git a/Documentation/Administrator/Index.rst b/Documentation/Administrator/Index.rst
new file mode 100644 (file)
index 0000000..a485b92
--- /dev/null
@@ -0,0 +1,65 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. include:: ../Includes.txt
+
+
+.. _admin-manual:
+
+Administrator Manual
+====================
+
+Target group: **Administrators**
+
+.. _admin-installation:
+
+Installation
+------------
+
+|extension_name| is easy to implement. Just install and it is ready to go.
+
+
+How it works
+------------
+
+This extension has three main sections: the backend module, a hook in the page renderer and a small renderer for the sitemap XML.
+The backend module is designed for a nice overview of all sitemap entries, managing the priority and deleting unwanted or old entries.
+The hook in the page renderer is the main code responsible for gathering all required information (page id, request parameters, request url, language and last changed). This information is then insert into the database.
+The small XML renderer is implemented using the eID directive and renders the sitemap XML based on the data in the database.
+
+.. _admin-configuration:
+
+Configuration
+-------------
+
+The main configuration is handled on the Extension Manager Configuration page of the extension.
+
+**Ignor Parameters** (``basic.ignorParams``)
+   
+   Since the extension identifies an entry by `pid`, `url params` and `language` it might be required to ignore some of the parameters. Parameters that are random or don't change the content of the page can be added here in a comma seperated list.
+
+**Sort Sitemap by Field** (``basic.sorting``)
+   
+   Here you can choose how the sitemap should be sorted:
+   
+* ``UID`` : this is the uid of the page.
+* ``PageTitle`` : Alphabetical by page title.
+* ``URL`` : Alphabetical by URL.
+* ``LastChanged`` : Sort from newest to oldest changed page.
+   
+.. important::
+
+   If your site is multilingual: Make sure that your typoscript configuration is correct.
+   |extension_name| uses the TypoScript configuration ``config.language = __`` to get the correct language key.
+   If the language is not configured the sitemap will use ``x-default`` as language key.
+
+Human readable URL to the Sitemap.
+----------------------------------
+
+If you want to rename the URL to the Sitemap you can use mod_rewrite in the .htaccess.
+
+.. code-block::        htaccess
+
+       RewriteRule sitemap.xml$ /index.php?eID=dynamicgooglesitemap [L,R=301]
\ No newline at end of file
diff --git a/Documentation/ChangeLog/Index.rst b/Documentation/ChangeLog/Index.rst
new file mode 100644 (file)
index 0000000..4a83ca5
--- /dev/null
@@ -0,0 +1,22 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. include:: ../Includes.txt
+
+
+.. _changelog:
+
+ChangeLog
+=========
+
++----------------+----------+-----------------------------------------------+
+| Date           | Version  | Description                                   |
++================+==========+===============================================+
+| 2014-05-27     | 0.1.6    | Adding a Language flag to the Backend Module  |
++----------------+----------+-----------------------------------------------+
+| 2014-05-27     | 0.1.5    | Completition of the Documentation             |
++----------------+----------+-----------------------------------------------+
+| 2014-05-16     | 0.1.0    | Completition of the alpha version             |
++----------------+----------+-----------------------------------------------+
diff --git a/Documentation/Images/AdministratorManual/ExtensionManager.png b/Documentation/Images/AdministratorManual/ExtensionManager.png
new file mode 100644 (file)
index 0000000..67ea693
Binary files /dev/null and b/Documentation/Images/AdministratorManual/ExtensionManager.png differ
diff --git a/Documentation/Images/UserManual/BackendModule.png b/Documentation/Images/UserManual/BackendModule.png
new file mode 100644 (file)
index 0000000..443b156
Binary files /dev/null and b/Documentation/Images/UserManual/BackendModule.png differ
diff --git a/Documentation/Images/UserManual/BackendView.png b/Documentation/Images/UserManual/BackendView.png
new file mode 100644 (file)
index 0000000..634568c
Binary files /dev/null and b/Documentation/Images/UserManual/BackendView.png differ
diff --git a/Documentation/Includes.txt b/Documentation/Includes.txt
new file mode 100644 (file)
index 0000000..9be4e06
--- /dev/null
@@ -0,0 +1,35 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. This is 'Includes.txt'. It is included at the very top of each and
+   every ReST source file in this documentation project (= manual).
+
+.. ==================================================
+.. CONTENT SUBSTITUTION
+.. --------------------------------------------------
+
+.. |author_name| replace:: Javor Issapov
+.. |author_mail| replace:: javor.issapov@diemedialen.de
+.. |extension_key| replace:: dynamicgooglesitemap
+.. |extension_name| replace:: Google Sitemap
+.. |extension_version| replace:: 0.9.0
+.. |date_time| date:: %m-%d-%Y %H:%M
+.. |date| date:: %Y-%m-%d
+.. |time| date:: %H:%M
+
+.. ==================================================
+.. DEFINE SOME TEXT ROLES
+.. --------------------------------------------------
+
+.. role::   htaccess
+
+.. role::   typoscript(code)
+
+.. role::   ts(typoscript)
+   :class:  typoscript
+
+.. role::   php(code)
+
+.. highlight:: php
diff --git a/Documentation/Index.rst b/Documentation/Index.rst
new file mode 100644 (file)
index 0000000..6da5b01
--- /dev/null
@@ -0,0 +1,62 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. include:: Includes.txt
+
+
+.. _start:
+
+================
+|extension_name|
+================
+
+.. only:: html
+
+       :Classification:
+               <|extension_key|>
+
+       :Version:
+               |extension_version|
+
+       :Language:
+               en
+
+       :Description:
+               Manual covering TYPO3 extension <|extension_name|>
+
+       :Keywords:
+               Google Sitemap
+
+       :Copyright:
+               2014
+
+       :Author:
+               |author_name|
+
+       :Email:
+               |author_mail|
+
+       :License:
+               This document is published under the Open Content License
+               available from http://www.opencontent.org/opl.shtml
+
+       :Rendered:
+               |today|
+
+       The content of this document is related to TYPO3,
+       a GNU/GPL CMS/Framework available from `www.typo3.org <http://www.typo3.org/>`_.
+
+
+       **Table of Contents**
+
+.. toctree::
+       :maxdepth: 5
+       :titlesonly:
+       :glob:
+
+       Introduction/Index
+       User/Index
+       Administrator/Index
+       ChangeLog/Index
diff --git a/Documentation/Introduction/Index.rst b/Documentation/Introduction/Index.rst
new file mode 100644 (file)
index 0000000..2d9d155
--- /dev/null
@@ -0,0 +1,33 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. include:: ../Includes.txt
+
+
+.. _introduction:
+
+Introduction
+============
+
+
+.. _what-it-does:
+
+What does it do?
+----------------
+
+The extension "|extension_name|" generates a sitemap (XML file) with google standards for your website.
+
+What problem does it solve?
+---------------------------
+
+This extension is designed because of a need to have a propper sitemap for pages with dynamic content. A lot of other extensions (ie. tt_news, news) are using a detail page to render the content based on parameters. Other sitemap extensions would insert only the detail page in to the sitemap or need a special configuration. 
+This extension does not need any configuration for dynamic pages.
+This extension handles multidomain and multilingual sites without any problems. 
+
+Who is interested in this?
+--------------------------
+
+If you need a sitemap.xml for your website.
+Or if you are using an extension that is using a detail page and parameters to render individual content and you would like all items to be insert into the sitemap, than this is the extension for you.
\ No newline at end of file
diff --git a/Documentation/Settings.yml b/Documentation/Settings.yml
new file mode 100644 (file)
index 0000000..0e0f50f
--- /dev/null
@@ -0,0 +1,29 @@
+# This is the project specific Settings.yml file.
+# Place Sphinx specific build information here.
+# Settings given here will replace the settings of 'conf.py'.
+
+# Below is an example of intersphinx mapping declaration
+# Add more mappings depending on what manual you want to link to
+# Remove entirely if you don't need cross-linking
+
+---
+conf.py:
+  copyright: 2012-2013
+  project: Dynamic Google Sitemap
+  version: 0.0
+  release: 0.0.1
+  intersphinx_mapping:
+    t3tsref:
+    - http://docs.typo3.org/typo3cms/TyposcriptReference/
+    - null
+  latex_documents:
+  - - Index
+    - <extension_key>.tex
+    - Dynamic Google Sitemap
+    - Javor Issapov
+    - manual
+  latex_elements:
+    papersize: a4paper
+    pointsize: 10pt
+    preamble: \usepackage{typo3}
+...
diff --git a/Documentation/User/Index.rst b/Documentation/User/Index.rst
new file mode 100644 (file)
index 0000000..e5ebdc8
--- /dev/null
@@ -0,0 +1,43 @@
+.. ==================================================
+.. FOR YOUR INFORMATION
+.. --------------------------------------------------
+.. -*- coding: utf-8 -*- with BOM.
+
+.. include:: ../Includes.txt
+
+
+.. _user-manual:
+
+Users Manual
+============
+
+Target group: **Editors**
+
+
+.. figure:: ../Images/UserManual/BackendModule.png
+   :width: 189px
+   :alt: |extension_name| Module
+   
+This is backend view of TYPO3 after installing "|extension_name|".
+
+After clicking on the |extension_name| module you will see a page listing with the sitemap entries.
+
+.. figure:: ../Images/UserManual/BackendView.png
+   :width: 500px
+   :alt: Backend view
+   
+This is backend view of TYPO3 after the user has clicked on module "|extension_name|".
+
+Here you have an overview of all sitemap entries.
+- You can select a page in the "page tree" to filter your selection.
+- You can delete all or a single entry.
+- You can change the priority for each entry.
+
+.. important::
+
+   Sitemap entries are written to the database only if a page is once requested in the frontend. If your website has a lot of pages and you don't want to open every single one, use a site crawler to crawl the complete site. The same applies if you deleted all sitemap entries. You can use a site crawler like www.xml-sitemaps.com.
+
+Accessing the Sitemap
+---------------------
+
+Since this Extension uses the eID mechanism it can be easily accessed by addig the parameter ``eID=dynamicgooglesitemap`` to your site URL. For example: ``http://www.mysite.com/?eID=dynamicgooglesitemap``.
\ No newline at end of file
diff --git a/Documentation/conf.py b/Documentation/conf.py
new file mode 100644 (file)
index 0000000..91f0e4e
--- /dev/null
@@ -0,0 +1,235 @@
+# -*- coding: utf-8 -*-
+#
+# dynamicgooglesitemap build configuration file, created by
+# ReST Editor on 21.05.2014
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.todo']
+
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = [u'_templates']
+
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+source_encoding = u'utf-8-sig'
+
+
+# The master toctree document.
+master_doc = u'Index'
+
+
+# General information about the project.
+project = u'dynamicgooglesitemap'
+
+copyright = u'2014, Javor Issapov'
+
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = u'0.1'
+
+# The full version, including alpha/beta/rc tags.
+release = u'0.1.1'
+
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+language = u'en'
+
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = []
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = u'default'
+
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = [u'_static']
+
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'dynamicgooglesitemap'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+latex_paper_size = u'a4'
+
+
+# The font size ('10pt', '11pt' or '12pt').
+latex_font_size = u'10pt'
+
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [('Index', 'dynamicgooglesitemap.tex', u'dynamicgooglesitemap Documentation', u'Javor Issapov', 'manual')]
+
+
+# A dictionary that contains LaTeX snippets that override those Sphinx usually 
+# puts into the generated .tex files.
+latex_elements = { 'babel': '\\usepackage[english]{babel}' }
+
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+latex_use_parts = False
+
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [('Index', 'dynamicgooglesitemap', u'dynamicgooglesitemap Documentation', [u'Javor Issapov'], 1)]
+
+
+# -- Additional options --------------------------------------------------------
+
+todo_include_todos = True
diff --git a/Resources/Private/.htaccess b/Resources/Private/.htaccess
new file mode 100644 (file)
index 0000000..dfc0272
--- /dev/null
@@ -0,0 +1 @@
+deny  from all
\ No newline at end of file
diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf
new file mode 100644 (file)
index 0000000..2110778
--- /dev/null
@@ -0,0 +1,66 @@
+<?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="2014-06-30T12:00:00Z" product-name="dynamicgooglesitemap">
+               <header/>
+               <body>
+
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap">
+                               <source>Sitemap</source>
+                               <target>Sitemap</target>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.for_page">
+                               <source>The corresponding page ID</source>
+                               <target>Die entsprechende Seite ID</target>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.url">
+                               <source>The URL.</source>
+                               <target>Seiten URL.</target>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.priority">
+                               <source>Priority of the url in context to the whole sitemap.</source>
+                               <target>Priorität der URL im Kontext zu der ganzen Sitemap.</target>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.lastmod">
+                               <source>Date when the content of the url was last changed.</source>
+                               <target>Datum wenn die Seite zu lätzt gehändert wurde.</target>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.lastmod_hash">
+                               <source>Hash for monitoring changes of the page</source>
+                               <target>Hash zur Überwachung von Änderungen auf der Seite</target>
+                       </trans-unit>
+                       
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.nopage">
+                               <source>Please click on a page in the tree.</source>
+                               <target>Bitte klicken Sie auf eine Seite im Seitenabum.</target>
+                       </trans-unit>
+                       
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.domain">
+                               <source>Showing Sitemap for Domain</source>
+                               <target>Zeige Sitemap für Domain</target>
+                       </trans-unit>
+                       
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.sitemap.update">
+                               <source>Sitemap Entry was updated.</source>
+                               <target>Sitemap eintrag wurde aktualisiert.</target>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.sitemap.remove">
+                               <source>Sitemap Entry was removed.</source>
+                               <target>Sitemap eintrag wurde entfernt.</target>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.sitemap.allremove">
+                               <source>All Sitemap Entrys ware removed.</source>
+                               <target>Alle Sitemap einträge wurden entfernt.</target>
+                       </trans-unit>
+                       
+                       <trans-unit id="config.ignorParams">
+                               <source>Ignor Parameters (Comma separated List)</source>
+                               <target>Ignoriere Parameter (Kommata getrennte Liste)</target>
+                       </trans-unit>
+                       <trans-unit id="config.sorting">
+                               <source>Sort Sitemap by Field</source>
+                               <target>Sortiere Sitemap by Feld</target>
+                       </trans-unit>
+                       
+               </body>
+       </file>
+</xliff>
\ No newline at end of file
diff --git a/Resources/Private/Language/de.locallang_csh_tx_dmgooglesitemap_domain_model_sitemap.xlf b/Resources/Private/Language/de.locallang_csh_tx_dmgooglesitemap_domain_model_sitemap.xlf
new file mode 100644 (file)
index 0000000..16b7799
--- /dev/null
@@ -0,0 +1,29 @@
+<?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="2014-06-30T12:00:00Z" product-name="dynamicgooglesitemap">
+               <header/>
+               <body>
+
+                       <trans-unit id="for_page.description">
+                               <source>The coresponding page ID</source>
+                               <target>Die entsprechende Seite ID</target>
+                       </trans-unit>
+                       <trans-unit id="url.description">
+                               <source>The URL.</source>
+                               <target>Seiten URL.</target>
+                       </trans-unit>
+                       <trans-unit id="priority.description">
+                               <source>Priority of the url in context to the whole sitemap.</source>
+                               <target>Priorität der URL im Kontext zu der ganzen Sitemap.</target>
+                       </trans-unit>
+                       <trans-unit id="lastmod.description">
+                               <source>Date when the content of the url was last changed.</source>
+                               <target>Datum wenn die Seite zu lätzt gehändert wurde.</target>
+                       </trans-unit>
+                       <trans-unit id="lastmod_hash.description">
+                               <source>Hash for monitoring changes of the page</source>
+                               <target>Hash zur Überwachung von Änderungen auf der Seite</target>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>
\ No newline at end of file
diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf
new file mode 100644 (file)
index 0000000..94c77a3
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<xliff version="1.0">
+       <file source-language="en" datatype="plaintext" original="messages" date="2014-02-13T11:46:43Z" product-name="dynamicgooglesitemap">
+               <header/>
+               <body>
+
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap">
+                               <source>Sitemap</source>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.for_page">
+                               <source>The coresponding page ID</source>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.url">
+                               <source>The URL.</source>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.priority">
+                               <source>Priority of the url in context to the whole  sitemap.</source>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.lastmod">
+                               <source>Date when the content of the url was last changed.</source>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.lastmod_hash">
+                               <source>Hash for monitoring changes of the page</source>
+                       </trans-unit>
+                       
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.nopage">
+                               <source>Please click on a page in the tree</source>
+                       </trans-unit>
+                       
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.domain">
+                               <source>Showing Sitemap for Domain</source>
+                       </trans-unit>
+                       
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.sitemap.update">
+                               <source>Sitemap Entry was updated.</source>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.sitemap.remove">
+                               <source>Sitemap Entry was removed.</source>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.sitemap.allremove">
+                               <source>All Sitemap Entrys ware removed.</source>
+                       </trans-unit>
+                       
+                       <trans-unit id="config.ignoreParams">
+                               <source>Ignore Parameters (Comma seperated List)</source>
+                       </trans-unit>
+                       <trans-unit id="config.sorting">
+                               <source>Sort Sitemap by Field</source>
+                       </trans-unit>
+                       
+               </body>
+       </file>
+</xliff>
\ No newline at end of file
diff --git a/Resources/Private/Language/locallang_csh_tx_dmgooglesitemap_domain_model_sitemap.xlf b/Resources/Private/Language/locallang_csh_tx_dmgooglesitemap_domain_model_sitemap.xlf
new file mode 100644 (file)
index 0000000..62aa5ab
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<xliff version="1.0">
+       <file source-language="en" datatype="plaintext" original="messages" date="2014-02-13T11:46:43Z" product-name="dynamicgooglesitemap">
+               <header/>
+               <body>
+
+                       <trans-unit id="for_page.description">
+                               <source>The coresponding page ID</source>
+                       </trans-unit>
+                       <trans-unit id="url.description">
+                               <source>The URL.</source>
+                       </trans-unit>
+                       <trans-unit id="priority.description">
+                               <source>Priority of the url in context to the whole  sitemap.</source>
+                       </trans-unit>
+                       <trans-unit id="lastmod.description">
+                               <source>Date when the content of the url was last changed.</source>
+                       </trans-unit>
+                       <trans-unit id="lastmod_hash.description">
+                               <source>Hash for monitoring changes of the page</source>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>
\ No newline at end of file
diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf
new file mode 100644 (file)
index 0000000..2ac5541
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<xliff version="1.0">
+       <file source-language="en" datatype="plaintext" original="messages" date="2014-02-13T11:46:43Z" product-name="dynamicgooglesitemap">
+               <header/>
+               <body>
+
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap">
+                               <source>Sitemap</source>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.for_page">
+                               <source>For Page</source>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.url">
+                               <source>Url</source>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.priority">
+                               <source>Priority</source>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.lastmod">
+                               <source>Lastmod</source>
+                       </trans-unit>
+                       <trans-unit id="tx_dynamicgooglesitemap_domain_model_sitemap.lastmod_hash">
+                               <source>Lastmod Hash</source>
+                       </trans-unit>
+
+               </body>
+       </file>
+</xliff>
\ No newline at end of file
diff --git a/Resources/Private/Language/locallang_pagelist.xlf b/Resources/Private/Language/locallang_pagelist.xlf
new file mode 100644 (file)
index 0000000..f037cdf
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<xliff version="1.0">
+       <file source-language="en" datatype="plaintext" original="messages" date="2014-02-13T11:46:43Z" product-name="dynamicgooglesitemap">
+               <header/>
+               <body>
+                       
+            <trans-unit id="mlang_tabs_tab">
+                               <source>Google Sitemap</source>
+                       </trans-unit>
+                       <trans-unit id="mlang_labels_tabdescr">
+                               <source></source>
+                       </trans-unit>
+                       <trans-unit id="mlang_labels_tablabel">
+                               <source></source>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>
\ No newline at end of file
diff --git a/Resources/Private/Layouts/Default.html b/Resources/Private/Layouts/Default.html
new file mode 100644 (file)
index 0000000..358d75c
--- /dev/null
@@ -0,0 +1,34 @@
+<f:be.container>
+       <div class="typo3-fullDoc">
+               <div id="typo3-docheader">
+                       <div id="typo3-docheader-row1">
+                               <div class="buttonsleft">
+
+                               </div>
+                               <div class="buttonsright">
+                                       <f:be.buttons.shortcut />
+                               </div>
+                       </div>
+                       <div id="typo3-docheader-row2">
+                               <div class="docheader-row2-left">
+                                       <f:be.buttons.csh />
+                                       <f:be.menus.actionMenu>
+                                               <f:be.menus.actionMenuItem label="Overview" controller="" action="list" />
+                                               
+                                       </f:be.menus.actionMenu>
+                               </div>
+                               <div class="docheader-row2-right">
+                                       <f:be.pagePath />
+                                       <f:be.pageInfo />
+                               </div>
+                       </div>
+
+               </div>
+               <div id="typo3-docbody">
+                       <div id="typo3-inner-docbody">
+                               <f:flashMessages renderMode="div" />
+                               <f:render section="content" />
+                       </div>
+               </div>
+       </div>
+</f:be.container>
\ No newline at end of file
diff --git a/Resources/Private/Partials/FormErrors.html b/Resources/Private/Partials/FormErrors.html
new file mode 100644 (file)
index 0000000..d1264a6
--- /dev/null
@@ -0,0 +1,12 @@
+<f:form.validationResults for="{object}">
+       <f:if condition="{validationResults.flattenedErrors}">
+               <ul>
+               <f:for each="{validationResults.flattenedErrors}" key="propertyPath" as="errors">
+                       <li>
+                       {propertyPath}: <ul>
+                               <f:for each="{errors}" as="error"><li>{error}</li></f:for>
+                               </ul>
+                       </li>
+               </f:for></ul>
+</f:if>
+</f:form.validationResults>
\ No newline at end of file
diff --git a/Resources/Private/Partials/Sitemap/FormFields.html b/Resources/Private/Partials/Sitemap/FormFields.html
new file mode 100644 (file)
index 0000000..3815a04
--- /dev/null
@@ -0,0 +1,20 @@
+<label for="forPage">
+       <f:translate key="tx_dynamicgooglesitemap_domain_model_sitemap.for_page" />
+</label><br />
+       <f:form.textfield property="forPage" /><br />
+<label for="url">
+       <f:translate key="tx_dynamicgooglesitemap_domain_model_sitemap.url" /> <span class="required">(required)</span>
+</label><br />
+       <f:form.textfield property="url" /><br />
+<label for="priority">
+       <f:translate key="tx_dynamicgooglesitemap_domain_model_sitemap.priority" />
+</label><br />
+       <f:form.textfield property="priority" /><br />
+<label for="lastmod">
+       <f:translate key="tx_dynamicgooglesitemap_domain_model_sitemap.lastmod" />
+</label><br />
+       <f:form.textfield property="lastmod"  value="{sitemap.lastmod->f:format.date()}" /><br />
+<label for="lastmodHash">
+       <f:translate key="tx_dynamicgooglesitemap_domain_model_sitemap.lastmod_hash" />
+</label><br />
+       <f:form.textfield property="lastmodHash" /><br />
\ No newline at end of file
diff --git a/Resources/Private/Partials/Sitemap/page.html b/Resources/Private/Partials/Sitemap/page.html
new file mode 100644 (file)
index 0000000..8064239
--- /dev/null
@@ -0,0 +1,66 @@
+<tr class="item">
+       <td class="title">
+               <f:for each="{item.level}" as="level">
+                       <img src="./clear.gif" width="18" height="16" alt="">
+               </f:for>
+               <span title="{item.page.title}" class="t3-icon t3-icon-apps t3-icon-apps-pagetree c-recIcon {item.page.pageCssClass}">
+                       <f:if condition="{item.page.hidden}">
+                               <f:then><span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay">&nbsp;</span></f:then>
+                               <f:else>
+                                       <f:if condition="{item.page.feGroup} != 0">
+                                               <f:then>
+                                                       <span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-access-restricted t3-icon-overlay">&nbsp;</span>
+                                               </f:then>
+                                               <f:else>&nbsp;</f:else>
+                                       </f:if>
+                               </f:else>
+                       </f:if>
+               </span>
+               <span class="value">
+                       {item.page.title}
+               </span>
+       </td>
+       <td class="uid">
+               {item.page.uid}
+       </td>
+       <f:if condition="{item.sitemaps}">
+               <f:for each="{item.sitemaps}" as="sitemap" iteration="i">
+                       <f:if condition="{i.isFirst}">
+                               <f:then></f:then>
+                               <f:else><tr><td colspan="2"><!--  --></td></f:else>
+                       </f:if>
+                       
+                               <td class="lang">
+                                       <f:if condition="{sitemap.sysLanguageUid}">
+                                               <span title="{sitemap.sysLanguageFlag}" class="t3-icon t3-icon-flags t3-icon-flags-{sitemap.sysLanguageFlag} t3-icon-{sitemap.sysLanguageFlag}">&nbsp;</span>
+                                       </f:if>
+                               </td>
+                               <td class="delete">
+                                       <f:link.action action="delete" arguments="{sitemap : sitemap}">
+                                               <img src="./sysext/t3skin/icons/gfx/garbage.gif" width="16" height="16" title="Delete Sitemap Entry" alt="">
+                                       </f:link.action>
+                               </td>
+                               <td class="params" title="{sitemap.urlParams}">
+                                       {sitemap.urlParamsTrimed}
+                               </td>
+                               <td class="url" title="{sitemap.requestUri}">
+                                       {sitemap.requestUriTrimed}
+                               </td>
+                               <td class="priority">
+                                       <f:form action="update" name="sitemap" enctype="post" object="{sitemap}" >
+                                               <f:form.select property="priority"  options="{1:'1', 2:'2', 3:'3', 4:'4', 5:'5', 6:'6', 7:'7', 8:'8', 9:'9', 10:'10' }" value="{sitemap.priority}" />
+                                       </f:form>
+                               </td>
+                               <td class="lastchange" title="{sitemap.lastmod -> f:format.date(format: 'd.m.Y - H:i:s')}">
+                                       <f:format.date format="d.m.Y">{sitemap.lastmod}</f:format.date>
+                               </td>
+                       </tr>
+               </f:for>
+       </f:if>
+</tr>
+
+<f:if condition="{item.subpages}">
+       <f:for each="{item.subpages}" as="page" iteration="i">
+               <f:render partial="Sitemap/page" arguments="{item: page}" />
+       </f:for>
+</f:if>
\ No newline at end of file
diff --git a/Resources/Private/Templates/Sitemap/Edit.html b/Resources/Private/Templates/Sitemap/Edit.html
new file mode 100644 (file)
index 0000000..f5004d9
--- /dev/null
@@ -0,0 +1,25 @@
+<f:layout name="Default" />
+
+This template displays a EDIT form for the current domain object.
+
+If you modify this template, do not forget to change the overwrite settings
+in /Configuration/ExtensionBuilder/settings.yaml:
+  Resources:
+    Private:
+      Templates:
+        Edit.html: keep
+
+Otherwise your changes will be overwritten the next time you save the extension in the extension builder
+
+<f:section name="content">
+<h1>Edit Sitemap</h1>
+
+<f:flashMessages />
+
+<f:render partial="FormErrors" />
+
+<f:form action="update" name="sitemap" object="{sitemap}" >
+       <f:render partial="Sitemap/FormFields" arguments="{sitemap:sitemap}" />
+       <f:form.submit value="Save" />
+</f:form>
+</f:section>
\ No newline at end of file
diff --git a/Resources/Private/Templates/Sitemap/List.html b/Resources/Private/Templates/Sitemap/List.html
new file mode 100644 (file)
index 0000000..4b7cf77
--- /dev/null
@@ -0,0 +1,56 @@
+<f:layout name="Default" />
+
+This Template is responsible for creating a table of domain objects.
+
+If you modify this template, do not forget to change the overwrite settings
+in /Configuration/ExtensionBuilder/settings.yaml:
+  Resources:
+    Private:
+      Templates:
+        List.html: keep
+
+Otherwise your changes will be overwritten the next time you save the extension in the extension builder
+
+<f:section name="content">
+
+<f:flashMessages />
+<f:if condition="{nopid}">
+       <f:then>
+               {nopid_msg}
+       </f:then>
+       <f:else>
+               <script type="text/javascript">
+                       window.onload = function () {
+                               var selects = document.getElementsByTagName("select");
+                               for(var i = 0; i < selects.length; i++) {
+                                       selects[i].onchange = function(){
+                                               this.form.submit();
+                                       }
+                               }
+                       }
+               </script>
+               <f:form action="list" name="list" enctype="post" >
+                       <f:translate key="tx_dynamicgooglesitemap_domain_model_sitemap.domain" htmlEscape="false" />
+                       <f:form.select name="domain" options="{domains}" value="{domain}"/><br/><br/>
+               </f:form>
+               <table>
+                       <tr>
+                               <th>Titel</th>
+                               <th>UID</th>
+                               <th>Lang</th>
+                               <th>
+                                       <f:link.action action="deleteAll">
+                                               <img src="./sysext/t3skin/icons/gfx/garbage.gif" width="16" height="16" title="Delete Sitemap Entry" alt="">
+                                       </f:link.action>
+                                       Delete All
+                               </th>
+                               <th>URL Parameters</th>
+                               <th>URL</th>
+                               <th>Priority</th>
+                               <th>Last Changed</th>
+                       </tr>
+                       <f:render partial="Sitemap/page" arguments="{item: item}" />
+               </table>
+       </f:else>
+</f:if>
+</f:section>
\ No newline at end of file
diff --git a/Resources/Public/Icons/relation.gif b/Resources/Public/Icons/relation.gif
new file mode 100644 (file)
index 0000000..db61d7e
Binary files /dev/null and b/Resources/Public/Icons/relation.gif differ
diff --git a/Resources/Public/Icons/tx_dmgooglesitemap_domain_model_sitemap.gif b/Resources/Public/Icons/tx_dmgooglesitemap_domain_model_sitemap.gif
new file mode 100644 (file)
index 0000000..37ba37b
Binary files /dev/null and b/Resources/Public/Icons/tx_dmgooglesitemap_domain_model_sitemap.gif differ
diff --git a/ext_conf_template.txt b/ext_conf_template.txt
new file mode 100644 (file)
index 0000000..0a14502
--- /dev/null
@@ -0,0 +1,5 @@
+  # cat=Basic//10; type=input; label=LLL:EXT:dynamicgooglesitemap/Resources/Private/Language/locallang.xlf:config.ignoreParams
+ignoreParams = cHash
+
+  # cat=Basic//20; type=options[UID,PageTitle,URL,LastChanged]; label=LLL:EXT:dynamicgooglesitemap/Resources/Private/Language/locallang.xlf:config.sorting
+sorting = uid
\ No newline at end of file
diff --git a/ext_emconf.php b/ext_emconf.php
new file mode 100644 (file)
index 0000000..e20e565
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+
+/***************************************************************
+ * Extension Manager/Repository config file for ext: "dynamicgooglesitemap"
+ *
+ * Auto generated by Extension Builder 2014-02-13
+ *
+ * Manual updates:
+ * Only the data in the array - anything else is removed by next write.
+ * "version" and "dependencies" must not be touched!
+ ***************************************************************/
+
+$EM_CONF[$_EXTKEY] = array(
+       'title' => 'Dynamic Google Sitemap',
+       'description' => 'Google Sitemap generator for dynamic pages',
+       'category' => 'module',
+       'author' => 'Javor Issapov',
+       'author_email' => 'javor.issapov@diemedialen.de',
+       'author_company' => 'Die Medialen GmbH',
+       'shy' => '',
+       'priority' => '',
+       'module' => '',
+       'state' => 'beta',
+       'internal' => '',
+       'uploadfolder' => '0',
+       'createDirs' => '',
+       'modify_tables' => '',
+       'clearCacheOnLoad' => 0,
+       'lockType' => '',
+       'version' => '0.9.0',
+       'constraints' => array(
+               'depends' => array(
+                       'extbase' => '6.0',
+                       'fluid' => '6.0',
+                       'typo3' => '6.0.0-6.2.99',
+               ),
+               'conflicts' => array(
+               ),
+               'suggests' => array(
+               ),
+       ),
+);
+
+?>
\ No newline at end of file
diff --git a/ext_icon.gif b/ext_icon.gif
new file mode 100644 (file)
index 0000000..59476a5
Binary files /dev/null and b/ext_icon.gif differ
diff --git a/ext_localconf.php b/ext_localconf.php
new file mode 100644 (file)
index 0000000..95cc8e8
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+if (!defined ('TYPO3_MODE')) {
+       die ('Access denied.');
+}
+
+$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['dynamicgooglesitemap'] = 'EXT:dynamicgooglesitemap/Classes/Utility/SitemapRenderer.php';
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postProcess']['get_page_data'] = 'EXT:dynamicgooglesitemap/Classes/Utility/PageData.php:DieMedialen\\Dynamicgooglesitemap\\Utility\\PageData->getData';
+
+?>
\ No newline at end of file
diff --git a/ext_tables.php b/ext_tables.php
new file mode 100644 (file)
index 0000000..0e04e15
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+if (!defined('TYPO3_MODE')) {
+       die ('Access denied.');
+}
+
+if (TYPO3_MODE === 'BE') {
+
+       /**
+        * Registers a Backend Module
+        */
+       \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
+               'DieMedialen.' . $_EXTKEY,
+               'web',   // Make module a submodule of 'web'
+               'pagelist',     // Submodule key
+               '',                                             // Position
+               array(
+                       'Sitemap' => 'list, edit, update, delete, deleteAll',
+               ),
+               array(
+                       'access' => 'user,group',
+                       'icon'   => 'EXT:' . $_EXTKEY . '/ext_icon.gif',
+                       'labels' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_pagelist.xlf',
+               )
+       );
+
+}
+
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'Google Sitemap');
+
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_dynamicgooglesitemap_domain_model_sitemap', 'EXT:dynamicgooglesitemap/Resources/Private/Language/locallang_csh_tx_dynamicgooglesitemap_domain_model_sitemap.xlf');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_dynamicgooglesitemap_domain_model_sitemap');
+$TCA['tx_dynamicgooglesitemap_domain_model_sitemap'] = array(
+       'ctrl' => array(
+               'title' => 'LLL:EXT:dynamicgooglesitemap/Resources/Private/Language/locallang_db.xlf:tx_dynamicgooglesitemap_domain_model_sitemap',
+               'label' => 'for_page',
+               'crdate' => 'crdate',
+               'cruser_id' => 'cruser_id',
+               'dividers2tabs' => TRUE,
+
+               'versioningWS' => 2,
+               'versioning_followPages' => TRUE,
+               'origUid' => 't3_origuid',
+               'languageField' => 'sys_language_uid',
+               'transOrigPointerField' => 'l10n_parent',
+               'transOrigDiffSourceField' => 'l10n_diffsource',
+               'searchFields' => 'for_page,url,priority,lastmod,lastmod_hash,',
+               'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/Sitemap.php',
+               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/tx_dynamicgooglesitemap_domain_model_sitemap.gif'
+       ),
+);
+
+?>
\ No newline at end of file
diff --git a/ext_tables.sql b/ext_tables.sql
new file mode 100644 (file)
index 0000000..3c71ebc
--- /dev/null
@@ -0,0 +1,28 @@
+#
+# Table structure for table 'tx_dynamicgooglesitemap_domain_model_sitemap'
+#
+CREATE TABLE tx_dynamicgooglesitemap_domain_model_sitemap (
+
+       uid int(11) NOT NULL auto_increment,
+       pid int(11) DEFAULT '0' NOT NULL,
+
+       for_page int(11) DEFAULT '0' NOT NULL,
+       url_params varchar(255) DEFAULT '' NOT NULL,
+       http_host  varchar(255) DEFAULT '' NOT NULL,
+       request_uri varchar(255) DEFAULT '' NOT NULL,
+       content_hash varchar(32) DEFAULT '' NOT NULL,
+       priority int(11) DEFAULT '5' NOT NULL,
+       lastmod int(11) DEFAULT '0' NOT NULL,
+       lang_key varchar(10) DEFAULT '' NOT NULL,
+
+       t3_origuid int(11) DEFAULT '0' NOT NULL,
+       sys_language_uid int(11) DEFAULT '0' NOT NULL,
+       l10n_parent int(11) DEFAULT '0' NOT NULL,
+       l10n_diffsource mediumblob,
+
+       PRIMARY KEY (uid),
+       KEY for_page (for_page,url_params),
+       KEY parent (pid),
+       KEY language (l10n_parent,sys_language_uid)
+
+);
\ No newline at end of file
diff --git a/ext_typoscript_setup.txt b/ext_typoscript_setup.txt
new file mode 100644 (file)
index 0000000..5269a71
--- /dev/null
@@ -0,0 +1,33 @@
+plugin.tx_dynamicgooglesitemap {
+    persistence {
+        classes {
+            DieMedialen\Dynamicgooglesitemap\Domain\Model\Pages {
+                mapping {
+                    tableName = pages
+                 }
+           }
+        }
+    }
+}
+
+module.tx_dynamicgooglesitemap < plugin.tx_dynamicgooglesitemap
+
+config.tx_extbase {
+        persistence{
+               enableAutomaticCacheClearing = 1
+               updateReferenceIndex = 0
+               classes {
+                       DieMedialen\Dynamicgooglesitemap\Domain\Model\Pages {
+                               mapping {
+                                       tableName = pages
+                                       columns {
+                                               uid.mapOnProperty = uid
+                                               pid.mapOnProperty = pid
+                                               sorting.mapOnProperty = sorting
+                                               title.mapOnProperty = title
+                                       }
+                               }
+                       }
+               }
+       }
+}
\ No newline at end of file