Merged Linkvalidator 1.0.1 to be included in 4.5.1 (Thanks to Michael Miousse and...
authorbaschny <baschny@709f56b5-9817-0410-a4d7-c38de5d9e867>
Wed, 23 Feb 2011 10:14:33 +0000 (10:14 +0000)
committerbaschny <baschny@709f56b5-9817-0410-a4d7-c38de5d9e867>
Wed, 23 Feb 2011 10:14:33 +0000 (10:14 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-5@10582 709f56b5-9817-0410-a4d7-c38de5d9e867

16 files changed:
ChangeLog
typo3/sysext/linkvalidator/ChangeLog
typo3/sysext/linkvalidator/classes/class.tx_linkvalidator_processor.php
typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_internal.php
typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_linkhandler.php
typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validator.php
typo3/sysext/linkvalidator/doc/manual.sxw
typo3/sysext/linkvalidator/doc/manual.txt
typo3/sysext/linkvalidator/ext_emconf.php
typo3/sysext/linkvalidator/locallang.xml
typo3/sysext/linkvalidator/modfuncreport/class.tx_linkvalidator_modfuncreport.php
typo3/sysext/linkvalidator/modfuncreport/locallang.xml
typo3/sysext/linkvalidator/modfuncreport/locallang_csh.xml
typo3/sysext/linkvalidator/modfuncreport/locallang_mod.xml
typo3/sysext/linkvalidator/res/linkvalidator.css
typo3/sysext/linkvalidator/res/pagetsconfig.txt

index a8c7071..b6128e8 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-02-23  Ernesto Baschny  <ernst@cron-it.de>
+
+       * Merged Linkvalidator 1.0.1 to be included in 4.5.1 (Thanks to Michael Miousse and Christopher Stelmaszyk). Includes these fixes:
+       * Fixed Bug #f12649: Linkvalidator: Split up analyzeRecord()
+       * Fixed bug #f12652: Linkvalidator: If none of the link types are marked to be checked, all of them are checked
+       * Fixed bug #f12650: Linkvalidator: tx_linkvalidator_tasks_validator: exec() is too long
+       * Fixed bug #f12454: Linkvalidator: Use setting "defaultMailFromName" and "defaultMailFromAddress"
+       * Fixed bug #f12517: Linkvalidator: Replace exec_SELECTgetRows with exec_SELECTgetSingleRow whenever a single record is expected (thanks to Jo Hasenau)
+       * Fixed bug #f12549: Linkvalidator: Unify capitalization of language labels
+
 2011-02-23  Tolleiv Nietsch  <typo3@tolleiv.de>
 
        * Fixed bug #17511: tx_install_session::write doesn't fix permissions
index ff456df..aea2027 100644 (file)
@@ -1,4 +1,20 @@
-2011-01-21  Christopher Stelmaszyk  <chrissitopher@gmx.de>
+2011-02-22  Michael Miousse <michael.miousse@infoglobe.ca>
+       * Cleaned emconf for the release of TYPO3 4.5.1
+       * Release linkvalidator 1.0.1
+       * Fixed Bug #12649: Split up analyzeRecord()
+       
+2011-02-15     Michael Miousse  <michael.miousse@infoglobe.ca>
+
+       * Fixed bug #12652:     If none of the link types are marked to be checked, all of them are checked
+       * Fixed bug #12650:     tx_linkvalidator_tasks_validator: exec() is too long
+       * Fixed bug #12454: Use setting "defaultMailFromName" and "defaultMailFromAddress"
+       
+2011-02-06  Christopher Stelmaszyk  <chrissitopher@gmx.de>
+
+       * Fixed bug #12517: Replace exec_SELECTgetRows with exec_SELECTgetSingleRow whenever a single record is expected (thanks to Jo Hasenau)
+       * Fixed bug #12549: Unify capitalization of language labels
+
+2011-01-26  Christopher Stelmaszyk  <chrissitopher@gmx.de>
 
        * Fixed bug #12526: Manual needs new screenshots and text since we now use 2 tabs in the module (thanks to Patrick Gaumond)
        * Cleaned emconf for the release of TYPO3 4.5
index 1ad30d3..546e60e 100644 (file)
@@ -121,81 +121,82 @@ class tx_linkvalidator_Processor {
                if(count($checkOptions) > 0) {
                        $checkKeys = array_keys($checkOptions);
                        $checlLinkTypeCondition = ' and link_type in (\'' . implode('\',\'',$checkKeys) . '\')';
-               }
-               $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_linkvalidator_link', '(record_pid in (' . $this->pidList . ') or ( record_uid IN (' . $this->pidList . ') and table_name like \'pages\')) ' . $checlLinkTypeCondition);
-               
-                       // let's traverse all configured tables
-               foreach ($this->searchFields as $table => $fields) {
-                       if($table == 'pages'){
-                               $where = 'deleted = 0 AND uid IN (' . $this->pidList . ')';
-                       }
-                       else{
-                               $where = 'deleted = 0 AND pid IN (' . $this->pidList . ')';
-                       }
-                       if (!$considerHidden) {
-                               $where .= t3lib_BEfunc::BEenableFields($table);
-                       }
-                               // if table is not configured, we assume the ext is not installed and therefore no need to check it
-                       if (!is_array($GLOBALS['TCA'][$table])) continue;
-
-                               // re-init selectFields for table
-                       $selectFields = 'uid, pid';
-                       $selectFields .= ', ' . $GLOBALS['TCA'][$table]['ctrl']['label'] . ', ' . implode(', ', $fields);
-                       
-                               // TODO: only select rows that have content in at least one of the relevant fields (via OR)
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($selectFields, $table, $where);
-                               // Get record rows of table
-                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                               // Analyse each record
-                               $this->analyzeRecord($results, $table, $fields, $row);
+
+                       $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_linkvalidator_link', '(record_pid in (' . $this->pidList . ') or ( record_uid IN (' . $this->pidList . ') and table_name like \'pages\')) ' . $checlLinkTypeCondition);
+
+                               // let's traverse all configured tables
+                       foreach ($this->searchFields as $table => $fields) {
+                               if($table == 'pages'){
+                                       $where = 'deleted = 0 AND uid IN (' . $this->pidList . ')';
+                               }
+                               else{
+                                       $where = 'deleted = 0 AND pid IN (' . $this->pidList . ')';
+                               }
+                               if (!$considerHidden) {
+                                       $where .= t3lib_BEfunc::BEenableFields($table);
+                               }
+                                       // if table is not configured, we assume the ext is not installed and therefore no need to check it
+                               if (!is_array($GLOBALS['TCA'][$table])) continue;
+
+                                       // re-init selectFields for table
+                               $selectFields = 'uid, pid';
+                               $selectFields .= ', ' . $GLOBALS['TCA'][$table]['ctrl']['label'] . ', ' . implode(', ', $fields);
+
+                                       // TODO: only select rows that have content in at least one of the relevant fields (via OR)
+                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($selectFields, $table, $where);
+                                       // Get record rows of table
+                               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                                       // Analyse each record
+                                       $this->analyzeRecord($results, $table, $fields, $row);
+                               }
                        }
-               }
 
-               foreach ($this->hookObjectsArr as $key => $hookObj) {
-                       if ((is_array($results[$key])) && empty($checkOptions) || (is_array($results[$key]) && $checkOptions[$key])) {
-                                       //  check'em!
-                               foreach ($results[$key] as $entryKey => $entryValue) {
-                                       $table = $entryValue['table'];
-                                       $record = array();
-                                       $record['headline'] = $entryValue['row'][$GLOBALS['TCA'][$table]['ctrl']['label']];
-                                       $record['record_pid'] = $entryValue['row']['pid'];
-                                       $record['record_uid'] = $entryValue['uid'];
-                                       $record['table_name'] = $table;
-                                       $record['link_title'] = $entryValue['link_title'];
-                                       $record['field'] = $entryValue['field'];
-                                       $record['last_check'] = time();
-
-                                       $this->recordReference = $entryValue['substr']['recordRef'];
-
-                                       $this->pageWithAnchor = $entryValue['pageAndAnchor'];
-                                       
-                                       if (!empty($this->pageWithAnchor)) {
-                                                       // page with anchor, e.g. 18#1580
-                                               $url = $this->pageWithAnchor;
-                                       } else {
-                                               $url = $entryValue['substr']['tokenValue'];
-                                       }
+                       foreach ($this->hookObjectsArr as $key => $hookObj) {
+                               if ((is_array($results[$key])) && empty($checkOptions) || (is_array($results[$key]) && $checkOptions[$key])) {
+                                               //  check'em!
+                                       foreach ($results[$key] as $entryKey => $entryValue) {
+                                               $table = $entryValue['table'];
+                                               $record = array();
+                                               $record['headline'] = $entryValue['row'][$GLOBALS['TCA'][$table]['ctrl']['label']];
+                                               $record['record_pid'] = $entryValue['row']['pid'];
+                                               $record['record_uid'] = $entryValue['uid'];
+                                               $record['table_name'] = $table;
+                                               $record['link_title'] = $entryValue['link_title'];
+                                               $record['field'] = $entryValue['field'];
+                                               $record['last_check'] = time();
+
+                                               $this->recordReference = $entryValue['substr']['recordRef'];
+
+                                               $this->pageWithAnchor = $entryValue['pageAndAnchor'];
+
+                                               if (!empty($this->pageWithAnchor)) {
+                                                               // page with anchor, e.g. 18#1580
+                                                       $url = $this->pageWithAnchor;
+                                               } else {
+                                                       $url = $entryValue['substr']['tokenValue'];
+                                               }
 
-                                       $this->linkCounts[$table]++;
-                                       $checkURL = $hookObj->checkLink($url, $entryValue, $this);
-                                               // broken link found!
-                                       if (!$checkURL) {
-                                               $response = array();
-                                               $response['valid'] = FALSE;
-                                               $response['errorParams'] = $hookObj->getErrorParams();
-                                               $this->brokenLinkCounts[$table]++;
-                                               $record['link_type'] = $key;
-                                               $record['url'] = $url;
-                                               $record['url_response'] = serialize($response);
-                                               $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_linkvalidator_link', $record);
-                                       } elseif (t3lib_div::_GP('showalllinks')) {
-                                               $response = array();
-                                               $response['valid'] = TRUE;
-                                               $this->brokenLinkCounts[$table]++;
-                                               $record['url'] = $url;
-                                               $record['link_type'] = $key;
-                                               $record['url_response'] = serialize($response);
-                                               $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_linkvalidator_link', $record);
+                                               $this->linkCounts[$table]++;
+                                               $checkURL = $hookObj->checkLink($url, $entryValue, $this);
+                                                       // broken link found!
+                                               if (!$checkURL) {
+                                                       $response = array();
+                                                       $response['valid'] = FALSE;
+                                                       $response['errorParams'] = $hookObj->getErrorParams();
+                                                       $this->brokenLinkCounts[$table]++;
+                                                       $record['link_type'] = $key;
+                                                       $record['url'] = $url;
+                                                       $record['url_response'] = serialize($response);
+                                                       $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_linkvalidator_link', $record);
+                                               } elseif (t3lib_div::_GP('showalllinks')) {
+                                                       $response = array();
+                                                       $response['valid'] = TRUE;
+                                                       $this->brokenLinkCounts[$table]++;
+                                                       $record['url'] = $url;
+                                                       $record['link_type'] = $key;
+                                                       $record['url_response'] = serialize($response);
+                                                       $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_linkvalidator_link', $record);
+                                               }
                                        }
                                }
                        }
@@ -213,7 +214,7 @@ class tx_linkvalidator_Processor {
         * @return      void
         */
        public function analyzeRecord(&$results, $table, $fields, $record) {
-               
+
                        // array to store urls from relevant field contents
                $urls = array();
 
@@ -223,20 +224,20 @@ class tx_linkvalidator_Processor {
 
                        // flag whether row contains a broken link in some field or not
                $rowContainsBrokenLink = FALSE;
-               
+
                        // put together content of all relevant fields
                $haystack = '';
                $htmlParser = t3lib_div::makeInstance('t3lib_parsehtml');
-               
+
                $idRecord = $record['uid'];
-               
+
                        // get all references
                foreach ($fields as $field) {
                        $haystack .= $record[$field] . ' --- ';
                        $conf = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
-                       
+
                        $valueField = $record[$field];
-                       
+
                                // Check if a TCA configured field has softreferences defined (see TYPO3 Core API document)
                        if ($conf['softref'] && strlen($valueField)) {
                                        // Explode the list of softreferences/parameters
@@ -254,68 +255,9 @@ class tx_linkvalidator_Processor {
                                                if (!empty($resultArray['elements'])) {
 
                                                        if ($spKey == 'typolink_tag') {
-                                                               $linkTags = $htmlParser->splitIntoBlock('link', $resultArray['content']);
-
-                                                               for ($i = 1; $i < count($linkTags); $i += 2) {
-                                                                       $referencedRecordType = '';
-                                                                       foreach($resultArray['elements'] as $element) {
-                                                                                       $type = '';
-                                                                                       $r = $element['subst'];
-
-                                                                                       if (!empty($r['tokenID'])) {
-                                                                                               if (substr_count($linkTags[$i], $r['tokenID'])) {
-                                                                                                               // Type of referenced record
-                                                                                                       if (strpos($r['recordRef'], 'pages') !== FALSE) {
-                                                                                                               $currentR = $r;
-                                                                                                                       // contains number of the page
-                                                                                                               $referencedRecordType = $r['tokenValue'];
-                                                                                                               $wasPage = TRUE;
-                                                                                                       }
-                                                                                                               // append number of content element to the page saved in the last loop
-                                                                                                       elseif ((strpos($r['recordRef'], 'tt_content') !== FALSE) && ($wasPage === TRUE)) {
-                                                                                                               $referencedRecordType = $referencedRecordType . '#c' . $r['tokenValue'];
-                                                                                                               $wasPage = FALSE;
-                                                                                                       } else {
-                                                                                                               $currentR = $r;
-                                                                                                       }
-                                                                                                       $title = strip_tags($linkTags[$i]);
-                                                                                               }
-                                                                                       }
-                                                                       }
-                                                                       foreach ($this->hookObjectsArr as $keyArr => $hookObj) {
-                                                                               $type = $hookObj->fetchType($currentR, $type, $keyArr);
-                                                                       }
-
-                                                                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $currentR["tokenID"]]["substr"] = $currentR;
-                                                                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $currentR["tokenID"]]["row"] = $record;
-                                                                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $currentR["tokenID"]]["table"] = $table;
-                                                                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $currentR["tokenID"]]["field"] = $field;
-                                                                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $currentR["tokenID"]]["uid"] = $idRecord;
-                                                                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $currentR["tokenID"]]["link_title"] = $title;
-                                                                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $currentR["tokenID"]]["pageAndAnchor"] = $referencedRecordType;
-
-                                                               }
+                                                               $this->analyseTypoLinks($resultArray, $results, $htmlParser);
                                                        } else {
-
-                                                               foreach ($resultArray['elements'] as $element) {
-                                                                       $r = $element['subst'];
-                                                                       $title = '';
-                                                                       $type = '';
-
-                                                                       if (!empty($r)) {
-                                                                                       // Parse string for special TYPO3 <link> tag:
-
-                                                                               foreach ($this->hookObjectsArr as $keyArr => $hookObj) {
-                                                                                       $type = $hookObj->fetchType($r, $type, $keyArr);
-                                                                               }
-                                                                               $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $r["tokenID"]]["substr"] = $r;
-                                                                               $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $r["tokenID"]]["row"] = $record;
-                                                                               $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $r["tokenID"]]["table"] = $table;
-                                                                               $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $r["tokenID"]]["field"] = $field;
-                                                                               $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $r["tokenID"]]["uid"] = $idRecord;
-
-                                                                       }
-                                                               }
+                                                               $this->analyseLinks($resultArray, $results);
                                                        }
                                                }
                                        }
@@ -323,6 +265,87 @@ class tx_linkvalidator_Processor {
                        }
                }
        }
