[BUGFIX] Various small bug fixes and styling changes
authorPatrick Schriner <patrick.schriner@diemedialen.de>
Tue, 29 Dec 2015 13:54:21 +0000 (14:54 +0100)
committerPatrick Schriner <patrick.schriner@diemedialen.de>
Tue, 29 Dec 2015 13:56:55 +0000 (14:56 +0100)
Up the requirements to 6.2. Won't be tested on TYPO3 < 6.2

Releases: master
Resolves: #00000

Change-Id: Ic346f89b4003c8887040a1a4b41990b5c47d0ed1

Classes/Utility/PageData.php
Resources/Private/Layouts/Default.html
Resources/Private/Partials/Sitemap/page.html
Resources/Private/Templates/Sitemap/List.html
ext_conf_template.txt
ext_emconf.php

index 09f1e6d..b9d955f 100644 (file)
@@ -2,63 +2,63 @@
 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();
-               
+
                // Exit early if page is viewed in preview mode from TYPO3
                if($GLOBALS['TSFE']->fePreview || isset($gpVars['ADMCMD_view']) && isset($gpVars['ADMCMD_editIcons'])) { return; }
-               
+
                // Exit early if page type is exluded from sitemap.
                $confArray = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dynamicgooglesitemap']);
                $ignoreTypes = explode(',', $confArray['ignorePageType']);
                if(isset($GLOBALS['TSFE']->type) && in_array($GLOBALS['TSFE']->type, $ignoreTypes)) { return; }
-               
+               if(isset($gpVars['M']) && $gpVars['M'] !== '') { return; } // Module links
+
                $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['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 = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('HTTP_HOST');
                $requestUri = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI');
                $https = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SSL');
-               
+
                $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 . '\' ');
@@ -85,23 +85,22 @@ class PageData {
                        );
                        $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. 
+        *
+        * 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';
-               
+               $ignoreParams = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $confArray['ignoreParams'], TRUE);
+
                ksort($params);
                $str = "";
                foreach ($params as $key => $value) {
@@ -118,6 +117,6 @@ class PageData {
                }
                return urldecode($str);
        }
-       
+
 }
 ?>
\ No newline at end of file
index 358d75c..7e6cb58 100644 (file)
                        <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 />
index 855521b..07d2e56 100644 (file)
@@ -24,6 +24,7 @@
                {item.page.uid}
        </td>
        <f:if condition="{item.sitemaps}">
+               <f:then>
                <f:for each="{item.sitemaps}" as="sitemap" iteration="i">
                        <f:if condition="{i.isFirst}">
                                <f:then></f:then>
                                </td>
                        </tr>
                </f:for>
+               </f:then>
+               <f:else>
+                       <td colspan="6"><!-- spacer --></td>
+               </f:else>
        </f:if>
 </tr>
 
index eb6baff..a515342 100644 (file)
@@ -38,21 +38,20 @@ Otherwise your changes will be overwritten the next time you save the extension
                        <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="">
+               <table class="typo3-dblist">
+                       <tr class="t3-row-header">
+                               <td>Titel</td>
+                               <td>UID</th>
+                               <td>Lang</td>
+                               <td>
+                                       <f:link.action action="deleteAll" title="Delete all">
+                                               <img src="./sysext/t3skin/icons/gfx/garbage.gif" width="16" height="16" title="Delete all" alt="">
                                        </f:link.action>
-                                       Delete All
-                               </th>
-                               <th>URL Parameters</th>
-                               <th>URL</th>
-                               <th>Priority</th>
-                               <th>Last Changed</th>
+                               </td>
+                               <td>URL Parameters</td>
+                               <td>URL</td>
+                               <td>Priority</td>
+                               <td>Last Changed</td>
                        </tr>
                        <f:render partial="Sitemap/page" arguments="{item: item}" />
                </table>
index ec4f413..f8b0ac5 100644 (file)
@@ -1,5 +1,5 @@
   # cat=Basic//10; type=input; label=LLL:EXT:dynamicgooglesitemap/Resources/Private/Language/locallang.xlf:config.ignoreParams
-ignoreParams = cHash
+ignoreParams = L, cHash
 
   # cat=Basic//10; type=input; label=LLL:EXT:dynamicgooglesitemap/Resources/Private/Language/locallang.xlf:config.ignorePageType
 ignorePageType = 98
index 27ad5dd..b6c1c1c 100644 (file)
@@ -27,12 +27,10 @@ $EM_CONF[$_EXTKEY] = array(
        'modify_tables' => '',
        'clearCacheOnLoad' => 0,
        'lockType' => '',
-       'version' => '0.9.2',
+       'version' => '0.9.3',
        'constraints' => array(
                'depends' => array(
-                       'extbase' => '6.0',
-                       'fluid' => '6.0',
-                       'typo3' => '6.0.0-6.2.99',
+                       'typo3' => '6.2.0-6.2.99',
                ),
                'conflicts' => array(
                ),