[TASK] Merge changes in linkvalidator subproject
authorPhilipp Gampe <dev@philippgampe.info>
Sun, 22 May 2011 18:51:30 +0000 (20:51 +0200)
committerErnesto Baschny <ernst@cron-it.de>
Tue, 24 May 2011 10:00:37 +0000 (12:00 +0200)
The following issues were fixed:
* Task: Fix whitespace issues in all branches
* Task: Update Version Number to 1.0.3
* Feature #13800: Add user-agent header
* Fixed Bug #13680: Refactor external link, do not follow senseless loop, add user agent (thanks to Daniel Minder)
* Fixed bug #13953: Third-party classes cannot be checked due to dynamicConfigFile in TCA (thanks to Jan Philipp Timme)
* Fixed bug #13757: Scheduler task does not work at all (Michael Miousse)
* Fixed bug #13828: checkhidden has no effect for some configurations (Michael Miousse)
* Fixed bug #26731: The info module does not show up in IE 7 and 8 (Michael Miousse)
* Fixed bug #13368: Content of Tab is not scrollable (Michael Miousse)

Change-Id: I1074d4df19943cd2f0be5e734729830fbf2fa949
Resolves: #26884
Releases: 4.5
Reviewed-on: http://review.typo3.org/2288
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Oliver Hader
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny
typo3/sysext/linkvalidator/ChangeLog
typo3/sysext/linkvalidator/classes/class.tx_linkvalidator_processor.php
typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_external.php
typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_file.php
typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validator.php
typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validatoradditionalfieldprovider.php
typo3/sysext/linkvalidator/ext_emconf.php
typo3/sysext/linkvalidator/modfuncreport/class.tx_linkvalidator_modfuncreport.php

index 50f0d84..30dfd8c 100644 (file)
@@ -1,3 +1,23 @@
+2011-05-22  Philipp Gampe  <forge.typo3.org@philippgampe.info>
+
+       * Task: Fix whitespace issues in all branches
+       * Task: Update Version Number to 1.0.3
+       * Cleaned emconf for the release of TYPO3 4.5.3
+       * Release linkvalidator 1.0.3
+
+2011-05-21  Philipp Gampe  <forge.typo3.org@philippgampe.info>
+
+       * Feature #13800: Add user-agent header
+       * Fixed Bug #13680: Refactor external link, do not follow senseless     loop, add user agent (thanks to Daniel Minder)
+
+2011-05-18  Philipp Gampe  <forge.typo3.org@philippgampe.info>
+
+       * Fixed bug #13953: Third-party classes cannot be checked due to dynamicConfigFile in TCA (thanks to Jan Philipp Timme)
+       * Fixed bug #13757: Scheduler task does not work at all (Michael Miousse)
+       * Fixed bug #13828: checkhidden has no effect for some configurations (Michael Miousse)
+       * Fixed bug #26731: The info module does not show up in IE 7 and 8 (Michael Miousse)
+       * Fixed bug #13368: Content of Tab is not scrollable (Michael Miousse)
+
 2011-02-24  Christopher Stelmaszyk  <chrissitopher@gmx.de>
 
        * Cleaned emconf for the release of TYPO3 4.5.2
@@ -11,7 +31,7 @@
 
        * Fixed bug #13318: Regression in linkvalidator
 
-2011-02-22  Michael Miousse <michael.miousse@infoglobe.ca>
+2011-02-22  Michael Miousse  <michael.miousse@infoglobe.ca>
 
        * Fixed bug #12649: Split up analyzeRecord()
        * Cleaned emconf for the release of TYPO3 4.5.1
        * Fixed bug #12008: Row "Title" should be called "Headline"
        * Fixed bug #12009: Display a nice text, if an element does not have a headline
 
-2011-01-07  Pierre Boivin <pierre.boivin@infoglobe.ca>
+2011-01-07  Pierre Boivin  <pierre.boivin@infoglobe.ca>
 
        * Followup to bug #11794: If website root is active, searching for links does not work
 
        * Fixed bug #11888: Button "Check Links" only checks those categories of links which are marked with the checkboxes below
        * Fixed bug #11269: Proofread the manual
 