+       
+       /**
+        * Find all supported broken links for a specific link lsit.
+        *
+        * @param       array           $resultArray: findRef parsed records  
+        * @param       array           $results: array of broken links
+        * @return      void
+        */
+       private function analyseLinks($resultArray, &$results) {        
+               foreach ($resultArray['elements'] as $element) {
+                       $r = $element['subst'];
+                       $title = '';
+                       $type = '';
+
+                       if (!empty($r)) {
+                                       // Parse string for special TYPO3 <link> tag:
+
+                               foreach ($this->hookObjectsArr as $keyArr => $hookObj) {
+                                       $type = $hookObj->fetchType($r, $type, $keyArr);
+                               }
+                               $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $r["tokenID"]]["substr"] = $r;
+                               $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $r["tokenID"]]["row"] = $record;
+                               $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $r["tokenID"]]["table"] = $table;
+                               $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $r["tokenID"]]["field"] = $field;
+                               $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $r["tokenID"]]["uid"] = $idRecord;
+
+                       }
+               }
+       }
+       
+       /**
+        * Find all supported broken links for a specific typoLink.
+        *
+        * @param       array                   $resultArray: findRef parsed records 
+        * @param       array                   $results: array of broken links
+        * @param       t3lib_parsehtml $htmlParser: instance of htmlparser
+        * @return      void
+        */
+       private function analyseTypoLinks($resultArray, &$results, $htmlParser) {
+               $linkTags = $htmlParser->splitIntoBlock('link', $resultArray['content']);
+
+               for ($i = 1; $i < count($linkTags); $i += 2) {
+                       $referencedRecordType = '';
+                       foreach($resultArray['elements'] as $element) {
+                                       $type = '';
+                                       $r = $element['subst'];
+
+                                       if (!empty($r['tokenID'])) {
+                                               if (substr_count($linkTags[$i], $r['tokenID'])) {
+                                                               // Type of referenced record
+                                                       if (strpos($r['recordRef'], 'pages') !== FALSE) {
+                                                               $currentR = $r;
+                                                                       // contains number of the page
+                                                               $referencedRecordType = $r['tokenValue'];
+                                                               $wasPage = TRUE;
+                                                       }
+                                                               // append number of content element to the page saved in the last loop
+                                                       elseif ((strpos($r['recordRef'], 'tt_content') !== FALSE) && ($wasPage === TRUE)) {
+                                                               $referencedRecordType = $referencedRecordType . '#c' . $r['tokenValue'];
+                                                               $wasPage = FALSE;
+                                                       } else {
+                                                               $currentR = $r;
+                                                       }
+                                                       $title = strip_tags($linkTags[$i]);
+                                               }
+                                       }
+                       }
+                       foreach ($this->hookObjectsArr as $keyArr => $hookObj) {
+                               $type = $hookObj->fetchType($currentR, $type, $keyArr);
+                       }
+
+                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $currentR["tokenID"]]["substr"] = $currentR;
+                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $currentR["tokenID"]]["row"] = $record;
+                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $currentR["tokenID"]]["table"] = $table;
+                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $currentR["tokenID"]]["field"] = $field;
+                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $currentR["tokenID"]]["uid"] = $idRecord;
+                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $currentR["tokenID"]]["link_title"] = $title;
+                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $currentR["tokenID"]]["pageAndAnchor"] = $referencedRecordType;
+
+               }
+       }
 
        /**
         * Fill a markerarray with the number of links found in a list of pages.
@@ -345,7 +368,7 @@ class tx_linkvalidator_Processor {
                }
                return $markerArray;
        }
-       
+
        /**
         * Calls t3lib_tsfeBeUserAuth::extGetTreeList.
         * Although this duplicates the function t3lib_tsfeBeUserAuth::extGetTreeList
@@ -387,7 +410,7 @@ class tx_linkvalidator_Processor {
                }
                return $theList;
        }
-       
+
 
 }
 
index 93ff21c..615e156 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
  *
@@ -118,25 +118,25 @@ class tx_linkvalidator_linktype_Internal extends tx_linkvalidator_linktype_Abstr
         * @return  string        TRUE on success or FALSE on error
         */
        protected function checkPage($page, $softRefEntry, $reference) {
-               $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+               $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                        'uid, title, deleted, hidden, starttime, endtime',
                        'pages',
                        'uid = ' . intval($page)
                );
                $this->responsePage = TRUE;
 
-               if ($rows[0]) {
-                       if ($rows[0]['deleted'] == '1') {
+               if ($row) {
+                       if ($row['deleted'] == '1') {
                                $this->errorParams['errorType']['page'] = DELETED;
-                               $this->errorParams['page']['title'] = $rows[0]['title'];
-                               $this->errorParams['page']['uid'] = $rows[0]['uid'];
+                               $this->errorParams['page']['title'] = $row['title'];
+                               $this->errorParams['page']['uid'] = $row['uid'];
                                $this->responsePage = FALSE;
-                       } elseif ($rows[0]['hidden'] == '1'
-                               || $GLOBALS['EXEC_TIME'] < intval($rows[0]['starttime'])
-                               || ($rows[0]['endtime'] && intval($rows[0]['endtime']) < $GLOBALS['EXEC_TIME'])) {
+                       } elseif ($row['hidden'] == '1'
+                               || $GLOBALS['EXEC_TIME'] < intval($row['starttime'])
+                               || ($row['endtime'] && intval($row['endtime']) < $GLOBALS['EXEC_TIME'])) {
                                $this->errorParams['errorType']['page'] = HIDDEN;
-                               $this->errorParams['page']['title'] = $rows[0]['title'];
-                               $this->errorParams['page']['uid'] = $rows[0]['uid'];
+                               $this->errorParams['page']['title'] = $row['title'];
+                               $this->errorParams['page']['uid'] = $row['uid'];
                                $this->responsePage = FALSE;
                        }
                } else {
@@ -159,7 +159,7 @@ class tx_linkvalidator_linktype_Internal extends tx_linkvalidator_linktype_Abstr
         */
        protected function checkContent($page, $anchor, $softRefEntry, $reference) {
                        // Get page ID on which the content element in fact is located
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                        'uid, pid, header, deleted, hidden, starttime, endtime',
                        'tt_content',
                        'uid = ' . intval($anchor)
@@ -167,9 +167,9 @@ class tx_linkvalidator_linktype_Internal extends tx_linkvalidator_linktype_Abstr
                $this->responseContent = TRUE;
 
                        // this content element exists
-               if ($res[0]) {
+               if ($res) {
                                // page ID on which this CE is in fact located.
-                       $correctPageID = $res[0]['pid'];
+                       $correctPageID = $res['pid'];
 
                                // check if the element is on the linked page
                                // (the element might have been moved to another page)
@@ -182,17 +182,17 @@ class tx_linkvalidator_linktype_Internal extends tx_linkvalidator_linktype_Abstr
 
                        } else {
                                        // the element is located on the page to which the link is pointing
-                               if ($res[0]['deleted'] == '1') {
+                               if ($res['deleted'] == '1') {
                                        $this->errorParams['errorType']['content'] = DELETED;
-                                       $this->errorParams['content']['title'] = $res[0]['header'];
-                                       $this->errorParams['content']['uid'] = $res[0]['uid'];
+                                       $this->errorParams['content']['title'] = $res['header'];
+                                       $this->errorParams['content']['uid'] = $res['uid'];
                                        $this->responseContent = FALSE;
-                               } elseif ($res[0]['hidden'] == '1'
-                                       || $GLOBALS['EXEC_TIME'] < intval($res[0]['starttime'])
-                                       || ($res[0]['endtime'] && intval($res[0]['endtime']) < $GLOBALS['EXEC_TIME'])) {
+                               } elseif ($res['hidden'] == '1'
+                                       || $GLOBALS['EXEC_TIME'] < intval($res['starttime'])
+                                       || ($res['endtime'] && intval($res['endtime']) < $GLOBALS['EXEC_TIME'])) {
                                        $this->errorParams['errorType']['content'] = HIDDEN;
-                                       $this->errorParams['content']['title'] = $res[0]['header'];
-                                       $this->errorParams['content']['uid'] = $res[0]['uid'];
+                                       $this->errorParams['content']['title'] = $res['header'];
+                                       $this->errorParams['content']['uid'] = $res['uid'];
                                        $this->responseContent = FALSE;
                                }
                        }
@@ -208,7 +208,7 @@ class tx_linkvalidator_linktype_Internal extends tx_linkvalidator_linktype_Abstr
        }
 
        /**
-        * 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
@@ -229,7 +229,7 @@ class tx_linkvalidator_linktype_Internal extends tx_linkvalidator_linktype_Abstr
                                        $errorPage = str_replace('###title###', $errorParams['page']['title'], $errorPage);
                                        $errorPage = str_replace('###uid###', $errorParams['page']['uid'], $errorPage);
                                        break;
-            
+
                                default:
                                        $errorPage = $GLOBALS['LANG']->getLL('list.report.pagenotexisting');
                                        $errorPage = str_replace('###uid###', $errorParams['page']['uid'], $errorPage);
@@ -269,7 +269,7 @@ class tx_linkvalidator_linktype_Internal extends tx_linkvalidator_linktype_Abstr
                } elseif ($errorPage) {
                        $response = $errorPage;
                } elseif ($errorContent) {
-                       $response = $errorContent; 
+                       $response = $errorContent;
                }
 
                return $response;
index 25f8081..5aa192d 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
  *
@@ -63,14 +63,14 @@ class tx_linkvalidator_linktype_LinkHandler extends tx_linkvalidator_linktype_Ab
                if (count($parts) == 3) {
                        $tableName = htmlspecialchars($parts[1]);
                        $rowid = intval($parts[2]);
-                       $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                       $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                '*',
                                $tableName,
                                'uid = ' . intval($rowid)
                        );
 
-                       if ($rows[0]) {
-                               if ($rows[0]['deleted'] == '1') {
+                       if ($row) {
+                               if ($row['deleted'] == '1') {
                                        $errorParams['errorType'] = DELETED;
                                        $errorParams['tablename'] = $tableName;
                                        $errorParams['uid'] = $rowid;
@@ -106,7 +106,7 @@ class tx_linkvalidator_linktype_LinkHandler extends tx_linkvalidator_linktype_Ab
        }
 
        /**
-        * 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 078a5bf..7bc2b89 100644 (file)
@@ -66,7 +66,7 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
         * @var string
         */
        protected $templateMail;
-       
+
        /**
         * specific TSconfig for this task.
         *
@@ -108,7 +108,7 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
         * @var string
         */
        protected $email;
-       
+
        /**
         * Only send an email, if new broken links were found.
         *
@@ -124,7 +124,7 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
        public function getEmail() {
                return $this->email;
        }
-       
+
        /**
         * Set the value of the private property email.
         *
@@ -134,7 +134,7 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
        public function setEmail($email) {
                $this->email=$email;
        }
-       
+
        /**
         * Get the value of the protected property emailOnBrokenLinkOnly.
         *
@@ -143,7 +143,7 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
        public function getEmailOnBrokenLinkOnly() {
                return $this->emailOnBrokenLinkOnly;
        }
-       
+
        /**
         * Set the value of the private property emailOnBrokenLinkOnly.
         *
@@ -153,7 +153,7 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
        public function setEmailOnBrokenLinkOnly($emailOnBrokenLinkOnly) {
                $this->emailOnBrokenLinkOnly = $emailOnBrokenLinkOnly;
        }
-       
+
        /**
         * Get the value of the protected property page.
         *
@@ -162,7 +162,7 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
        public function getPage() {
                return $this->page;
        }
-       
+
        /**
         * Set the value of the private property page.
         *
@@ -172,7 +172,7 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
        public function setPage($page) {
                $this->page =$page;
        }
-       
+
        /**
         * Get the value of the protected property depth.
         *
@@ -181,7 +181,7 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
        public function getDepth() {
                return $this->depth;
        }
-       
+
        /**
         * Set the value of the private property depth.
         *
@@ -191,7 +191,7 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
        public function setDepth($depth) {
                $this->depth = $depth;
        }
-       
+
        /**
         * Get the value of the protected property emailTemplateFile.
         *
@@ -200,7 +200,7 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
        public function getEmailTemplateFile() {
                return $this->emailTemplateFile;
        }
-       
+
        /**
         * Set the value of the private property emailTemplateFile.
         *
@@ -210,7 +210,7 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
        public function setEmailTemplateFile($emailTemplateFile) {
                $this->emailTemplateFile = $emailTemplateFile;
        }
-       
+
        /**
         * Get the value of the protected property configuration.
         *
@@ -219,7 +219,7 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
        public function getConfiguration() {
                return $this->configuration;
        }
-       
+
        /**
         * Set the value of the private property configuration.
         *
@@ -229,8 +229,8 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
        public function setConfiguration($configuration) {
                $this->configuration = $configuration;
        }
-       
-       
+
+
        /**
         * Function executed from the Scheduler.
         *
@@ -253,82 +253,10 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
                $pageSections = '';
                $this->dif = FALSE;
                $pageList = t3lib_div::trimExplode(',', $this->page, 1);
+               $modTS = $this->loadModTSconfig($this->page);
                if (is_array($pageList)) {
                        foreach ($pageList as $page) {
-                               $modTS = t3lib_BEfunc::getModTSconfig($page, 'mod.linkvalidator');
-                               $parseObj = t3lib_div::makeInstance('t3lib_TSparser');
-                               $parseObj->parse($this->configuration);
-                               if(count($parseObj->errors) > 0){
-                                       $parseErrorMessage = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.error.invalidTSconfig') . '<br />';
-                                       foreach($parseObj->errors as $errorInfo){
-                                               $parseErrorMessage .= $errorInfo[0] . '<br />';
-                                       }
-                                       throw new Exception(
-                                               $parseErrorMessage,
-                                               '1295476989'
-                                       );
-                               }
-                               $TSconfig = $parseObj->setup;
-                               $modTS = $modTS['properties'];
-                               $overrideTs = $TSconfig['mod.']['tx_linkvalidator.'];
-                               if (is_array($overrideTs)) {
-                                       $modTS = t3lib_div::array_merge_recursive_overrule($modTS, $overrideTs);
-                               }
-
-                                       // 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;
-                                                       }
-                                               }
-                                       }
-                               }
-                               $linkTypes = t3lib_div::trimExplode(',', $modTS['linktypes'], 1);
-                               if (is_array($linkTypes)) {
-                                       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)) {
-                                                               $array[$type] = 1;
-                                                       }
-                                               }
-                                       }
-                               }
-                               $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'];
-                               }
-
-                               $processor->getLinkStatistics($array, $modTS['checkhidden']);
-
-                               if (!empty($this->email)) {
-                                       $linkCounts = $processor->getLinkCounts($page);
-                                       $this->totalBrokenLink += $linkCounts['brokenlinkCount'];
-                                       $pageSections .= $this->buildMail($page, $pageIds, $linkCounts, $oldLinkCounts);
-                               }
-
+                               $pageSections .= $this->checkPageLinks($page);
                        }
                }
                if ($this->totalBrokenLink != $this->oldTotalBrokenLink) {
@@ -343,6 +271,121 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
                return $successfullyExecuted;
        }
 
+       /**
+        * Validate all links for a page based on the task configuration.
+        *
+        * @param       integer $page: uid of the page to parse.
+        * @return      string  $pageSections: Content of page section.
+        */
+       protected function checkPageLinks($page) {
+               $pageSections = '';
+               $modTS = $this->loadModTSconfig($page);
+               $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'];
+               }
+
+               $processor->getLinkStatistics($array, $modTS['checkhidden']);
+
+               if (!empty($this->email)) {
+                       $linkCounts = $processor->getLinkCounts($page);
+                       $this->totalBrokenLink += $linkCounts['brokenlinkCount'];
+                       $pageSections = $this->buildMail($page, $pageIds, $linkCounts, $oldLinkCounts);
+               }
+               return $pageSections;
+       }
+
+       /**
+        * Get the linkvalidator modTSconfig for a page.
+        *
+        * @param       integer $page: uid of the page.
+        * @return      array   $modTS: mod.linkvalidator TSconfig array.
+        */
+       protected function loadModTSconfig($page) {
+               $modTS = t3lib_BEfunc::getModTSconfig($page, 'mod.linkvalidator');
+               $parseObj = t3lib_div::makeInstance('t3lib_TSparser');
+               $parseObj->parse($this->configuration);
+               if(count($parseObj->errors) > 0){
+                       $parseErrorMessage = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.error.invalidTSconfig') . '<br />';
+                       foreach($parseObj->errors as $errorInfo){
+                               $parseErrorMessage .= $errorInfo[0] . '<br />';
+                       }
+                       throw new Exception(
+                               $parseErrorMessage,
+                               '1295476989'
+                       );
+               }
+               $TSconfig = $parseObj->setup;
+               $modTS = $modTS['properties'];
+               $overrideTs = $TSconfig['mod.']['tx_linkvalidator.'];
+               if (is_array($overrideTs)) {
+                       $modTS = t3lib_div::array_merge_recursive_overrule($modTS, $overrideTs);
+               }
+               return $modTS;
+       }
+
+       /**
+        * Get the list of fields to parse in modTSconfig.
+        *
+        * @param       array   $modTS: mod.linkvalidator TSconfig array.
+        * @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;
+                                       }
+                               }
+                       }
+               }
+               return $searchFields;
+       }
+
+       /**
+        * Get the list of linkTypes to parse in modTSconfig.
+        *
+        * @param       array   $modTS: mod.linkvalidator TSconfig array.
+        * @return      array   $linkTypes: list of link types.
+        */
+       protected function getLinkTypes($modTS) {
+               $types = t3lib_div::trimExplode(',', $modTS['linktypes'], 1);
+               if (is_array($linkTypes)) {
+                       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)) {
+                                               $linkTypes[$type] = 1;
+                                       }
+                               }
+                       }
+               }
+               return $linkTypes;
+       }
 
        /**
         * Build and send warning email when new broken links were found.
@@ -363,12 +406,18 @@ class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
                $markerArray['totalBrokenLink'] = $this->totalBrokenLink;
                $markerArray['totalBrokenLink_old'] = $this->oldTotalBrokenLink;
                $content = t3lib_parsehtml::substituteMarkerArray($content, $markerArray, '###|###', TRUE, TRUE);
-
+               
                /** @var t3lib_mail_Message $mail */
                $mail = t3lib_div::makeInstance('t3lib_mail_Message');