-2011-01-05  Pierre Boivin <pierre.boivin@infoglobe.ca>
+2011-01-05  Pierre Boivin  <pierre.boivin@infoglobe.ca>
 
        * Fixed bug #11794: If website root is active, searching for links does not work
 
        * Fixed bug #11775: Table should use new design for TYPO3 4.5
        * Fixed bug #11796: Improve usage of $GLOBALS['LANG']
 
-2010-12-28  Pierre Boivin <pierre.boivin@infoglobe.ca>
+2010-12-28  Pierre Boivin  <pierre.boivin@infoglobe.ca>
 
        * Fixed bug #11715: Use localized format for date and time
 
-2010-12-06  Pierre Boivin <pierre.boivin@infoglobe.ca>
+2010-12-06  Pierre Boivin  <pierre.boivin@infoglobe.ca>
 
        * Fixed bug #11277: Initialize and other methods in modfunc1 could be protected
        * Fixed bug #11278: Create an interface for the linktype classes
        * Fixed bug #11275: Remove clear.gif in modfunc1
        * Fixed bug #10987: linkvalidator doesn't detect hidden pages (Thanks to Joh. Feustel)
 
-2010-12-03  Pierre Boivin <pierre.boivin@infoglobe.ca>
+2010-12-03  Pierre Boivin  <pierre.boivin@infoglobe.ca>
 
        * Fixed bug #11271: Lowercase all filenames
        * Fixed bug #11280: Refactor class tx_linkvalidator_processing
index f8eeb4d..a9ebf05 100644 (file)
@@ -106,6 +106,10 @@ class tx_linkvalidator_Processor {
        public function init($searchField, $pid) {
                $this->searchFields = $searchField;
                $this->pidList = $pid;
+
+               foreach ($searchField as $tableName => $table) {
+                       t3lib_div::loadTCA($tableName);
+               }
        }
 
        /**
@@ -386,7 +390,7 @@ class tx_linkvalidator_Processor {
         * @param       string          Perms clause
         * @return      string          Returns the list with a comma in the end (if any pages selected!)
         */
-       public function extGetTreeList($id, $depth, $begin = 0, $permsClause) {
+       public function extGetTreeList($id, $depth, $begin = 0, $permsClause,  $considerHidden = FALSE) {
                $depth = intval($depth);
                $begin = intval($begin);
                $id = intval($id);
@@ -394,23 +398,47 @@ class tx_linkvalidator_Processor {
 
                if ($depth > 0) {
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                               'uid,title',
+                               'uid,title,hidden,extendToSubpages',
                                'pages',
                                'pid=' . $id . ' AND deleted=0 AND ' . $permsClause
                        );
+
                        while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                               if ($begin <= 0) {
+                               if ($begin <= 0 && ($row['hidden']==0 || $considerHidden == 1)) {
                                        $theList .= $row['uid'] . ',';
                                        $this->extPageInTreeInfo[] = array($row['uid'], htmlspecialchars($row['title'], $depth));
                                }
-                               if ($depth > 1) {
-                                       $theList .= $this->extGetTreeList($row['uid'], $depth - 1, $begin - 1, $permsClause);
+                               if ($depth > 1 && (!($row['hidden']==1 && $row['extendToSubpages']==1) || $considerHidden == 1)) {
+                                       $theList .= $this->extGetTreeList($row['uid'], $depth - 1, $begin - 1, $permsClause, $considerHidden);
                                }
                        }
                }
                return $theList;
        }
 
+       public function getRootLineIsHidden($pageInfo){
+               $hidden = FALSE;
+               if ($pageInfo['extendToSubpages'] == 1 && $pageInfo['hidden'] == 1){
+                       $hidden = TRUE;
+               } else {
+                       if ($pageInfo['pid'] > 0) {
+                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                                       'uid,title,hidden,extendToSubpages',
+                                       'pages',
+                                       'uid=' . $pageInfo['pid']
+                               );
+
+                               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                                       $hidden = $this->getRootLineIsHidden($row);
+                               }
+                       }
+                       else {
+                               $hidden = FALSE;
+                       }
+               }
+               return $hidden;
+
+       }
 
 }
 
index c16c844..acd22dd 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
  *  Copyright notice
  *
- *  (c) 2010 - 2009 Jochen Rieger (j.rieger@connecta.ag) 
+ *  (c) 2010 - 2009 Jochen Rieger (j.rieger@connecta.ag)
  *  (c) 2010 - 2011 Michael Miousse (michael.miousse@infoglobe.ca)
  *  All rights reserved
  *
@@ -47,6 +47,14 @@ class tx_linkvalidator_linktype_External extends tx_linkvalidator_linktype_Abstr
        protected $urlErrorParams = array();
 
        /**
+        * List of headers to be used for metching an URL for the current processing
+        *
+        * @var array
+        */
+       protected $additionalHeaders = array();
+
+
+       /**
         * Checks a given URL + /path/filename.ext for validity
         *
         * @param       string          $url: url to check
@@ -56,6 +64,9 @@ class tx_linkvalidator_linktype_External extends tx_linkvalidator_linktype_Abstr
         */
        public function checkLink($url, $softRefEntry, $reference) {
                $errorParams = array();
+               $report = array();
+               $additionalHeaders['User-Agent'] = 'User-Agent: Mozilla/5.0 TYPO3-linkvalidator';
+
                if (isset($this->urlReports[$url])) {
                        if(!$this->urlReports[$url]) {
                                if(is_array($this->urlErrorParams[$url])) {
@@ -70,24 +81,49 @@ class tx_linkvalidator_linktype_External extends tx_linkvalidator_linktype_Abstr
                        $url = substr($url, 0, strrpos($url, '#'));
                }
 
-                       // try to fetch the content of the URL (headers only)
-               $report = array();
-
-                       // try fetching the content of the URL (just fetching the headers does not work correctly)
-               $content = '';
-               $content = t3lib_div::getURL($url, 1, FALSE, $report);
+                       // try to fetch the content of the URL
+               $content = t3lib_div::getURL($url, 1, $additionalHeaders, $report);
 
                $tries = 0;
+               $lastUrl = $url;
                while (($report['http_code'] == 301 || $report['http_code'] == 302
-                       || $report['http_code'] == 303 || $report['http_code'] == 307)
-                       && ($tries < 5)) {
-                               $isCodeRedirect = preg_match('/Location: (.*)/', $content, $location);
-                               if (isset($location[1])) {
-                                       $content = t3lib_div::getURL($location[1], 2, FALSE, $report);
+                               || $report['http_code'] == 303 || $report['http_code'] == 307)
+                          && ($tries < 5)) {
+
+                               // split header into lines and find Location:
+                       $responseHeaders = t3lib_div::trimExplode(chr(10), $content, TRUE);
+                       foreach ($responseHeaders as $line) {
+                                       // construct new URL
+                               if ((preg_match('/Location: ([^\r\n]+)/', $line, $location))) {
+                                       if (isset($location[1])) {
+                                               $parsedUrl = parse_url($location[1]);
+                                               if (!isset($parsedUrl['host'])) {
+                                                               // the location did not contain a complete URI, build it!
+                                                       $parsedUrl = parse_url($lastUrl);
+                                                       $newUrl = $parsedUrl['scheme'] . '://' . (isset($parsedUrl['user']) ?
+                                                               $parsedUrl['user'] . (isset($parsedUrl['pass']) ? ':' . $parsedUrl['pass'] : '')
+                                                               : '') . $parsedUrl['host'] . (
+                                                       isset($parsedUrl['port']) ? ':' . $parsedUrl['port'] : '') . $location[1];
+                                               } else {
+                                                       $newUrl = $location[1];
+                                               }
+
+                                               if ($lastUrl === $newUrl) {
+                                                       break 2;
+                                               }
+                                       } else {
+                                               break 2;
+                                       }
                                }
-                               $tries++;
+                       }
+
+                               // now try to fetch again
+                       $content = t3lib_div::getURL($newUrl, 1, $additionalHeaders, $report);
+                       $lastUrl = $newUrl;
+                       $tries++;
                }
 
+
                $response = TRUE;
 
                        // analyze the response
@@ -118,15 +154,10 @@ class tx_linkvalidator_linktype_External extends tx_linkvalidator_linktype_Abstr
                if (($report['http_code'] == 301) || ($report['http_code'] == 302)
                        || ($report['http_code'] == 303) || ($report['http_code'] == 307)) {
                                $errorParams['errorType'] = $report['http_code'];
-                               $errorParams['location'] = $location[1];
+                               $errorParams['location'] = $lastUrl;
                                $response = FALSE;
                }
 
-               if ($report['http_code'] == 404 || $report['http_code'] == 403) {
-                       $errorParams['errorType'] = $report['http_code'];
-                       $response = FALSE;
-               }
-
                if ($report['http_code'] >= 300 && $response) {
                        $errorParams['errorType'] = $report['http_code'];
                        $response = FALSE;
@@ -162,14 +193,14 @@ class tx_linkvalidator_linktype_External extends tx_linkvalidator_linktype_Abstr
                                $response = sprintf($GLOBALS['LANG']->getLL('list.report.redirectloop'), $errorType, $errorParams['location']);
                                break;
 
-                       case 404:
-                               $response = $GLOBALS['LANG']->getLL('list.report.pagenotfound404');
-                               break;
-
                        case 403:
                                $response = $GLOBALS['LANG']->getLL('list.report.pageforbidden403');
                                break;
 
+                       case 404:
+                               $response = $GLOBALS['LANG']->getLL('list.report.pagenotfound404');
+                               break;
+
                        case 500:
                                $response = $GLOBALS['LANG']->getLL('list.report.internalerror500');
                                break;
@@ -217,4 +248,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_external.php']);
 }
 
-?>
\ No newline at end of file
+?>
index 9bc3928..4ece1b2 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
  *  Copyright notice
  *
- *  (c) 2005 - 2010 Jochen Rieger (j.rieger@connecta.ag) 
+ *  (c) 2005 - 2010 Jochen Rieger (j.rieger@connecta.ag)
  *  (c) 2010 - 2011 Michael Miousse (michael.miousse@infoglobe.ca)
  *  All rights reserved
  *
@@ -49,7 +49,7 @@ class tx_linkvalidator_linktype_File extends tx_linkvalidator_linktype_Abstract
        }
 
        /**
-        * Generate the localized error message from the error params saved from the parsing. 
+        * Generate the localized error message from the error params saved from the parsing.
         *
         * @param   array    all parameters needed for the rendering of the error message
         * @return  string    validation error message
index 7bc2b89..0d84be2 100644 (file)
@@ -283,15 +283,22 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
                $searchFields = $this->getSearchField($modTS);
                $linkTypes = $this->getLinkTypes($modTS);
                $processor = t3lib_div::makeInstance('tx_linkvalidator_Processor');
-               $pageIds = $processor->extGetTreeList($page, $this->depth, 0, '1=1');
-               $pageIds .= $page;
-               $processor->init($searchFields, $pageIds);
-               if (!empty($this->email)) {
-                       $oldLinkCounts = $processor->getLinkCounts($page);
-                       $this->oldTotalBrokenLink += $oldLinkCounts['brokenlinkCount'];
+               $pageRow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'pages', 'uid=' . $page);
+               $rootLineHidden = $processor->getRootLineIsHidden($pageRow);
+               if (!$rootLineHidden || $modTS['checkhidden']==1) {
+                       $pageIds = $processor->extGetTreeList($page, $this->depth, 0, '1=1', $modTS['checkhidden']);
+                       if ($pageRow['hidden'] == 0 || $modTS['checkhidden']==1) {
+                               $pageIds .= $page;
+                       }
+
+                       $processor->init($searchFields, $pageIds);
+                       if (!empty($this->email)) {
+                               $oldLinkCounts = $processor->getLinkCounts($page);
+                               $this->oldTotalBrokenLink += $oldLinkCounts['brokenlinkCount'];
+                       }
                }
 
-               $processor->getLinkStatistics($array, $modTS['checkhidden']);
+               $processor->getLinkStatistics($linkTypes, $modTS['checkhidden']);
 
                if (!empty($this->email)) {
                        $linkCounts = $processor->getLinkCounts($page);
@@ -337,30 +344,11 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
         * @return      array   $searchFields: list of fields.
         */
        protected function getSearchField($modTS) {
-                       // get the searchFields from TCA
-               foreach ($GLOBALS['TCA'] as $tableName => $table) {
-                       if (!empty($table['columns'])) {
-                               foreach ($table['columns'] as $columnName => $column) {
-                                       if ($column['config']['type'] == 'text' || $column['config']['type'] == 'input') {
-                                               if (!empty($column['config']['softref']) && (stripos($column['config']['softref'], "typolink")
-                                                               !== FALSE || stripos($column['config']['softref'], "url") !== FALSE)) {
-
-                                                       $searchFields[$tableName][] = $columnName;
-                                               }
-                                       }
-                               }
-                       }
-               }
-
                        // get the searchFields from TypoScript
                foreach ($modTS['searchFields.'] as $table => $fieldList) {
                        $fields = t3lib_div::trimExplode(',', $fieldList);
                        foreach ($fields as $field) {
-                               if (is_array($searchFields[$table])) {
-                                       if (array_search($field, $searchFields[$table]) === FALSE) {
-                                               $searchFields[$table][] = $field;
-                                       }
-                               }
+                               $searchFields[$table][] = $field;
                        }
                }
                return $searchFields;
@@ -373,12 +361,13 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
         * @return      array   $linkTypes: list of link types.
         */
        protected function getLinkTypes($modTS) {
-               $types = t3lib_div::trimExplode(',', $modTS['linktypes'], 1);
-               if (is_array($linkTypes)) {
+               $linkTypes = array();
+               $typesTmp = t3lib_div::trimExplode(',', $modTS['linktypes'], 1);
+               if (is_array($typesTmp)) {
                        if (!empty($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])
                                        && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
                                foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $type => $value) {
-                                       if (in_array($type, $linkTypes)) {
+                                       if (in_array($type, $typesTmp)) {
                                                $linkTypes[$type] = 1;
                                        }
                                }
index 6a27e31..1c911be 100644 (file)
@@ -198,7 +198,7 @@ class tx_linkvalidator_tasks_ValidatorAdditionalFieldProvider implements tx_sche
         *
         * @param       array           $submittedData: reference to the array containing the data submitted by the user
         * @param       tx_scheduler_module1            $parentObject: reference to the calling object (BE module of the Scheduler)
-        * @return      boolean         True if validation was ok (or selected class is not relevant), FALSE otherwise
+        * @return      boolean         TRUE if validation was ok (or selected class is not relevant), FALSE otherwise
         */
        public function validateAdditionalFields(array &$submittedData, tx_scheduler_Module $schedulerModule) {
                $isValid = TRUE;
index a094032..ea60e20 100644 (file)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext "linkvalidator".
 #
-# Auto generated 25-02-2011 23:56
+# Auto generated 23-05-2011 22:02
 #
 # Manual updates:
 # Only the data in the array - everything else is removed by next
@@ -29,7 +29,7 @@ $EM_CONF[$_EXTKEY] = array(
        'clearCacheOnLoad' => 0,
        'lockType' => '',
        'author_company' => 'Connecta AG / cab services ag / Infoglobe',
-       'version' => '1.0.2',
+       'version' => '1.0.3',
        'constraints' => array(
                'depends' => array(
                        'typo3' => '4.5.0-0.0.0',
@@ -40,7 +40,7 @@ $EM_CONF[$_EXTKEY] = array(
                'suggests' => array(
                ),
        ),
-       '_md5_values_when_last_written' => 'a:26:{s:9:"ChangeLog";s:4:"6c68";s:16:"ext_autoload.php";s:4:"4efa";s:12:"ext_icon.gif";s:4:"838b";s:17:"ext_localconf.php";s:4:"5e6f";s:14:"ext_tables.php";s:4:"1679";s:14:"ext_tables.sql";s:4:"2489";s:13:"locallang.xml";s:4:"f460";s:44:"classes/class.tx_linkvalidator_processor.php";s:4:"54da";s:61:"classes/linktype/class.tx_linkvalidator_linktype_abstract.php";s:4:"4c43";s:61:"classes/linktype/class.tx_linkvalidator_linktype_external.php";s:4:"83ce";s:57:"classes/linktype/class.tx_linkvalidator_linktype_file.php";s:4:"0a91";s:62:"classes/linktype/class.tx_linkvalidator_linktype_interface.php";s:4:"b40b";s:61:"classes/linktype/class.tx_linkvalidator_linktype_internal.php";s:4:"cc68";s:64:"classes/linktype/class.tx_linkvalidator_linktype_linkhandler.php";s:4:"ad63";s:56:"classes/tasks/class.tx_linkvalidator_tasks_validator.php";s:4:"7302";s:79:"classes/tasks/class.tx_linkvalidator_tasks_validatoradditionalfieldprovider.php";s:4:"7681";s:14:"doc/manual.sxw";s:4:"a6b9";s:14:"doc/manual.txt";s:4:"9221";s:54:"modfuncreport/class.tx_linkvalidator_modfuncreport.php";s:4:"b203";s:27:"modfuncreport/locallang.xml";s:4:"ca3f";s:31:"modfuncreport/locallang_csh.xml";s:4:"7953";s:31:"modfuncreport/locallang_mod.xml";s:4:"c589";s:31:"modfuncreport/mod_template.html";s:4:"4c0f";s:21:"res/linkvalidator.css";s:4:"2c65";s:21:"res/mailtemplate.html";s:4:"c425";s:20:"res/pagetsconfig.txt";s:4:"fb0b";}',
+       '_md5_values_when_last_written' => 'a:26:{s:9:"ChangeLog";s:4:"4645";s:16:"ext_autoload.php";s:4:"4efa";s:12:"ext_icon.gif";s:4:"838b";s:17:"ext_localconf.php";s:4:"5e6f";s:14:"ext_tables.php";s:4:"1679";s:14:"ext_tables.sql";s:4:"2489";s:13:"locallang.xml";s:4:"f460";s:44:"classes/class.tx_linkvalidator_processor.php";s:4:"3551";s:61:"classes/linktype/class.tx_linkvalidator_linktype_abstract.php";s:4:"4c43";s:61:"classes/linktype/class.tx_linkvalidator_linktype_external.php";s:4:"d372";s:57:"classes/linktype/class.tx_linkvalidator_linktype_file.php";s:4:"9f48";s:62:"classes/linktype/class.tx_linkvalidator_linktype_interface.php";s:4:"b40b";s:61:"classes/linktype/class.tx_linkvalidator_linktype_internal.php";s:4:"cc68";s:64:"classes/linktype/class.tx_linkvalidator_linktype_linkhandler.php";s:4:"ad63";s:56:"classes/tasks/class.tx_linkvalidator_tasks_validator.php";s:4:"e874";s:79:"classes/tasks/class.tx_linkvalidator_tasks_validatoradditionalfieldprovider.php";s:4:"1fbb";s:14:"doc/manual.sxw";s:4:"a6b9";s:14:"doc/manual.txt";s:4:"9221";s:54:"modfuncreport/class.tx_linkvalidator_modfuncreport.php";s:4:"f32a";s:27:"modfuncreport/locallang.xml";s:4:"ca3f";s:31:"modfuncreport/locallang_csh.xml";s:4:"7953";s:31:"modfuncreport/locallang_mod.xml";s:4:"c589";s:31:"modfuncreport/mod_template.html";s:4:"4c0f";s:21:"res/linkvalidator.css";s:4:"2c65";s:21:"res/mailtemplate.html";s:4:"c425";s:20:"res/pagetsconfig.txt";s:4:"fb0b";}',
        'suggests' => array(
        ),
 );
index 8261d29..a9e9767 100644 (file)
@@ -234,10 +234,9 @@ class tx_linkvalidator_ModFuncReport extends t3lib_extobjbase {
                $panelCheck = '';
                if ($this->modTS['showCheckLinkTab'] == 1) {
                        $panelCheck = '{
-
                       title: TYPO3.lang.CheckLink,
-                      html: ' . json_encode($this->flush()) . ',
-                       },      ';
+                      html: ' . json_encode($this->flush()) . '
+                       }';
                }
 
                $this->render();
@@ -246,12 +245,11 @@ class tx_linkvalidator_ModFuncReport extends t3lib_extobjbase {
                        id: "linkvalidator-main",
                        plain: true,
                        activeTab: 0,
-                       autoScroll: true,
                        bodyStyle: "padding:10px;",
-                       plugins: [new Ext.ux.plugins.FitToParent()],
                        items : [
                        {
-                      title: TYPO3.lang.Report,
+                               autoHeight: true,
+                               title: TYPO3.lang.Report,
                                html: ' . json_encode($this->flush(TRUE)) . '
                        },
                        ' . $panelCheck . '
@@ -332,26 +330,34 @@ class tx_linkvalidator_ModFuncReport extends t3lib_extobjbase {
                                }
                        }
                }
-                       // get children pages
-               $pageList = $this->processor->extGetTreeList(
-                       $this->pObj->id,
-                       $this->searchLevel,
-                       0,
-                       $GLOBALS['BE_USER']->getPagePermsClause(1)
-               );
-               $pageList .= $this->pObj->id;
+               $rootLineHidden = $this->processor->getRootLineIsHidden($this->pObj->pageinfo);
+               if (!$rootLineHidden || $this->modTS['checkhidden']==1) {
+                               // get children pages
+                       $pageList = $this->processor->extGetTreeList(
+                               $this->pObj->id,
+                               $this->searchLevel,
+                               0,
+                               $GLOBALS['BE_USER']->getPagePermsClause(1),
+                               $this->modTS['checkhidden']
+                       );
 
-               $this->processor->init($searchFields, $pageList);
 
-                       // check if button press
-               $update = t3lib_div::_GP('updateLinkList');
+                       if ($this->pObj->pageinfo['hidden'] == 0 || $this->modTS['checkhidden']==1){
+                               $pageList .= $this->pObj->id;
+                       }
 
-               if (!empty($update)) {
-                       $this->processor->getLinkStatistics($this->checkOpt, $this->modTS['checkhidden']);
+
+                       $this->processor->init($searchFields, $pageList);
+
+                               // check if button press
+                       $update = t3lib_div::_GP('updateLinkList');
+
+                       if (!empty($update)) {
+                               $this->processor->getLinkStatistics($this->checkOpt, $this->modTS['checkhidden']);
+                       }
                }
        }
 
-
        /**
         * Renders the content of the module.
         *
@@ -421,64 +427,74 @@ class tx_linkvalidator_ModFuncReport extends t3lib_extobjbase {
        protected function renderBrokenLinksTable() {
                $items = $brokenLinksMarker = array();
                $brokenLinkItems = $brokenLinksTemplate = '';
+               $brokenLinksTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###NOBROKENLINKS_CONTENT###');
                $keyOpt = array();
 
                if (is_array($this->checkOpt)) {
                        $keyOpt = array_keys($this->checkOpt);
                }
+               $rootLineHidden = $this->processor->getRootLineIsHidden($this->pObj->pageinfo);
+               if (!$rootLineHidden || $this->modTS['checkhidden']==1) {
+                       $pageList = $this->processor->extGetTreeList(
+                               $this->pObj->id,
+                               $this->searchLevel,
+                               0,
+                               $GLOBALS['BE_USER']->getPagePermsClause(1),
+                               $this->modTS['checkhidden']
+                       );
+                       if ($this->pObj->pageinfo['hidden'] == 0 || $this->modTS['checkhidden']==1){
+                               $pageList .= $this->pObj->id;
+                       }
 
-               $pageList = $this->processor->extGetTreeList(
-                       $this->pObj->id,
-                       $this->searchLevel,
-                       0,
-                       $GLOBALS['BE_USER']->getPagePermsClause(1)
-               );
-               $pageList .= $this->pObj->id;
-
-               if (($res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                       '*',
-                       'tx_linkvalidator_link',
-                       'record_pid in (' . $pageList . ') and link_type in (\'' . implode("','", $keyOpt) . '\')',
-                       '',
-                       'record_uid ASC, uid ASC')
-               )) {
+                       if (($res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                               '*',
+                               'tx_linkvalidator_link',
+                               'record_pid in (' . $pageList . ') and link_type in (\'' . implode("','", $keyOpt) . '\')',
+                               '',
+                               'record_uid ASC, uid ASC')
+                       )) {
                                // Display table with broken links
-                       if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) {
-                               $brokenLinksTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###BROKENLINKS_CONTENT###');
+                               if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) {
+                                       $brokenLinksTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###BROKENLINKS_CONTENT###');
 
-                               $brokenLinksItemTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###BROKENLINKS_ITEM###');
+                                       $brokenLinksItemTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###BROKENLINKS_ITEM###');
 
-                                       // Table header
-                               $brokenLinksMarker = $this->startTable();
+                                               // Table header
+                                       $brokenLinksMarker = $this->startTable();
 
-                                       // Table rows containing the broken links
-                               while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
-                                       $items[] = $this->renderTableRow($row['table_name'], $row, $brokenLinksItemTemplate);
+                                               // Table rows containing the broken links
+                                       while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
+                                               $items[] = $this->renderTableRow($row['table_name'], $row, $brokenLinksItemTemplate);
+                                       }
+                                       $brokenLinkItems = implode(chr(10), $items);
+
+                                       // Display note that there are no broken links to display
+                               } else {
+                                       $brokenLinksMarker = $this->getNoBrokenLinkMessage($brokenLinksMarker);
                                }
-                               $brokenLinkItems = implode(chr(10), $items);
-
-                               // Display note that there are no broken links to display
-                       } else {
-                               $brokenLinksTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###NOBROKENLINKS_CONTENT###');
-
-                               $brokenLinksMarker['LIST_HEADER'] = $this->doc->sectionHeader($GLOBALS['LANG']->getLL('list.header'));
-                               $message = t3lib_div::makeInstance(
-                                       't3lib_FlashMessage',
-                                       $GLOBALS['LANG']->getLL('list.no.broken.links'),
-                                       $GLOBALS['LANG']->getLL('list.no.broken.links.title'),
-                                       t3lib_FlashMessage::OK
-                               );
-                               $brokenLinksMarker['NO_BROKEN_LINKS'] = $message->render();
                        }
+               } else {
+
+                       $brokenLinksMarker = $this->getNoBrokenLinkMessage($brokenLinksMarker);
                }
                $brokenLinksTemplate = t3lib_parsehtml::substituteMarkerArray($brokenLinksTemplate, $brokenLinksMarker, '###|###', TRUE);
-
                $content = t3lib_parsehtml::substituteSubpart($brokenLinksTemplate, '###BROKENLINKS_ITEM', $brokenLinkItems);
 
                return $content;
        }
 
+       protected  function getNoBrokenLinkMessage($brokenLinksMarker){
+               $brokenLinksMarker['LIST_HEADER'] = $this->doc->sectionHeader($GLOBALS['LANG']->getLL('list.header'));
+               $message = t3lib_div::makeInstance(
+                       't3lib_FlashMessage',
+                       $GLOBALS['LANG']->getLL('list.no.broken.links'),
+                       $GLOBALS['LANG']->getLL('list.no.broken.links.title'),
+                       t3lib_FlashMessage::OK
+               );
+               $brokenLinksMarker['NO_BROKEN_LINKS'] = $message->render();
 
+               return $brokenLinksMarker;
+       }
 
        /**
         * Displays the table header of the table with the broken links.
@@ -743,4 +759,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/modfuncreport/class.tx_linkvalidator_modfuncreport.php']);
 }
 
-?>
\ No newline at end of file
+?>