+               if(empty($modTS['mail.']['fromemail'])) {
+                       $modTS['mail.']['fromemail'] = t3lib_utility_Mail::getSystemFromAddress();
+               }
+               if(empty($modTS['mail.']['fromname'])) {
+                       $modTS['mail.']['fromname'] = t3lib_utility_Mail::getSystemFromName();
+               }
                if (t3lib_div::validEmail($modTS['mail.']['fromemail'])) {
                        $mail->setFrom(array($modTS['mail.']['fromemail'] => $modTS['mail.']['fromname']));
-               } else {
+               }  else {
                        throw new Exception(
                                $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.error.invalidFromEmail'),
                                '1295476760'
index d37288f..2e2f33f 100644 (file)
Binary files a/typo3/sysext/linkvalidator/doc/manual.sxw and b/typo3/sysext/linkvalidator/doc/manual.sxw differ
index d6bd307..7229e05 100644 (file)
@@ -125,11 +125,13 @@ Note: Linkvalidator uses a database table to store information about the broken
 mail.fromname
 string
 Set the from name of the report mail sent by the cron script. 
-Linkvalidator
+Install Tool
+defaultMailFromName
 mail.fromemail
 string
 Set the from email of the report mail sent by the cron script. 
-Linkvalidator@example.com
+Install Tool
+defaultMailFromAddress
 mail.replytoname
 string
 Set the replyto name of the report mail sent by the cron script. 
index 67f65fb..afa6bd6 100644 (file)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext "linkvalidator".
 #
-# Auto generated 26-01-2011 20:08
+# Auto generated 23-02-2011 11:00
 #
 # 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.0',
+       'version' => '1.0.1',
        'constraints' => array(
                'depends' => array(
                        'typo3' => '4.1.0-0.0.0',
@@ -41,7 +41,7 @@ $EM_CONF[$_EXTKEY] = array(
                'suggests' => array(
                ),
        ),
-       '_md5_values_when_last_written' => 'a:26:{s:9:"ChangeLog";s:4:"8fc2";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:"15c4";s:44:"classes/class.tx_linkvalidator_processor.php";s:4:"2d9e";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:"e9b4";s:64:"classes/linktype/class.tx_linkvalidator_linktype_linkhandler.php";s:4:"49b6";s:56:"classes/tasks/class.tx_linkvalidator_tasks_validator.php";s:4:"2442";s:79:"classes/tasks/class.tx_linkvalidator_tasks_validatoradditionalfieldprovider.php";s:4:"7681";s:14:"doc/manual.sxw";s:4:"a197";s:14:"doc/manual.txt";s:4:"6862";s:54:"modfuncreport/class.tx_linkvalidator_modfuncreport.php";s:4:"6d84";s:27:"modfuncreport/locallang.xml";s:4:"de5c";s:31:"modfuncreport/locallang_csh.xml";s:4:"39e9";s:31:"modfuncreport/locallang_mod.xml";s:4:"e370";s:31:"modfuncreport/mod_template.html";s:4:"4c0f";s:21:"res/linkvalidator.css";s:4:"77b4";s:21:"res/mailtemplate.html";s:4:"c425";s:20:"res/pagetsconfig.txt";s:4:"93e0";}',
+       '_md5_values_when_last_written' => 'a:26:{s:9:"ChangeLog";s:4:"20d0";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:"6a5d";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:"cb67";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 b6dbff1..d85cc8e 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <T3locallang>
        <meta type="array">
-               <description>Labels for the linkvalidator task.</description>
+               <description>Labels for the Linkvalidator Task.</description>
                <type>module</type>
                <csh_table></csh_table>
                <labelContext type="array">
                <languageKey index="default" type="array">
                        <label index="mod_linkvalidator">Linkvalidator</label>
                        <label index="tasks.validate.name">Linkvalidator</label>
-                       <label index="tasks.validate.description">Search for broken links and store the result into the temporary table tx_linkvalidator_link in order to ease up the backend module.</label>
-                       <label index="tasks.validate.page">Start page (uid)</label>
+                       <label index="tasks.validate.description">Search for broken Links and store the Result into the temporary Table tx_linkvalidator_link in order to ease up the Backend Module.</label>
+                       <label index="tasks.validate.page">Start Page (uid)</label>
                        <label index="tasks.validate.depth">Depth</label>
                        <label index="tasks.validate.conf">Overwrite TSconfig</label>
-                       <label index="tasks.validate.email">Send email report to</label>
-                       <label index="tasks.validate.emailOnBrokenLinkOnly">Send email on new broken links only</label>
-                       <label index="tasks.validate.emailTemplateFile">Email template file</label>
-                       <label index="tasks.validate.invalidEmail">Invalid email format!</label>
-                       <label index="tasks.validate.invalidPage">Invalid page uid, please enter a valid page uid!</label>
-                       <label index="tasks.validate.invalidDepth">There is no depth set, please set it to one of the offered values!</label>
-                       <label index="tasks.error.noSubject">No subject for the notification email</label>
-                       <label index="tasks.error.invalidToEmail">Invalid format of one or more of the recipient email addresses!</label>
-                       <label index="tasks.error.invalidFromEmail">Invalid format of the email address in the from header</label>
-                       <label index="tasks.error.invalidTSconfig">Invalid TSconfig in the task configuration!</label>
-                       <label index="tasks.error.invalidEmailTemplateFile">The email template file is not existing!</label>
+                       <label index="tasks.validate.email">Send Email Report to</label>
+                       <label index="tasks.validate.emailOnBrokenLinkOnly">Send Email on new broken Links only</label>
+                       <label index="tasks.validate.emailTemplateFile">Email Template File</label>
+                       <label index="tasks.validate.invalidEmail">Invalid Email Format!</label>
+                       <label index="tasks.validate.invalidPage">Invalid Page uid, please enter a valid Page uid!</label>
+                       <label index="tasks.validate.invalidDepth">There is no Depth set, please set it to one of the Values offered!</label>
+                       <label index="tasks.error.noSubject">No Subject for the Notification Email</label>
+                       <label index="tasks.error.invalidToEmail">Invalid Format of one or more of the Recipient Email Addresses!</label>
+                       <label index="tasks.error.invalidFromEmail">Invalid Format of the Email Address in the From Header</label>
+                       <label index="tasks.error.invalidTSconfig">Invalid TSconfig in the Task Configuration!</label>
+                       <label index="tasks.error.invalidEmailTemplateFile">The Email Template File is not existing!</label>
                </languageKey>
        </data>
-</T3locallang>
+</T3locallang>
\ No newline at end of file
index 4792ae5..3942b77 100644 (file)
@@ -113,8 +113,8 @@ class tx_linkvalidator_ModFuncReport extends t3lib_extobjbase {
         * @var string
         */
        protected $checkOptHtml;
-       
-       
+
+
        /**
         * Html for the Statistics table with the checkboxes of the link types and the numbers of broken links for Check links tab.
         *
@@ -184,16 +184,35 @@ class tx_linkvalidator_ModFuncReport extends t3lib_extobjbase {
                $labels = tx_em_Tools::getArrayFromLocallang(t3lib_extMgm::extPath('linkvalidator', 'modfuncreport/locallang.xml'));
                $this->pageRenderer->addInlineLanguageLabelArray($labels);
 
+       $this->pageRenderer->addJsInlineCode('linkvalidator','function toggleActionButton(prefix) {
+                       var buttonDisable = true;
+                       Ext.select(\'.\' + prefix ,false).each(function(checkBox,i){
+                       checkDom = checkBox.dom;
+                       if(checkDom.checked){
+                               buttonDisable = false;
+                       }
+
+                       });
+                       if(prefix == \'check\'){
+                               checkSub = document.getElementById(\'updateLinkList\');
+                       }
+                       else{
+                               checkSub = document.getElementById(\'refreshLinkList\');
+                       }
+                       checkSub.disabled = buttonDisable;
+
+
+               }');
                        // Add JS
                $this->pageRenderer->addJsFile($this->doc->backPath . '../t3lib/js/extjs/ux/Ext.ux.FitToParent.js');
                $this->pageRenderer->addJsFile($this->doc->backPath . '../t3lib/js/extjs/ux/flashmessages.js');
                $this->pageRenderer->addJsFile($this->doc->backPath . 'js/extjs/iframepanel.js');
 
                if ($this->modTS['showCheckLinkTab'] == 1) {
-                       $this->updateListHtml = '<input type="submit" name="updateLinkList" value="' . $GLOBALS['LANG']->getLL('label_update') . '"/>';
+                       $this->updateListHtml = '<input type="submit" name="updateLinkList" id="updateLinkList" value="' . $GLOBALS['LANG']->getLL('label_update') . '"/>';
                }
 
-               $this->refreshListHtml = '<input type="submit" name="refreshLinkList" value="' . $GLOBALS['LANG']->getLL('label_refresh') . '"/>';
+               $this->refreshListHtml = '<input type="submit" name="refreshLinkList" id="refreshLinkList"  value="' . $GLOBALS['LANG']->getLL('label_refresh') . '"/>';
 
                $this->processor = t3lib_div::makeInstance('tx_linkvalidator_Processor');
                $this->updateBrokenLinks();
@@ -237,7 +256,8 @@ class tx_linkvalidator_ModFuncReport extends t3lib_extobjbase {
                        ' . $panelCheck . '
                        ]
 
-               });';
+               });
+               ';
                $this->pageRenderer->addExtOnReadyCode($js);
        }
 
@@ -569,7 +589,13 @@ class tx_linkvalidator_ModFuncReport extends t3lib_extobjbase {
         */
        protected function getCheckOptions(array $brokenLinkOverView, $prefix = '') {
                $markerArray = array();
-
+               $additionalAttr = '';
+               if(!empty($prefix)) {
+                       $additionalAttr = ' onclick="toggleActionButton(\'' . $prefix . '\');" class="' . $prefix . '" ';
+               }
+               else {
+                       $additionalAttr = ' onclick="toggleActionButton(\'refresh\');" class="refresh" ';
+               }
                $checkOptionsTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###CHECKOPTIONS_SECTION###');
 
                $hookSectionContent = '';
@@ -604,7 +630,7 @@ class tx_linkvalidator_ModFuncReport extends t3lib_extobjbase {
                                                }
                                                $translation = $GLOBALS['LANG']->getLL('hooks.' . $type);
                                                $translation = $translation ? $translation : $type;
-                                               $option =  '<input type="checkbox" id="' . $prefix . 'SET[' . $type . ']" name="' . $prefix . 'SET[' . $type . ']" value="1"' . ($this->pObj->MOD_SETTINGS[$type]  ? ' checked="checked"' : '') .
+                                               $option =  '<input type="checkbox" ' . $additionalAttr . '  id="' . $prefix . 'SET_' . $type . '" name="' . $prefix . 'SET[' . $type . ']" value="1"' . ($this->pObj->MOD_SETTINGS[$type]  ? ' checked="checked"' : '') .
                                                        '/>'.'<label for="' . $prefix . 'SET[' . $type . ']">' . htmlspecialchars( $translation ) . '</label>';
                                                $hookSectionMarker['option'] = $option;
                                                $hookSectionContent .= t3lib_parsehtml::substituteMarkerArray($hookSectionTemplate, $hookSectionMarker, '###|###', TRUE, TRUE);
index 5df9058..4412a81 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <T3locallang>
        <meta type="array">
-               <description>Labels for the linkvalidator Backend module.</description>
+               <description>Labels for the Linkvalidator Backend Module.</description>
                <type>module</type>
                <csh_table></csh_table>
                <labelContext type="array">
        <data type="array">
                <languageKey index="default" type="array">
                        <label index="menu.introduction">Introduction</label>
-                       <label index="menu.checkLinks">Check Links for validity</label>
-                       <label index="menu.overview">Overview of links on website</label>
-                       <label index="overview.header">Overview - choose options to check the links</label>
-                       <label index="overview.all.header">Total amounts in tt_content</label>
-                       <label index="overview.all.records">Records with ext. links:</label>
-                       <label index="overview.all.links">External links:</label>
-                       <label index="overview.branch.header">Amounts from actual branch in tt_content</label>
-                       <label index="overview.branch.records">Records with ext. links:</label>
-                       <label index="overview.branch.links">External links:</label>
+                       <label index="menu.checkLinks">Check Links for Validity</label>
+                       <label index="menu.overview">Overview of Links on Website</label>
+                       <label index="overview.header">Overview - Choose Options to check the Links</label>
+                       <label index="overview.all.header">Total Amounts in tt_content</label>
+                       <label index="overview.all.records">Records with ext. Links:</label>
+                       <label index="overview.all.links">External Links:</label>
+                       <label index="overview.branch.header">Amounts from actual Branch in tt_content</label>
+                       <label index="overview.branch.records">Records with ext. Links:</label>
+                       <label index="overview.branch.links">External Links:</label>
                        <label index="overview.attention.header">Attention:</label>
-                       <label index="overview.attention.text">Checking links may take up to several minutes. Checking ONE link can last up to 3 seconds.</label>
+                       <label index="overview.attention.text">Checking Links may take up to several Minutes. Checking ONE Link can last up to 3 Seconds.</label>
                        <label index="Report">Report</label>
                        <label index="CheckLink">Check Links</label>
-                       <label index="report.statistics.header">Show these types of broken links</label>
-                       <label index="checklinks.statistics.header">Check these types of broken links</label>
-                       <label index="report.func.title">Show this level</label>
-                       <label index="checklinks.func.title">Check this level</label>
-                       <label index="overviews.nbtotal">Broken links total:</label>
+                       <label index="report.statistics.header">Show these Types of broken Links</label>
+                       <label index="checklinks.statistics.header">Check these Types of broken Links</label>
+                       <label index="report.func.title">Show this Level</label>
+                       <label index="checklinks.func.title">Check this Level</label>
+                       <label index="overviews.nbtotal">Broken Links Total:</label>
                        <label index="hooks.db">Internal Links:</label>
                        <label index="hooks.file">File Links:</label>
                        <label index="hooks.external">External Links:</label>
                        <label index="hooks.linkhandler">Linkhandler Links:</label>
-                       <label index="label_refresh">Refresh display</label>
-                       <label index="label_update">Check links</label>
-                       <label index="list.header">Listing of broken links</label>
+                       <label index="label_refresh">Refresh Display</label>
+                       <label index="label_update">Check Links</label>
+                       <label index="list.header">Listing of broken Links</label>
                        <label index="list.tableHead.path">Path</label>
                        <label index="list.tableHead.element">Element</label>
                        <label index="list.tableHead.headlink">Link</label>
                        <label index="list.tableHead.linktarget">URL / Link Target</label>
-                       <label index="list.tableHead.linkmessage">Error message</label>
-                       <label index="list.tableHead.lastCheck">Last check</label>
-                       <label index="list.edit">Edit element containing this broken link</label>
+                       <label index="list.tableHead.linkmessage">Error Message</label>
+                       <label index="list.tableHead.lastCheck">Last Check</label>
+                       <label index="list.edit">Edit Element containing this broken Link</label>
                        <label index="list.field">(Field: %s)</label>
-                       <label index="list.no.headline">no headline</label>
+                       <label index="list.no.headline">no Headline</label>
                        <label index="list.report.pagedeleted">Page '###title###' (###uid###) is deleted.</label>
                        <label index="list.report.pagenotvisible">Page '###title###' (###uid###) is not visible.</label>
                        <label index="list.report.pagenotexisting">Page (###uid###) does not exist.</label>
-                       <label index="list.report.contentmoved">Element '###title###' (###uid###) is not located on page ###wrongpage###, but on page ###rightpage###.</label>
+                       <label index="list.report.contentmoved">Element '###title###' (###uid###) is not located on Page ###wrongpage###, but on Page ###rightpage###.</label>
                        <label index="list.report.contentdeleted">Element '###title###' (###uid###) is deleted.</label>
                        <label index="list.report.contentnotvisible">Element '###title###' (###uid###) is not visible.</label>
                        <label index="list.report.contentnotexisting">Element (###uid###) does not exist.</label>
-                       <label index="list.report.rowdeleted">###title### row (###uid###) is deleted.</label>
+                       <label index="list.report.rowdeleted">###title### Row (###uid###) is deleted.</label>
                        <label index="list.report.rowdeleted.default.title">Linked</label>
                        <label index="list.report.rownotexisting">Row (###uid###) does not exist.</label>
                        <label index="list.report.noresponse">External Link not reachable.</label>
-                       <label index="list.report.redirectloop">A redirect loop occurred. (%s: %s)</label>
-                       <label index="list.report.pageforbidden403">Accessing this address is not allowed (403).</label>
-                       <label index="list.report.pagenotfound404">The requested url was not found (404).</label>
-                       <label index="list.report.externalerror">External Link returned HTTP error code (%s).</label>
-                       <label index="list.report.filenotexisting">File doesn't exist.</label>
-                       <label index="list.report.timeout">Operation timeout. The specified time-out period was reached according to the conditions.</label>
+                       <label index="list.report.redirectloop">A Redirect Loop occurred. (%s: %s)</label>
+                       <label index="list.report.pageforbidden403">Accessing this Address is not allowed (403).</label>
+                       <label index="list.report.pagenotfound404">The requested URL was not found (404).</label>
+                       <label index="list.report.externalerror">External Link returned HTTP Error Code (%s).</label>
+                       <label index="list.report.filenotexisting">File does not exist.</label>
+                       <label index="list.report.timeout">Operation Timeout. The specified Time-Out Period was reached according to the Conditions.</label>
                        <label index="list.report.internalerror500">Internal Server Error (500)</label>
-                       <label index="list.report.couldnotresolvehost">Could not resolve host. The given remote host was not resolved.</label>
-                       <label index="list.report.errornetworkdata">Failure with receiving network data.</label>
+                       <label index="list.report.couldnotresolvehost">Could not resolve Host. The given Remote Host was not resolved.</label>
+                       <label index="list.report.errornetworkdata">Failure with receiving Network Data.</label>
                        <label index="list.msg.ok">Ok</label>
                        <label index="list.msg.lastRun">%1$s %2$s</label>
-                       <label index="list.no.broken.links.title">No broken links to show!</label>
-                       <label index="list.no.broken.links">There are no broken links to be displayed.</label>
-                       <label index="no.access.title">No access!</label>
-                       <label index="no.access">You do not have access to these listings.</label>
+                       <label index="list.no.broken.links.title">No broken Links to show!</label>
+                       <label index="list.no.broken.links">There are no broken Links to be displayed.</label>
+                       <label index="no.access.title">No Access!</label>
+                       <label index="no.access">You do not have Access to these Listings.</label>
                </languageKey>
        </data>
-</T3locallang>
+</T3locallang>
\ No newline at end of file
index 6aaa83e..4378de4 100644 (file)
@@ -1,31 +1,31 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <T3locallang>
        <meta type="array">
-               <description>CSH for linkvalidator labels</description>
+               <description>CSH for Linkvalidator Labels</description>
                <type>CSH</type>
                <csh_table>linkvalidator</csh_table>
        </meta>
        <data type="array">
                <languageKey index="default" type="array">
-                       <label index="checkboxes.description">Click the following checkboxes to consider or to ignore the corresponding broken links.</label>
-                       <label index="tablehead_path.description">Path to the content element, which contains the broken link.</label>
-                       <label index="tablehead_element.description">Type of the element containing the broken link, its headline and the field in which the broken link is located.</label>
-                       <label index="tablehead_headlink.description">The linking text.</label>
-                       <label index="tablehead_linktarget.description">URL to which the broken link is pointing.</label>
-                       <label index="tablehead_linkmessage.description">Status of that link.</label>
-                       <label index="tablehead_lastcheck.description">Date and time of the last update of the information in each table row.</label>
-                       <label index="task_page.alttitle">Start page of the task</label>
-                       <label index="task_page.description">UID of the start page for this task.</label>
-                       <label index="task_depth.alttitle">Depth of the task</label>
-                       <label index="task_depth.description">Level of pages the task should check.</label>
-                       <label index="task_configuration.alttitle">Special TSconfig code</label>
-                       <label index="task_configuration.description">TSconfig Code which defines settings for linkvalidator to be used for this task.</label>
-                       <label index="task_email.alttitle">Email address</label>
-                       <label index="task_email.description">Email address to which an email report is sent.</label>
-                       <label index="task_emailonbrokenlinkonly.alttitle">Mailing option</label>
-                       <label index="task_emailonbrokenlinkonly.description">Only send an email, if new broken links were found.</label>
-                       <label index="task_emailfile.alttitle">Email template file</label>
-                       <label index="task_emailfile.description">Define a template to be used for the email.</label>
+                       <label index="checkboxes.description">Click the following Checkboxes to consider or to ignore the corresponding broken Links.</label>
+                       <label index="tablehead_path.description">Path to the Content Element, which contains the broken Link.</label>
+                       <label index="tablehead_element.description">Type of the Element containing the broken Link, its Headline and the Field in which the broken Link is located.</label>
+                       <label index="tablehead_headlink.description">The linking Text.</label>
+                       <label index="tablehead_linktarget.description">URL to which the broken Link is pointing.</label>
+                       <label index="tablehead_linkmessage.description">Status of that Link.</label>
+                       <label index="tablehead_lastcheck.description">Date and Time of the last Update of the Information in each Table Row.</label>
+                       <label index="task_page.alttitle">Start Page of the Task</label>
+                       <label index="task_page.description">UID of the Start Page for this Task.</label>
+                       <label index="task_depth.alttitle">Depth of the Task</label>
+                       <label index="task_depth.description">Level of Pages the Task should check.</label>
+                       <label index="task_configuration.alttitle">Special TSconfig Code</label>
+                       <label index="task_configuration.description">TSconfig Code which defines Settings for Linkvalidator to be used for this Task.</label>
+                       <label index="task_email.alttitle">Email Address</label>
+                       <label index="task_email.description">Email Address to which an Email Report is sent.</label>
+                       <label index="task_emailonbrokenlinkonly.alttitle">Mailing Option</label>
+                       <label index="task_emailonbrokenlinkonly.description">Only send an Email, if new broken Links were found.</label>
+                       <label index="task_emailfile.alttitle">Email Template File</label>
+                       <label index="task_emailfile.description">Define a Template to be used for the Email.</label>
                </languageKey>
        </data>
 </T3locallang>
\ No newline at end of file
index 9631ef1..63bc7fa 100644 (file)
@@ -10,8 +10,8 @@
        <data type="array">
                <languageKey index="default" type="array">
                        <label index="mlang_tabs_tab">Check Links</label>
-                       <label index="mlang_labels_tabdescr">Checks the links in your website for validity.</label>
-                       <label index="mlang_labels_tablabel">Validates links</label>
+                       <label index="mlang_labels_tabdescr">Checks the Links in your Website for Validity.</label>
+                       <label index="mlang_labels_tablabel">Validates Links</label>
                </languageKey>
        </data>
-</T3locallang>
+</T3locallang>
\ No newline at end of file
index a56c21b..fe323c3 100644 (file)
@@ -6,7 +6,7 @@
 
 .linkvalidator_funcmenu {
        margin-bottom: 25px;
-       margin-left: 25px;
+       margin-left: 35px;
        margin-top: 0;
        float: left;
 }
@@ -29,7 +29,7 @@
        float: left;
        display: block;
        margin-top: 0px;
-       width: 225px;
+       width: 235px;
 }
 .linkvalidator_checkoptions div {
        float: left;
@@ -89,4 +89,8 @@
 #linkvalidator_statsTable td:first-child,
 #linkvalidator_brokenLinksTable td:first-child {
        border-left: none;
+}
+
+input#updateLinkList:disabled, input#refreshLinkList:disabled {
+       color: graytext;
 }
\ No newline at end of file
index 7875e01..09266e2 100644 (file)
@@ -8,8 +8,6 @@ mod.linkvalidator {
        checkhidden = 0
        showCheckLinkTab = 1
        mail {
-               fromname = Linkvalidator
-               fromemail = Linkvalidator@example.com
                replytoname =
                replytoemail =
                subject = TYPO3 Linkvalidator report