Merged Linkvalidator (tagged as 4.5RC1)
authorErnesto Baschny <ernst@cron-it.de>
Sat, 22 Jan 2011 01:18:21 +0000 (01:18 +0000)
committerErnesto Baschny <ernst@cron-it.de>
Sat, 22 Jan 2011 01:18:21 +0000 (01:18 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10238 709f56b5-9817-0410-a4d7-c38de5d9e867

39 files changed:
ChangeLog
typo3/sysext/linkvalidator/ChangeLog
typo3/sysext/linkvalidator/classes/class.tx_linkvalidator_processing.php [deleted file]
typo3/sysext/linkvalidator/classes/class.tx_linkvalidator_processor.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_abstract.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_external.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_file.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_interface.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_internal.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_linkhandler.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_abstract.php [deleted file]
typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_external.php [deleted file]
typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_file.php [deleted file]
typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_interface.php [deleted file]
typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_internal.php [deleted file]
typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_linkhandler.php [deleted file]
typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validate.php [deleted file]
typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validateadditionalfieldprovider.php [deleted file]
typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validator.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validatoradditionalfieldprovider.php [new file with mode: 0644]
typo3/sysext/linkvalidator/doc/manual.sxw
typo3/sysext/linkvalidator/doc/manual.txt
typo3/sysext/linkvalidator/ext_autoload.php
typo3/sysext/linkvalidator/ext_emconf.php
typo3/sysext/linkvalidator/ext_localconf.php
typo3/sysext/linkvalidator/ext_tables.php
typo3/sysext/linkvalidator/ext_tables.sql
typo3/sysext/linkvalidator/locallang.xml
typo3/sysext/linkvalidator/modfunc1/class.tx_linkvalidator_modfunc1.php [deleted file]
typo3/sysext/linkvalidator/modfunc1/locallang.xml [deleted file]
typo3/sysext/linkvalidator/modfunc1/locallang_csh.xml [deleted file]
typo3/sysext/linkvalidator/modfunc1/locallang_mod.xml [deleted file]
typo3/sysext/linkvalidator/modfunc1/mod_template.html [deleted file]
typo3/sysext/linkvalidator/modfuncreport/class.tx_linkvalidator_modfuncreport.php [new file with mode: 0644]
typo3/sysext/linkvalidator/modfuncreport/locallang.xml [new file with mode: 0644]
typo3/sysext/linkvalidator/modfuncreport/locallang_csh.xml [new file with mode: 0644]
typo3/sysext/linkvalidator/modfuncreport/locallang_mod.xml [new file with mode: 0644]
typo3/sysext/linkvalidator/modfuncreport/mod_template.html [new file with mode: 0644]
typo3/sysext/linkvalidator/res/pagetsconfig.txt

index e159e1c..1ac65cb 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
 
 2011-01-21  Ernesto Baschny  <ernst@cron-it.de>
 
+       * Merged Linkvalidator (tagged as 4.5RC1)
        * Reverted #13319: Removed Plupload integration and removed contrib/plupload
        * Fixed bug #17182: migrateWorkspaces in Install-Tool shows up even if nothing has to be done (Thanks to Tolleiv Nietsch)
        * Fixed bug #17184: Disable the CSRF protection in ExtDirect calls coming from the frontend (Thanks to Stefan Galinski)
index bd5c035..e38a4f8 100644 (file)
@@ -1,4 +1,58 @@
-2011-01-08  Christopher  <chrissitopher@gmx.de>
+2011-01-20  Christopher Stelmaszyk  <chrissitopher@gmx.de>
+
+       * Merged changes from mantis-#17176: Remove unnecessary comments and color profiles from all shipped .png / .gif files (Thanks to Steffen Gebert)
+
+2011-01-20  Michael Miousse  <michael.miousse@infoglobe.ca>
+
+       * Fixed bug #12432: Selected page metas are not processed
+       * Fixed bug #12431: Do not put labels into members
+       * Fixed bug #12429: Do not use private accessors
+       * Fixed bug #12428: Adapt Variable Names to naming conventions
+       * Fixed bug #12427: Rename draw*() methods to render*()
+       * Fixed bug #12426: Rename classes according to naming conventions
+       * Fixed bug #12425: Give modfunc1 a better name
+       * Fixed bug #12424: Only use the class name for the hook
+       * Fixed bug #12416: tx_linkvalidator_tasks_Validate: Missing public / protected declarations
+       * Fixed bug #12226: website that has multiple domainsrecords produces funny links
+       * Fixed bug #12414: OOP principle of data encapsulation violated in tx_linkvalidator_tasks_Validate
+       * Fixed bug #12385: Conflict scheduler:testtask with linkvalidator::task
+       * Fixed bug #12411: Fix Copyright Notices
+
+2011-01-20  Christopher Stelmaszyk  <chrissitopher@gmx.de>
+
+       * Fixed bug #12360: Show error message, if the module is not accessible for the current user
+       * Fixed bug #12412: XSS issue in tx_linkvalidator_tasks_ValidateAdditionalFieldProvider
+       * Fixed bug #12419: Use American English for "analyseRecord"
+       * Fixed bug #12420: Indentation in modfunc1, getTemplateMarkers()
+       * Fixed bug #12421: Rename tx_linkvalidator_links to tx_linkvalidator_link
+       * Fixed bug #12423: ext_tables.sql: Use underscores to separate words in field names
+       * Fixed bug #12422: ext_tables.sql: Do not use abbreviations for field names
+
+2011-01-19  Michael Miousse  <michael.miousse@infoglobe.ca>
+
+       * Added Feature #12340: Enhance the tx_linkvalidator_linkTypes_Interface (thanks to Ernesto Baschny and Christopher Stelmaszyk)
+       * Added Feature #12344: Migrate to t3lib_htmlmail to SwiftMailer (thanks to Ernesto Baschny and Christopher Stelmaszyk)
+       * Fixed bug #12377: Other link types than supported use the same type than the last found
+
+2011-01-18  Oliver Hader  <oliver.hader@typo3.org>
+
+       * Cleanup: Fixed PHPdoc comments and type hints in module, processing and abstract linktype class
+
+2011-01-17  Christopher Stelmaszyk  <chrissitopher@gmx.de>
+
+       * Fixed bug #10989: Anchors in internal links are incorrectly treated as pages (thanks to Michael Miousse)
+
+2011-01-17  Michael Miousse  <michael.miousse@infoglobe.ca>
+
+       * Fixed bug #12226: Website that has multiple domainsrecords produces funny links
+
+2011-01-15  Christopher Stelmaszyk  <chrissitopher@gmx.de>
+
+       * Fixed bug #12243: Information on storage location of broken links is wrong in text
+       * Fixed bug #12232: Redirects to https get reported as 404 (thanks to Andreas Lappe)
+       * Fixed bug #12235: Reporting errors does not work with cURL (thanks to Andreas Lappe)
+
+2011-01-08  Christopher Stelmaszyk  <chrissitopher@gmx.de>
 
        * Fixed bug #12019: Do not display the format of the date of the last check
        * Fixed bug #12026: Combine columns Type, Headline and Field
@@ -6,7 +60,7 @@
        * Fixed bug #12024: Remove cellspacing (thanks to Steffen Gebert)
        * Fixed bug #12025: Add link to scheduler
 
-2011-01-07  Christopher  <chrissitopher@gmx.de>
+2011-01-07  Christopher Stelmaszyk  <chrissitopher@gmx.de>
 
        * Followup to bug #11269: Proofread the manual
        * Followup to bug #11822: Add extension description in ext_emconf.php
@@ -17,7 +71,7 @@
 
        * Followup to bug #11794: If website root is active, searching for links does not work
 
-2011-01-06  Christopher  <chrissitopher@gmx.de>
+2011-01-06  Christopher Stelmaszyk  <chrissitopher@gmx.de>
 
        * Followup to bug #11836: Make use of Flash Messages
        * Fixed bug #11888: Button "Check Links" only checks those categories of links which are marked with the checkboxes below
 
        * Fixed bug #11794: If website root is active, searching for links does not work
 
-2011-01-05  Christopher  <chrissitopher@gmx.de>
+2011-01-05  Christopher Stelmaszyk  <chrissitopher@gmx.de>
 
        * Fixed bug #11797: linkvalidator saves translated texts in the database which is not good (thanks to Michael Miousse and Philipp Gampe)
        * Fixed bug #11802: Field linktitle often stays empty (thanks to Philipp Gampe)
        * Followup to bug #11776: URL/Linktarget for files is broken
 
-2011-01-04  Christopher  <chrissitopher@gmx.de>
+2011-01-04  Christopher Stelmaszyk  <chrissitopher@gmx.de>
 
        * Fixed bug #11889: Clean up CSS
 
-2011-01-03  Christopher  <chrissitopher@gmx.de>
+2011-01-03  Christopher Stelmaszyk  <chrissitopher@gmx.de>
 
        * Fixed bug #11866: When the edit pencil next to a link is clicked, you end up at tree root with search_levels=0 after saving
        * Followup to bug #10907: Invalid external url not detected (thanks to Philipp Gampe)
 
-2011-01-02  Christopher  <chrissitopher@gmx.de>
+2011-01-02  Christopher Stelmaszyk  <chrissitopher@gmx.de>
 
        * Fixed bug #11821: Do not use abbreviations in code
        * Fixed bug #11777: Add CSH to table headers
        * Fixed bug #11848: Use labels for the table fields containing the broken links
 
-2011-01-01  Christopher  <chrissitopher@gmx.de>
+2011-01-01  Christopher Stelmaszyk  <chrissitopher@gmx.de>
 
        * Fixed bug #11822: Add extension description in ext_emconf.php
        * Fixed bug #11820: Remove comments "End of function xy"
        * Fixed bug #11819: Prevent PHP notices by fixing XClass inclusion code
        * Fixed bug #11823: Add @package and @subpackage to comment blocks
 
-2010-12-31  Christopher  <chrissitopher@gmx.de>
+2010-12-31  Christopher Stelmaszyk  <chrissitopher@gmx.de>
 
        * Fixed bug #11776: URL/Linktarget for files is broken
        * Fixed bug #11800: Checkboxes showing the number of broken links do not display the value "zero"
        * Fixed bug #11812: Changing a checkbox from the statistics table resets the depth chosen for pages to check
        * Fixed bug #11814: Fix indentation in HTML templates, CSS files and SQL file
 
-2010-12-30  Christopher  <chrissitopher@gmx.de>
+2010-12-30  Christopher Stelmaszyk  <chrissitopher@gmx.de>
 
        * Fixed bug #11779: Unify usage of tooltips in table rows
        * Fixed bug #11775: Table should use new design for TYPO3 4.5
diff --git a/typo3/sysext/linkvalidator/classes/class.tx_linkvalidator_processing.php b/typo3/sysext/linkvalidator/classes/class.tx_linkvalidator_processing.php
deleted file mode 100644 (file)
index 6e6e718..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2005 - 2010 Michael Miousse (michael.miousse@infoglobe.ca)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * This class provides Processing plugin implementation.
- *
- * @author Michael Miousse <michael.miousse@infoglobe.ca>
- * @author Jochen Rieger <j.rieger@connecta.ag>
- * @package TYPO3
- * @subpackage linkvalidator
- */
-
-$GLOBALS['LANG']->includeLLFile('EXT:linkvalidator/modfunc1/locallang.xml');
-
-class tx_linkvalidator_processing {
-
-       protected $searchFields = array(); // array of tables and fields to search for broken links
-       protected $pidList = ''; // list of pidlist (rootline downwards)
-       protected $linkCounts = array(); // array of tables containing number of external link
-       protected $brokenLinkCounts = array(); // array of tables containing number of broken external link
-       protected $recordsWithBrokenLinks = array(); // array of tables and records containing broken links
-       protected $hookObjectsArr = array(); // array for hooks for own checks
-
-       /**
-        * Fill hookObjectsArr with different link types and possible XClasses.
-        */
-       function __construct() {
-                       // Hook to handle own checks
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $key => $classRef) {
-                               $this->hookObjectsArr[$key] = &t3lib_div::getUserObj($classRef);
-                       }
-               }
-       }
-
-       /**
-        * Init Function: Here all the needed configuration values are stored in class variables.
-        *
-        * @param       array           $searchField: list of fields in which to search for links
-        * @param       string          $pid: list of comma separated page uids in which to search for links
-        * @return      void
-        */
-       public function init($searchField, $pid) {
-               $this->searchFields = $searchField;
-               $this->pidList = $pid;
-       }
-
-       /**
-        * Find all supported broken links and store them in tx_linkvalidator_links.
-        *
-        * @param       array           $checkOptions: list of hook object to activate
-        * @param       int                     $hidden: defines whether to look into hidden fields or not
-        * @return      void
-        */
-       public function getLinkStatistics($checkOptions = array(), $hidden = 0) {
-               $results = array();
-               $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_linkvalidator_links', 'recpid in (' . $this->pidList . ')');
-
-                       // let's traverse all configured tables
-               foreach ($this->searchFields as $table => $fields) {
-                       $where = 'deleted = 0 AND pid IN (' . $this->pidList . ')';
-                       if (!$hidden) {
-                               $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->analyseRecord($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['recpid'] = $entryValue['row']['pid'];
-                                       $record['recuid'] = $entryValue['uid'];
-                                       $record['tablename'] = $table;
-                                       $record['linktitle'] = $entryValue['linktitle'];
-                                       $record['field'] = $entryValue['field'];
-                                       $record['lastcheck'] = time();
-                                       $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['typelinks'] = $key;
-                                               $record['url'] = $url;
-                                               $record['urlresponse'] = serialize($response);
-                                               $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_linkvalidator_links', $record);
-                                       } elseif (t3lib_div::_GP('showalllinks')) {
-                                               $response = array();
-                                               $response['valid'] = TRUE;
-                                               $this->brokenLinkCounts[$table]++;
-                                               $record['url'] = $url;
-                                               $record['typelinks'] = $key;
-                                               $record['urlresponse'] = serialize($response);
-                                               $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_linkvalidator_links', $record);
-                                       }
-                               }
-                       }
-               }
-       }
-
-
-       /**
-        * Find all supported broken links for a specific record.
-        *
-        * @param       array           $results: array of broken links
-        * @param       string          $table: table name of the record
-        * @param       array           $fields: array of fields to analyze
-        * @param       array           $record: record to analyse
-        * @return      void
-        */
-       public function analyseRecord(&$results, $table, $fields, $record) {
-               
-                       // array to store urls from relevant field contents
-               $urls = array();
-
-                       // 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
-                               $softRefs = t3lib_BEfunc::explodeSoftRefParserList($conf['softref']);
-                                       // Traverse soft references
-                               foreach ($softRefs as $spKey => $spParams) {
-                                               // create / get object
-                                       $softRefObj = &t3lib_BEfunc::softRefParserObj($spKey);
-
-                                               // If there was an object returned...:
-                                       if (is_object($softRefObj)) {
-                                                       // Do processing
-                                               $resultArray = $softRefObj->findRef($table, $field, $idRecord, $valueField, $spKey, $spParams);
-                                               if (!empty($resultArray['elements'])) {
-
-                                                       if ($spKey == 'typolink_tag') {
-                                                               $linkTags = $htmlParser->splitIntoBlock('link', $resultArray['content']);
-                                                       }
-
-                                                       foreach ($resultArray['elements'] as $element) {
-                                                               $r = $element['subst'];
-
-                                                               $title = '';
-                                                               $type = '';
-
-                                                               if (!empty($r)) {
-                                                                               // Parse string for special TYPO3 <link> tag:
-                                                                       if ($spKey == 'typolink_tag') {
-                                                                               foreach ($linkTags as $textPart) {
-                                                                                       if (substr_count($textPart, $r['tokenID'])) {
-                                                                                               $title = strip_tags($textPart);
-                                                                                       }
-                                                                               }
-                                                                       }
-
-                                                                       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;
-                                                                       $results[$type][$table . ':' . $field . ':' . $idRecord . ':' . $r["tokenID"]]["linktitle"] = $title;
-                                                               }
-
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               }       
-       }
-
-
-       /**
-        * Fill a markerarray with the number of links found in a list of pages.
-        *
-        * @param   string         $curPage: comma separated list of page uids
-        * @return  array          markerarray with the number of links found
-        */
-       public function getLinkCounts($curPage) {
-               $markerArray = array();
-               if (($res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                               'count(uid) as nbBrokenLinks,typelinks',
-                               'tx_linkvalidator_links',
-                               'recpid in (' . $this->pidList . ')',
-                               'typelinks'
-               ))) {
-                       while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
-                               $markerArray[$row['typelinks']] = $row['nbBrokenLinks'];
-                               $markerArray['brokenlinkCount'] += $row['nbBrokenLinks'];
-                       }
-               }
-               return $markerArray;
-       }
-       
-       /**
-        * Calls t3lib_tsfeBeUserAuth::extGetTreeList.
-        * Although this duplicates the function t3lib_tsfeBeUserAuth::extGetTreeList
-        * this is necessary to create the object that is used recursively by the original function.
-        *
-        * Generates a list of page uids from $id. List does not include $id itself.
-        * The only pages excluded from the list are deleted pages.
-        *
-        *                                                        level in the tree to start collecting uids. Zero means
-        *                                                        'start right away', 1 = 'next level and out'
-        *
-        * @param       integer         Start page id
-        * @param       integer         Depth to traverse down the page tree.
-        * @param       integer         $begin is an optional integer that determines at which
-        * @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, $perms_clause) {
-               $depth = intval($depth);
-               $begin = intval($begin);
-               $id = intval($id);
-               $theList = '';
-
-               if ($depth > 0) {
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                               'uid,title',
-                               'pages',
-                               'pid=' . $id . ' AND deleted=0 AND ' . $perms_clause
-                       );
-                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                               if ($begin <= 0) {
-                                       $theList .= $row['uid'] . ',';
-                                       $this->extPageInTreeInfo[] = array($row['uid'], htmlspecialchars($row['title'], $depth));
-                               }
-                               if ($depth > 1) {
-                                       $theList .= $this->extGetTreeList($row['uid'], $depth - 1, $begin - 1, $perms_clause);
-                               }
-                       }
-               }
-               return $theList;
-       }
-       
-
-}
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/class.tx_linkvalidator_processing.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/class.tx_linkvalidator_processing.php']);
-}
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/classes/class.tx_linkvalidator_processor.php b/typo3/sysext/linkvalidator/classes/class.tx_linkvalidator_processor.php
new file mode 100644 (file)
index 0000000..9353781
--- /dev/null
@@ -0,0 +1,392 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2010 - 2011 Michael Miousse (michael.miousse@infoglobe.ca)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * This class provides Processing plugin implementation.
+ *
+ * @author Michael Miousse <michael.miousse@infoglobe.ca>
+ * @author Jochen Rieger <j.rieger@connecta.ag>
+ * @package TYPO3
+ * @subpackage linkvalidator
+ */
+
+$GLOBALS['LANG']->includeLLFile('EXT:linkvalidator/modfuncreport/locallang.xml');
+
+class tx_linkvalidator_Processor {
+
+       /**
+        * Array of tables and fields to search for broken links.
+        *
+        * @var array
+        */
+       protected $searchFields = array();
+
+       /**
+        * List of comma seperated page uids (rootline downwards).
+        *
+        * @var string
+        */
+       protected $pidList = '';
+
+       /**
+        * Array of tables and the number of external links they contain.
+        *
+        * @var array
+        */
+       protected $linkCounts = array();
+
+       /**
+        * Array of tables and the number of broken external links they contain.
+        *
+        * @var array
+        */
+       protected $brokenLinkCounts = array();
+
+       /**
+        * Array of tables and records containing broken links.
+        *
+        * @var array
+        */
+       protected $recordsWithBrokenLinks = array();
+
+       /**
+        * Array for hooks for own checks.
+        *
+        * @var array
+        */
+       protected $hookObjectsArr = array();
+
+       /**
+        * Array with information about the current page.
+        *
+        * @var array
+        */
+       protected $extPageInTreeInfo = array();
+
+       /**
+        * Fill hookObjectsArr with different link types and possible XClasses.
+        */
+       public function __construct() {
+                       // Hook to handle own checks
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $key => $classRef) {
+                               $this->hookObjectsArr[$key] = &t3lib_div::getUserObj($classRef);
+                       }
+               }
+       }
+
+       /**
+        * Init Function: Here all the needed configuration values are stored in class variables.
+        *
+        * @param       array           $searchField: list of fields in which to search for links
+        * @param       string          $pid: list of comma separated page uids in which to search for links
+        * @return      void
+        */
+       public function init($searchField, $pid) {
+               $this->searchFields = $searchField;
+               $this->pidList = $pid;
+       }
+
+       /**
+        * Find all supported broken links and store them in tx_linkvalidator_link.
+        *
+        * @param       array           $checkOptions: list of hook object to activate
+        * @param       boolean         $considerHidden: defines whether to look into hidden fields or not
+        * @return      void
+        */
+       public function getLinkStatistics($checkOptions = array(), $considerHidden = FALSE) {
+               $results = array();
+               $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_linkvalidator_link', 'record_pid in (' . $this->pidList . ') or ( record_uid IN (' . $this->pidList . ') and table_name like \'pages\')');
+
+                       // 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'];
+                                       }
+
+                                       $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);
+                                       }
+                               }
+                       }
+               }
+       }
+
+
+       /**
+        * Find all supported broken links for a specific record.
+        *
+        * @param       array           $results: array of broken links
+        * @param       string          $table: table name of the record
+        * @param       array           $fields: array of fields to analyze
+        * @param       array           $record: record to analyse
+        * @return      void
+        */
+       public function analyzeRecord(&$results, $table, $fields, $record) {
+               
+                       // array to store urls from relevant field contents
+               $urls = array();
+
+               $referencedRecordType = '';
+                       // last-parsed link element was a page.
+               $wasPage = TRUE;
+
+                       // 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
+                               $softRefs = t3lib_BEfunc::explodeSoftRefParserList($conf['softref']);
+                                       // Traverse soft references
+                               foreach ($softRefs as $spKey => $spParams) {
+                                               // create / get object
+                                       $softRefObj = &t3lib_BEfunc::softRefParserObj($spKey);
+
+                                               // If there was an object returned...:
+                                       if (is_object($softRefObj)) {
+
+                                                       // Do processing
+                                               $resultArray = $softRefObj->findRef($table, $field, $idRecord, $valueField, $spKey, $spParams);
+                                               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;
+
+                                                               }
+                                                       } 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;
+
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+
+       /**
+        * Fill a markerarray with the number of links found in a list of pages.
+        *
+        * @param   string         $curPage: comma separated list of page uids
+        * @return  array          markerarray with the number of links found
+        */
+       public function getLinkCounts($curPage) {
+               $markerArray = array();
+               if (($res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                               'count(uid) as nbBrokenLinks,link_type',
+                               'tx_linkvalidator_link',
+                               'record_pid in (' . $this->pidList . ')',
+                               'link_type'
+               ))) {
+                       while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
+                               $markerArray[$row['link_type']] = $row['nbBrokenLinks'];
+                               $markerArray['brokenlinkCount'] += $row['nbBrokenLinks'];
+                       }
+               }
+               return $markerArray;
+       }
+       
+       /**
+        * Calls t3lib_tsfeBeUserAuth::extGetTreeList.
+        * Although this duplicates the function t3lib_tsfeBeUserAuth::extGetTreeList
+        * this is necessary to create the object that is used recursively by the original function.
+        *
+        * Generates a list of page uids from $id. List does not include $id itself.
+        * The only pages excluded from the list are deleted pages.
+        *
+        *                                                        level in the tree to start collecting uids. Zero means
+        *                                                        'start right away', 1 = 'next level and out'
+        *
+        * @param       integer         Start page id
+        * @param       integer         Depth to traverse down the page tree.
+        * @param       integer         $begin is an optional integer that determines at which
+        * @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) {
+               $depth = intval($depth);
+               $begin = intval($begin);
+               $id = intval($id);
+               $theList = '';
+
+               if ($depth > 0) {
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                               'uid,title',
+                               'pages',
+                               'pid=' . $id . ' AND deleted=0 AND ' . $permsClause
+                       );
+                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                               if ($begin <= 0) {
+                                       $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);
+                               }
+                       }
+               }
+               return $theList;
+       }
+       
+
+}
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/class.tx_linkvalidator_processor.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/class.tx_linkvalidator_processor.php']);
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_abstract.php b/typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_abstract.php
new file mode 100644 (file)
index 0000000..e45d361
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2010 - 2011 Michael Miousse (michael.miousse@infoglobe.ca)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * This class provides Check Base plugin implementation.
+ *
+ * @author Michael Miousse <michael.miousse@infoglobe.ca>
+ * @package TYPO3
+ * @subpackage linkvalidator
+ */
+abstract class tx_linkvalidator_linktype_Abstract implements tx_linkvalidator_linktype_Interface {
+
+       /**
+        * Contains parameters needed for the rendering of the error message
+        *
+        * @var array
+        */
+       protected $errorParams = array();
+
+       /**
+        * Base type fetching method, based on the type that softRefParserObj returns.
+        *
+        * @param   array        $value: reference properties
+        * @param   string       $type: current type
+        * @param   string       $key: validator hook name
+        * @return  string       fetched type
+        */
+       public function fetchType($value, $type, $key) {
+               if ($value['type'] == $key) {
+                       $type = $value['type'];
+               }
+               return $type;
+       }
+
+       /**
+        * Set the value of the private property errorParams.
+        *
+        * @param  array      all parameters needed for the rendering of the error message
+        * @return void
+        */
+       protected function setErrorParams(array $value) {
+               $this->errorParams = $value;
+       }
+
+       /**
+        * Get the value of the private property errorParams.
+        *
+        * @return  array      all parameters needed for the rendering of the error message
+        */
+       public function getErrorParams() {
+               return $this->errorParams;
+       }
+
+       /**
+        * Base url parsing
+        *
+        * @param       array           $row: broken link record
+        * @return      string          parsed broken url
+        */
+       public function getBrokenUrl($row) {
+               return $row['url'];
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_external.php b/typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_external.php
new file mode 100644 (file)
index 0000000..c16c844
--- /dev/null
@@ -0,0 +1,220 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2010 - 2009 Jochen Rieger (j.rieger@connecta.ag) 
+ *  (c) 2010 - 2011 Michael Miousse (michael.miousse@infoglobe.ca)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+/**
+ * This class provides Check External Links plugin implementation.
+ *
+ * @author Dimitri König <dk@cabag.ch>
+ * @author Michael Miousse <michael.miousse@infoglobe.ca>
+ * @package TYPO3
+ * @subpackage linkvalidator
+ */
+class tx_linkvalidator_linktype_External extends tx_linkvalidator_linktype_Abstract {
+
+       /**
+        * Cached list of the URLs, which were already checked for the current processing.
+        *
+        * @var array
+        */
+       protected $urlReports = array();
+
+       /**
+        * Cached list of all error parameters of the URLs, which were already checked for the current processing.
+        *
+        * @var array
+        */
+       protected $urlErrorParams = array();
+
+       /**
+        * Checks a given URL + /path/filename.ext for validity
+        *
+        * @param       string          $url: url to check
+        * @param        array     $softRefEntry: the softref entry which builds the context of that url
+        * @param       object          $reference:  parent instance of tx_linkvalidator_Processor
+        * @return      string          TRUE on success or FALSE on error
+        */
+       public function checkLink($url, $softRefEntry, $reference) {
+               $errorParams = array();
+               if (isset($this->urlReports[$url])) {
+                       if(!$this->urlReports[$url]) {
+                               if(is_array($this->urlErrorParams[$url])) {
+                                   $this->setErrorParams($this->urlErrorParams[$url]);
+                               }
+                       }
+                       return $this->urlReports[$url];
+               }
+
+                       // remove possible anchor from the url
+               if (strrpos($url, '#') !== FALSE) {
+                       $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);
+
+               $tries = 0;
+               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);
+                               }
+                               $tries++;
+               }
+
+               $response = TRUE;
+
+                       // analyze the response
+               if ($report['error']) {
+                               // More cURL error codes can be found here:
+                               // http://curl.haxx.se/libcurl/c/libcurl-errors.html
+                       if ($report['lib'] === 'cURL' && $report['error'] === 28) {
+                               $errorParams['errorType'] = 'cURL28';
+                       } elseif ($report['lib'] === 'cURL' && $report['error'] === 22) {
+                               if (strstr($report['message'], '404')) {
+                                       $errorParams['errorType'] = 404;
+                               } elseif(strstr($report['message'], '403')) {
+                                       $errorParams['errorType'] = 403;
+                               } elseif(strstr($report['message'], '500')) {
+                                       $errorParams['errorType'] = 500;
+                               }
+                       } elseif ($report['lib'] === 'cURL' && $report['error'] === 6) {
+                               $errorParams['errorType'] = 'cURL6';
+                       } elseif ($report['lib'] === 'cURL' && $report['error'] === 56) {
+                               $errorParams['errorType'] = 'cURL56';
+                       }
+
+                       $response = FALSE;
+               }
+
+
+                       // special handling for more information
+               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];
+                               $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;
+               }
+
+               if(!$response) {
+                       $this->setErrorParams($errorParams);
+               }
+
+               $this->urlReports[$url] = $response;
+               $this->urlErrorParams[$url] = $errorParams;
+
+               return $response;
+       }
+
+       /**
+        * 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
+        */
+       public function getErrorMessage($errorParams) {
+               $errorType = $errorParams['errorType'];
+               switch ($errorType) {
+                       case 300:
+                               $response = sprintf($GLOBALS['LANG']->getLL('list.report.externalerror'), $errorType);
+                               break;
+
+                       case 301:
+                       case 302:
+                       case 303:
+                       case 307:
+                               $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 500:
+                               $response = $GLOBALS['LANG']->getLL('list.report.internalerror500');
+                               break;
+
+                       case 'cURL6':
+                               $response = $GLOBALS['LANG']->getLL('list.report.couldnotresolvehost');
+                               break;
+
+                       case 'cURL28':
+                               $response = $GLOBALS['LANG']->getLL('list.report.timeout');
+                               break;
+
+                       case 'cURL56':
+                               $response = $GLOBALS['LANG']->getLL('list.report.errornetworkdata');
+                               break;
+
+                       default:
+                               $response = $GLOBALS['LANG']->getLL('list.report.noresponse');
+               }
+
+               return $response;
+       }
+
+       /**
+        * get the external type from the softRefParserObj result.
+        *
+        * @param   array         $value: reference properties
+        * @param   string       $type: current type
+        * @param   string       $key: validator hook name
+        * @return  string       fetched type
+        */
+       public function fetchType($value, $type, $key) {
+               preg_match_all('/((?:http|https|ftp|ftps))(?::\/\/)(?:[^\s<>]+)/i', $value['tokenValue'], $urls, PREG_PATTERN_ORDER);
+
+               if (!empty($urls[0][0])) {
+                       $type = "external";
+               }
+
+               return $type;
+       }
+
+}
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_external.php'])) {
+       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
diff --git a/typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_file.php b/typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_file.php
new file mode 100644 (file)
index 0000000..9bc3928
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2005 - 2010 Jochen Rieger (j.rieger@connecta.ag) 
+ *  (c) 2010 - 2011 Michael Miousse (michael.miousse@infoglobe.ca)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+/**
+ * This class provides Check File Links plugin implementation.
+ *
+ * @author Dimitri König <dk@cabag.ch>
+ * @author Michael Miousse <michael.miousse@infoglobe.ca>
+ * @package TYPO3
+ * @subpackage linkvalidator
+ */
+class tx_linkvalidator_linktype_File extends tx_linkvalidator_linktype_Abstract {
+
+       /**
+        * Checks a given URL + /path/filename.ext for validity.
+        *
+        * @param   string        $url: url to check
+        * @param        array     $softRefEntry: the softref entry which builds the context of that url
+        * @param   object        $reference:  parent instance of tx_linkvalidator_Processor
+        * @return  string        TRUE on success or FALSE on error
+        */
+       public function checkLink($url, $softRefEntry, $reference) {
+               if (!@file_exists(PATH_site . rawurldecode($url))) {
+                       return FALSE;
+               }
+
+               return TRUE;
+       }
+
+       /**
+        * 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
+        */
+       public function getErrorMessage($errorParams) {
+               $response = $GLOBALS['LANG']->getLL('list.report.filenotexisting');
+               return $response;
+       }
+
+
+       /**
+        * Url parsing
+        *
+        * @param   array          $row: broken link record
+        * @return  string        parsed broken url
+        */
+       public function getBrokenUrl($row) {
+               $brokenUrl = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . $row['url'];
+               return $brokenUrl;
+       }
+}
+
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_file.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_file.php']);
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_interface.php b/typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_interface.php
new file mode 100644 (file)
index 0000000..ee3128d
--- /dev/null
@@ -0,0 +1,71 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2010 - 2011 Michael Miousse (michael.miousse@infoglobe.ca)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * This class provides interface implementation.
+ *
+ * @author Michael Miousse <michael.miousse@infoglobe.ca>
+ * @package TYPO3
+ * @subpackage linkvalidator
+ */
+interface tx_linkvalidator_linktype_Interface {
+
+       /**
+        * Checks a given URL + /path/filename.ext for validity
+        *
+        * @param   string        $url: url to check
+        * @param        array     $softRefEntry: the softref entry which builds the context of that url
+        * @param   object        $reference:  parent instance of tx_linkvalidator_Processor
+        * @return  string        validation error message or succes code
+        */
+       public function checkLink($url, $softRefEntry, $reference);
+
+       /**
+        * Base type fetching method, based on the type that softRefParserObj returns.
+        *
+        * @param   array        $value: reference properties
+        * @param   string       $type: current type
+        * @param   string       $key: validator hook name
+        * @return  string       fetched type
+        */
+       public function fetchType($value, $type, $key);
+
+       /**
+        * Get the value of the private property errorParams.
+        *
+        * @return  array      all parameters needed for the rendering of the error message
+        */
+       public function getErrorParams();
+
+       /**
+        * Base url parsing
+        *
+        * @param       array           $row: broken link record
+        * @return      string          parsed broken url
+        */
+       public function getBrokenUrl($row);
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_internal.php b/typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_internal.php
new file mode 100644 (file)
index 0000000..93ff21c
--- /dev/null
@@ -0,0 +1,303 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2005 - 2010 Jochen Rieger (j.rieger@connecta.ag) 
+ *  (c) 2010 - 2011 Michael Miousse (michael.miousse@infoglobe.ca)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+/**
+ * This class provides Check Internal Links plugin implementation.
+ *
+ * @author Dimitri König <dk@cabag.ch>
+ * @author Michael Miousse <michael.miousse@infoglobe.ca>
+ * @package TYPO3
+ * @subpackage linkvalidator
+ */
+class tx_linkvalidator_linktype_Internal extends tx_linkvalidator_linktype_Abstract {
+
+       const DELETED = 'deleted';
+       const HIDDEN = 'hidden';
+       const MOVED = 'moved';
+       const NOTEXISTING = 'notExisting';
+
+       /**
+        * All parameters needed for rendering the error message.
+        *
+        * @var array
+        */
+       protected $errorParams = array();
+
+       /**
+        * Result of the check, if the current page uid is valid or not.
+        *
+        * @var boolean
+        */
+       protected $responsePage = TRUE;
+
+       /**
+        * Result of the check, if the current content uid is valid or not.
+        *
+        * @var boolean
+        */
+       protected $responseContent = TRUE;
+
+       /**
+        * Checks a given URL + /path/filename.ext for validity
+        *
+        * @param   string        $url: url to check as page-id or page-id#anchor (if anchor is present)
+        * @param        array    $softRefEntry: the softref entry which builds the context of that url
+        * @param   object        $reference:  parent instance of tx_linkvalidator_Processor
+        * @return  string        TRUE on success or FALSE on error
+        */
+       public function checkLink($url, $softRefEntry, $reference) {
+               $page = '';
+               $anchor = '';
+               $response = TRUE;
+               $this->responseContent = TRUE;
+
+                       // Might already contain values - empty it.
+               unset($this->errorParams);
+
+                       // defines the linked page and anchor (if any).
+               if (strpos($url, '#c') !== FALSE) {
+                       $parts = explode('#c', $url);
+                       $page = $parts[0];
+                       $anchor = $parts[1];
+               } else {
+                       $page = $url;
+               }
+
+                       // Check if the linked page is OK.
+               $this->responsePage = $this->checkPage($page, $softRefEntry, $reference);
+
+                       // Check if the linked content element is OK.
+               if ($anchor) {
+
+                               // Check if the content element is OK.
+                       $this->responseContent = $this->checkContent($page, $anchor, $softRefEntry, $reference);
+
+               }
+
+               if ((is_array($this->errorParams['page']) && !$this->responsePage)
+                       || (is_array($this->errorParams['content']) && !$this->responseContent)) {
+                       $this->setErrorParams($this->errorParams);
+               }
+
+               if (($this->responsePage === TRUE) && ($this->responseContent === TRUE)) {
+                       $response = TRUE;
+               } else {
+                       $response = FALSE;
+               }
+
+               return $response;
+       }
+
+       /**
+        * Checks a given page uid for validity
+        *
+        * @param   string        $page: page uid to check
+        * @param        array    $softRefEntry: the softref entry which builds the context of that url
+        * @param   object        $reference:  parent instance of tx_linkvalidator_Processor
+        * @return  string        TRUE on success or FALSE on error
+        */
+       protected function checkPage($page, $softRefEntry, $reference) {
+               $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                       'uid, title, deleted, hidden, starttime, endtime',
+                       'pages',
+                       'uid = ' . intval($page)
+               );
+               $this->responsePage = TRUE;
+
+               if ($rows[0]) {
+                       if ($rows[0]['deleted'] == '1') {
+                               $this->errorParams['errorType']['page'] = DELETED;
+                               $this->errorParams['page']['title'] = $rows[0]['title'];
+                               $this->errorParams['page']['uid'] = $rows[0]['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'])) {
+                               $this->errorParams['errorType']['page'] = HIDDEN;
+                               $this->errorParams['page']['title'] = $rows[0]['title'];
+                               $this->errorParams['page']['uid'] = $rows[0]['uid'];
+                               $this->responsePage = FALSE;
+                       }
+               } else {
+                       $this->errorParams['errorType']['page'] = NOTEXISTING;
+                       $this->errorParams['page']['uid'] = intval($page);
+                       $this->responsePage = FALSE;
+               }
+
+               return $this->responsePage;
+       }
+
+       /**
+        * Checks a given content uid for validity
+        *
+        * @param   string    $page: uid of the page to which the link is pointing
+        * @param   string        $anchor: uid of the content element to check
+        * @param        array    $softRefEntry: the softref entry which builds the context of that url
+        * @param   object        $reference:  parent instance of tx_linkvalidator_Processor
+        * @return  string        TRUE on success or FALSE on error
+        */
+       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(
+                       'uid, pid, header, deleted, hidden, starttime, endtime',
+                       'tt_content',
+                       'uid = ' . intval($anchor)
+               );
+               $this->responseContent = TRUE;
+
+                       // this content element exists
+               if ($res[0]) {
+                               // page ID on which this CE is in fact located.
+                       $correctPageID = $res[0]['pid'];
+
+                               // check if the element is on the linked page
+                               // (the element might have been moved to another page)
+                       if (!($correctPageID === $page)) {
+                               $this->errorParams['errorType']['content'] = MOVED;
+                               $this->errorParams['content']['uid'] = intval($anchor);
+                               $this->errorParams['content']['wrongPage'] = intval($page);
+                               $this->errorParams['content']['rightPage'] = intval($correctPageID);
+                               $this->responseContent = FALSE;
+
+                       } else {
+                                       // the element is located on the page to which the link is pointing
+                               if ($res[0]['deleted'] == '1') {
+                                       $this->errorParams['errorType']['content'] = DELETED;
+                                       $this->errorParams['content']['title'] = $res[0]['header'];
+                                       $this->errorParams['content']['uid'] = $res[0]['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'])) {
+                                       $this->errorParams['errorType']['content'] = HIDDEN;
+                                       $this->errorParams['content']['title'] = $res[0]['header'];
+                                       $this->errorParams['content']['uid'] = $res[0]['uid'];
+                                       $this->responseContent = FALSE;
+                               }
+                       }
+
+               } else {
+                               // content element does not exist
+                       $this->errorParams['errorType']['content'] = NOTEXISTING;
+                       $this->errorParams['content']['uid'] = intval($anchor);
+                       $this->responseContent = FALSE;
+               }
+
+               return $this->responseContent;
+       }
+
+       /**
+        * 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
+        */
+       public function getErrorMessage($errorParams) {
+               $errorType = $errorParams['errorType'];
+
+               if (is_array($errorParams['page'])) {
+                       switch ($errorType['page']) {
+                               case DELETED:
+                                       $errorPage = $GLOBALS['LANG']->getLL('list.report.pagedeleted');
+                                       $errorPage = str_replace('###title###', $errorParams['page']['title'], $errorPage);
+                                       $errorPage = str_replace('###uid###', $errorParams['page']['uid'], $errorPage);
+                                       break;
+
+                               case HIDDEN:
+                                       $errorPage = $GLOBALS['LANG']->getLL('list.report.pagenotvisible');
+                                       $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);
+                       }
+               }
+
+               if (is_array($errorParams['content'])) {
+                       switch ($errorType['content']) {
+                               case DELETED:
+                                       $errorContent = $GLOBALS['LANG']->getLL('list.report.contentdeleted');
+                                       $errorContent = str_replace('###title###', $errorParams['content']['title'], $errorContent);
+                                       $errorContent = str_replace('###uid###', $errorParams['content']['uid'], $errorContent);
+                                       break;
+
+                               case HIDDEN:
+                                       $errorContent = $GLOBALS['LANG']->getLL('list.report.contentnotvisible');
+                                       $errorContent = str_replace('###title###', $errorParams['content']['title'], $errorContent);
+                                       $errorContent = str_replace('###uid###', $errorParams['content']['uid'], $errorContent);
+                                       break;
+
+                               case MOVED:
+                                       $errorContent = $GLOBALS['LANG']->getLL('list.report.contentmoved');
+                                       $errorContent = str_replace('###title###', $errorParams['content']['title'], $errorContent);
+                                       $errorContent = str_replace('###uid###', $errorParams['content']['uid'], $errorContent);
+                                       $errorContent = str_replace('###wrongpage###', $errorParams['content']['wrongPage'], $errorContent);
+                                       $errorContent = str_replace('###rightpage###', $errorParams['content']['rightPage'], $errorContent);
+                                       break;
+
+                               default:
+                                       $errorContent = $GLOBALS['LANG']->getLL('list.report.contentnotexisting');
+                                       $errorContent = str_replace('###uid###', $errorParams['content']['uid'], $errorContent);
+                       }
+               }
+
+               if ($errorPage && $errorContent) {
+                       $response = $errorPage . '<br />' . $errorContent;
+               } elseif ($errorPage) {
+                       $response = $errorPage;
+               } elseif ($errorContent) {
+                       $response = $errorContent; 
+               }
+
+               return $response;
+       }
+
+       /**
+        * Url parsing
+        *
+        * @param   array          $row: broken link record
+        * @return  string        parsed broken url
+        */
+       public function getBrokenUrl($row) {
+               $domain = rtrim(t3lib_div::getIndpEnv('TYPO3_SITE_URL'), '/');
+               $rootLine = t3lib_BEfunc::BEgetRootLine($row['record_pid']);
+                       // checks alternate domains
+               if (count($rootLine) > 0) {
+                               $protocol = t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://';
+                               $domainRecord = t3lib_BEfunc::firstDomainRecord($rootLine);
+                               if(!empty($domainRecord)) {
+                                       $domain = $protocol . $domainRecord;
+                               }
+               }
+               return $domain . '/index.php?id=' . $row['url'];
+       }
+}
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_internal.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_internal.php']);
+}
+
+?>
diff --git a/typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_linkhandler.php b/typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_linkhandler.php
new file mode 100644 (file)
index 0000000..25f8081
--- /dev/null
@@ -0,0 +1,145 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2005 - 2010 Jochen Rieger (j.rieger@connecta.ag) 
+ *  (c) 2010 - 2011 Michael Miousse (michael.miousse@infoglobe.ca)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+/**
+ * This class provides Check Link Handler plugin implementation.
+ *
+ * @author Dimitri König <dk@cabag.ch>
+ * @author Michael Miousse <michael.miousse@infoglobe.ca>
+ * @package TYPO3
+ * @subpackage linkvalidator
+ */
+class tx_linkvalidator_linktype_LinkHandler extends tx_linkvalidator_linktype_Abstract {
+
+       const DELETED = 'deleted';
+
+       /**
+        * TSconfig of the module tx_linkhandler.
+        *
+        * @var array
+        */
+       protected $tsconfig;
+
+       /**
+        * Get TSconfig when loading the class.
+        */
+       function __construct() {
+               $this->tsconfig = t3lib_BEfunc::getModTSconfig(1, 'mod.tx_linkhandler');
+       }
+
+       /**
+        * Checks a given URL + /path/filename.ext for validity
+        *
+        * @param   string        $url: url to check
+        * @param        array     $softRefEntry: the softref entry which builds the context of that url
+        * @param   object        $reference:  parent instance of tx_linkvalidator_Processor
+        * @return  string        TRUE on success or FALSE on error
+        */
+       public function checkLink($url, $softRefEntry, $reference) {
+               $response = TRUE;
+               $errorParams = array();
+               $parts = explode(":", $url);
+               if (count($parts) == 3) {
+                       $tableName = htmlspecialchars($parts[1]);
+                       $rowid = intval($parts[2]);
+                       $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                               '*',
+                               $tableName,
+                               'uid = ' . intval($rowid)
+                       );
+
+                       if ($rows[0]) {
+                               if ($rows[0]['deleted'] == '1') {
+                                       $errorParams['errorType'] = DELETED;
+                                       $errorParams['tablename'] = $tableName;
+                                       $errorParams['uid'] = $rowid;
+                                       $response =  FALSE;
+                               }
+                       } else {
+                               $errorParams['tablename'] = $tableName;
+                               $errorParams['uid'] = $rowid;
+                               $response =  FALSE;
+                       }
+               }
+
+               if(!$response) {
+                       $this->setErrorParams();
+               }
+
+               return $response;
+       }
+
+       /**
+        * type fetching method, based on the type that softRefParserObj returns.
+        *
+        * @param   array         $value: reference properties
+        * @param   string       $type: current type
+        * @param   string       $key: validator hook name
+        * @return  string       fetched type
+        */
+       public function fetchType($value, $type, $key) {
+               if ($type == 'string' && strtolower(substr($value['tokenValue'], 0, 7)) == 'record:') {
+                       $type = 'linkhandler';
+               }
+               return $type;
+       }
+
+       /**
+        * 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
+        */
+       public function getErrorMessage($errorParams) {
+               $errorType = $errorParams['errorType'];
+               $tableName = $errorParams['tablename'];
+               $title = $GLOBALS['LANG']->getLL('list.report.rowdeleted.default.title');
+
+               if ($this->tsconfig['properties'][$tableName . '.']) {
+                       $title = $this->tsconfig['properties'][$tableName . '.']['label'];
+               }
+
+               switch ($errorType) {
+                       case DELETED:
+                               $response = $GLOBALS['LANG']->getLL('list.report.rowdeleted');
+                               $response = str_replace('###title###', $title, $response);
+                               $response = str_replace('###uid###', $errorParams['uid'], $response);
+                               break;
+
+                       default:
+                               $response = $GLOBALS['LANG']->getLL('list.report.rownotexisting');
+                               $response = str_replace('###uid###', $errorParams['uid'], $response);
+                               break;
+               }
+
+               return $response;
+       }
+}
+
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_linkhandler.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_linkhandler.php']);
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_abstract.php b/typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_abstract.php
deleted file mode 100644 (file)
index eb8352c..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2005 - 2010 Michael Miousse (michael.miousse@infoglobe.ca)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * This class provides Check Base plugin implementation.
- *
- * @author Michael Miousse <michael.miousse@infoglobe.ca>
- * @package TYPO3
- * @subpackage linkvalidator
- */
-abstract class tx_linkvalidator_linkTypes_Abstract {
-
-       private $errorParams = array(); // array      all parameters needed for the rendering of the error message
-
-       /**
-        * Base type fetching method, based on the type that softRefParserObj returns.
-        *
-        * @param   array        $value: reference properties
-        * @param   string       $type: current type
-        * @param   string       $key: validator hook name
-        * @return  string       fetched type
-        */
-       public function fetchType($value, $type, $key) {
-               if ($value['type'] == $key) {
-                       $type = $value['type'];
-               }
-               return $type;
-       }
-
-       /**
-        * Set the value of the private property errorParams.
-        *
-        * @param  array      all parameters needed for the rendering of the error message
-        */
-       public function setErrorParams(array $value) {
-               $this->errorParams = $value;
-       }
-
-       /**
-        * Get the value of the private property errorParams.
-        *
-        * @return  array      all parameters needed for the rendering of the error message
-        */
-       public function getErrorParams() {
-               return $this->errorParams;
-       }
-
-       /**
-        * Base url parsing
-        *
-        * @param       array           $row: broken link record
-        * @return      string          parsed broken url
-        */
-       public function getBrokenUrl($row) {
-               return $row['url'];
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_external.php b/typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_external.php
deleted file mode 100644 (file)
index 4a6e235..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2005 - 2010 Michael Miousse (michael.miousse@infoglobe.ca)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/**
- * This class provides Check External Links plugin implementation.
- *
- * @author Dimitri König <dk@cabag.ch>
- * @author Michael Miousse <michael.miousse@infoglobe.ca>
- * @package TYPO3
- * @subpackage linkvalidator
- */
-class tx_linkvalidator_linkTypes_External extends tx_linkvalidator_linkTypes_Abstract implements tx_linkvalidator_linkTypes_Interface {
-
-       var $url_reports = array();
-       var $url_error_params = array();
-
-       /**
-        * Checks a given URL + /path/filename.ext for validity
-        *
-        * @param       string          $url: url to check
-        * @param        array     $softRefEntry: the softref entry which builds the context of that url
-        * @param       object          $reference:  parent instance of tx_linkvalidator_processing
-        * @return      string          TRUE on success or FALSE on error
-        */
-       public function checkLink($url, $softRefEntry, $reference) {
-               $errorParams = array();
-               if (isset($this->url_reports[$url])) {
-                       if(!$this->url_reports[$url]) {
-                               if(is_array($this->url_error_params[$url])) {
-                                   $this->setErrorParams($this->url_error_params[$url]);
-                               }
-                       }
-                       return $this->url_reports[$url];
-               }
-
-                       // remove possible anchor from the url
-               if (strrpos($url, '#') !== FALSE) {
-                       $url = substr($url, 0, strrpos($url, '#'));
-               }
-
-                       // try to fetch the content of the URL (headers only)
-               $report = array();
-
-                   // get the header
-        $content = '';
-        $content = t3lib_div::getURL($url, 2, FALSE, $report);
-
-               $tries = 0;
-               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);
-                               }
-                               $tries++;
-               }
-
-               $response = TRUE;
-
-                       // analyze the response
-               if ($report['error']) {
-                       $response = FALSE;
-               }
-
-
-                       // special handling for more information
-               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];
-                               $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;
-               }
-
-               if(!$response) {
-                       $this->setErrorParams($errorParams);
-               }
-
-               $this->url_reports[$url] = $response;
-               $this->url_error_params[$url] = $errorParams;
-
-               return $response;
-       }
-
-       /**
-        * 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
-        */
-       public function getErrorMessage($errorParams) {
-               $errorType = $errorParams['errorType'];
-               switch ($errorType) {
-                       case 300:
-                               $response = sprintf($GLOBALS['LANG']->getLL('list.report.externalerror'), $errorType);
-                               break;
-
-                       case 301:
-                       case 302:
-                       case 303:
-                       case 307:
-                               $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;
-
-                       default:
-                               $response = $GLOBALS['LANG']->getLL('list.report.noresponse');
-               }
-
-               return $response;
-       }
-
-       /**
-        * get the external type from the softRefParserObj result.
-        *
-        * @param   array         $value: reference properties
-        * @param   string       $type: current type
-        * @return      string          fetched type
-        */
-       public function fetchType($value, $type) {
-               preg_match_all('/((?:http|https|ftp|ftps))(?::\/\/)(?:[^\s<>]+)/i', $value['tokenValue'], $urls, PREG_PATTERN_ORDER);
-
-               if (!empty($urls[0][0])) {
-                       $type = "external";
-               }
-
-               return $type;
-       }
-
-}
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_external.php'])) {
-       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
diff --git a/typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_file.php b/typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_file.php
deleted file mode 100644 (file)
index 9fb7b52..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2005 - 2010 Michael Miousse (michael.miousse@infoglobe.ca)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/**
- * This class provides Check File Links plugin implementation.
- *
- * @author Dimitri König <dk@cabag.ch>
- * @author Michael Miousse <michael.miousse@infoglobe.ca>
- * @package TYPO3
- * @subpackage linkvalidator
- */
-class tx_linkvalidator_linkTypes_File extends tx_linkvalidator_linkTypes_Abstract implements tx_linkvalidator_linkTypes_Interface {
-
-       /**
-        * Checks a given URL + /path/filename.ext for validity.
-        *
-        * @param   string        $url: url to check
-        * @param        array     $softRefEntry: the softref entry which builds the context of that url
-        * @param   object        $reference:  parent instance of tx_linkvalidator_processing
-        * @return  string        TRUE on success or FALSE on error
-        */
-       public function checkLink($url, $softRefEntry, $reference) {
-               if (!@file_exists(PATH_site . rawurldecode($url))) {
-                       return FALSE;
-               }
-
-               return TRUE;
-       }
-
-       /**
-        * 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
-        */
-       public function getErrorMessage($errorParams) {
-               $response = $GLOBALS['LANG']->getLL('list.report.filenotexisting');
-               return $response;
-       }
-
-
-       /**
-        * Url parsing
-        *
-        * @param   array          $row: broken link record
-        * @return  string        parsed broken url
-        */
-       public function getBrokenUrl($row) {
-               $brokenUrl = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . $row['url'];
-               return $brokenUrl;
-       }
-}
-
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_file.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_file.php']);
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_interface.php b/typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_interface.php
deleted file mode 100644 (file)
index 77fa133..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2005 - 2010 Michael Miousse (michael.miousse@infoglobe.ca)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * This class provides interface implementation.
- *
- * @author Michael Miousse <michael.miousse@infoglobe.ca>
- * @package TYPO3
- * @subpackage linkvalidator
- */
-interface tx_linkvalidator_linkTypes_Interface {
-
-       /**
-        * Checks a given URL + /path/filename.ext for validity
-        *
-        * @param   string        $url: url to check
-        * @param        array     $softRefEntry: the softref entry which builds the context of that url
-        * @param   object        $reference:  parent instance of tx_linkvalidator_processing
-        * @return  string        validation error message or succes code
-        */
-       public function checkLink($url, $softRefEntry, $reference);
-
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_internal.php b/typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_internal.php
deleted file mode 100644 (file)
index b3c01a7..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2005 - 2010 Michael Miousse (michael.miousse@infoglobe.ca)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/**
- * This class provides Check Internal Links plugin implementation.
- *
- * @author Dimitri König <dk@cabag.ch>
- * @author Michael Miousse <michael.miousse@infoglobe.ca>
- * @package TYPO3
- * @subpackage linkvalidator
- */
-class tx_linkvalidator_linkTypes_Internal extends tx_linkvalidator_linkTypes_Abstract implements tx_linkvalidator_linkTypes_Interface {
-
-       const DELETED = 'deleted';
-       const HIDDEN = 'hidden';
-
-       /**
-        * Checks a given URL + /path/filename.ext for validity
-        *
-        * @param   string        $url: url to check
-        * @param        array     $softRefEntry: the softref entry which builds the context of that url
-        * @param   object        $reference:  parent instance of tx_linkvalidator_processing
-        * @return  string        TRUE on success or FALSE on error
-        */
-       public function checkLink($url, $softRefEntry, $reference) {
-               $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
-                       'uid, title, deleted, hidden, starttime, endtime',
-                       'pages',
-                       'uid = ' . intval($url)
-               );
-
-               $response = TRUE;
-               $errorParams = array();
-               if ($rows[0]) {
-                       if ($rows[0]['deleted'] == '1') {
-                               $errorParams['errorType'] = DELETED;
-                               $errorParams['title'] = $rows[0]['title'];
-                               $errorParams['uid'] = $rows[0]['uid'];
-                               $response = FALSE;
-                       } elseif ($rows[0]['hidden'] == '1'
-                               || $GLOBALS['EXEC_TIME'] < intval($rows[0]['starttime'])
-                               || ($rows[0]['endtime'] && intval($rows[0]['endtime']) < $GLOBALS['EXEC_TIME'])) {
-                               $errorParams['errorType'] = HIDDEN;
-                               $errorParams['title'] = $rows[0]['title'];
-                               $errorParams['uid'] = $rows[0]['uid'];
-                               $response = FALSE;
-                       }
-               } else {
-                       $errorParams['errorType'] = 'notExisting';
-                       $errorParams['uid'] = intval($url);
-                       $response = FALSE;
-               }
-
-               if (is_array($errorParams) && !$response) {
-                       $this->setErrorParams($errorParams);
-               }
-
-               return $response;
-       }
-
-       /**
-        * 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
-        */
-       public function getErrorMessage($errorParams) {
-               $errorType = $errorParams['errorType'];
-               switch ($errorType) {
-                       case DELETED:
-                               $response = $GLOBALS['LANG']->getLL('list.report.pagedeleted');
-                               $response = str_replace('###title###', $errorParams['title'], $response);
-                               $response = str_replace('###uid###', $errorParams['uid'], $response);
-                               break;
-
-                       case HIDDEN:
-                               $response = $GLOBALS['LANG']->getLL('list.report.pagenotvisible');
-                               $response = str_replace('###title###', $errorParams['title'], $response);
-                               $response = str_replace('###uid###', $errorParams['uid'], $response);
-                               break;
-            
-                       default:
-                               $response = $GLOBALS['LANG']->getLL('list.report.pagenotexisting');
-                               $response = str_replace('###uid###', $errorParams['uid'], $response);
-                               break;
-               }
-
-               return $response;
-       }
-
-       /**
-        * Url parsing
-        *
-        * @param   array          $row: broken link record
-        * @return  string        parsed broken url
-        */
-       public function getBrokenUrl($row) {
-               $domain = t3lib_BEfunc::getViewDomain($row['pid']);
-               return $domain . '/index.php?id=' . $row['url'];
-       }
-}
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_internal.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_internal.php']);
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_linkhandler.php b/typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_linkhandler.php
deleted file mode 100644 (file)
index 786cc09..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2005 - 2010 Michael Miousse (michael.miousse@infoglobe.ca)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/**
- * This class provides Check Link Handler plugin implementation.
- *
- * @author Dimitri König <dk@cabag.ch>
- * @author Michael Miousse <michael.miousse@infoglobe.ca>
- * @package TYPO3
- * @subpackage linkvalidator
- */
-class tx_linkvalidator_linkTypes_LinkHandler extends tx_linkvalidator_linkTypes_Abstract implements tx_linkvalidator_linkTypes_Interface {
-
-       public $tsconfig;
-       const DELETED = 'deleted';
-
-       /**
-        * Get TsConfig on loading of the class
-        */
-       function __construct() {
-               $this->tsconfig = t3lib_BEfunc::getModTSconfig(1, 'mod.tx_linkhandler');
-       }
-
-       /**
-        * Checks a given URL + /path/filename.ext for validity
-        *
-        * @param   string        $url: url to check
-        * @param        array     $softRefEntry: the softref entry which builds the context of that url
-        * @param   object        $reference:  parent instance of tx_linkvalidator_processing
-        * @return  string        TRUE on success or FALSE on error
-        */
-       public function checkLink($url, $softRefEntry, $reference) {
-               $response = TRUE;
-               $errorParams = array();
-               $parts = explode(":", $url);
-               if (count($parts) == 3) {
-                       $tablename = htmlspecialchars($parts[1]);
-                       $rowid = intval($parts[2]);
-                       $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
-                               '*',
-                               $tablename,
-                               'uid = ' . intval($rowid)
-                       );
-
-                       if ($rows[0]) {
-                               if ($rows[0]['deleted'] == '1') {
-                                       $errorParams['errorType'] = DELETED;
-                                       $errorParams['tablename'] = $tablename;
-                                       $errorParams['uid'] = $rowid;
-                                       $response =  FALSE;
-                               }
-                       } else {
-                               $errorParams['tablename'] = $tablename;
-                               $errorParams['uid'] = $rowid;
-                               $response =  FALSE;
-                       }
-               }
-
-               if(!$response) {
-                       $this->setErrorParams();
-               }
-
-               return $response;
-       }
-
-       /**
-        * type fetching method, based on the type that softRefParserObj returns.
-        *
-        * @param   array         $value: reference properties
-        * @param   string       $type: current type
-        * @return  string       fetched type
-        */
-       public function fetchType($value, $type) {
-               if ($type == 'string' && strtolower(substr($value['tokenValue'], 0, 7)) == 'record:') {
-                       $type = 'linkhandler';
-               }
-               return $type;
-       }
-
-       /**
-        * 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
-        */
-       public function getErrorMessage($errorParams) {
-               $errorType = $errorParams['errorType'];
-               $tablename = $errorParams['tablename'];
-               $title = $GLOBALS['LANG']->getLL('list.report.rowdeleted.default.title');
-
-               if ($this->tsconfig['properties'][$tablename . '.']) {
-                       $title = $this->tsconfig['properties'][$tablename . '.']['label'];
-               }
-
-               switch ($errorType) {
-                       case DELETED:
-                               $response = $GLOBALS['LANG']->getLL('list.report.rowdeleted');
-                               $response = str_replace('###title###', $title, $response);
-                               $response = str_replace('###uid###', $errorParams['uid'], $response);
-                               break;
-
-                       default:
-                               $response = $GLOBALS['LANG']->getLL('list.report.rownotexisting');
-                               $response = str_replace('###uid###', $errorParams['uid'], $response);
-                               break;
-               }
-
-               return $response;
-       }
-}
-
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_linkhandler.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_linkhandler.php']);
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validate.php b/typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validate.php
deleted file mode 100644 (file)
index dd23bb2..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2005 - 2010 Michael Miousse (michael.miousse@infoglobe.ca)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * This class provides Scheduler plugin implementation.
- *
- * @author Michael Miousse <michael.miousse@infoglobe.ca>
- * @package TYPO3
- * @subpackage linkvalidator
- */
-class tx_linkvalidator_tasks_Validate extends tx_scheduler_Task {
-
-       /**
-        * @var integer
-        */
-       public $sleepTime;
-
-       /**
-        * @var integer
-        */
-       public $sleepAfterFinish;
-
-       /**
-        * @var integer
-        */
-       public $countInARun;
-
-       /**
-        * @var integer
-        */
-       public $totalBrokenLink = 0;
-
-       /**
-        * @var integer
-        */
-       public $oldTotalBrokenLink = 0;
-
-
-       /**
-        * Function executed from the Scheduler.
-        *
-        * @return      void
-        */
-       public function execute() {
-               $this->setCliArguments();
-
-               $file = t3lib_div::getFileAbsFileName($this->emailfile);
-               $htmlFile = t3lib_div::getURL($file);
-               $this->templateMail = t3lib_parsehtml::getSubpart($htmlFile, '###REPORT_TEMPLATE###');
-
-                       // The array to put the content into
-               $html = array();
-               $pageSections = '';
-               $this->dif = FALSE;
-               $pageList = t3lib_div::trimExplode(',', $this->page, 1);
-               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);
-                               $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;
-                                                       }
-                                               }
-                                       }
-                               }
-                               $processing = t3lib_div::makeInstance('tx_linkvalidator_processing');
-                               $pageIds = $processing->extGetTreeList($page, $this->depth, 0, '1=1');
-                               $pageIds .= $page;
-                               $processing->init($searchFields, $pageIds);
-                               if (!empty($this->email)) {
-                                       $oldLinkCounts = $processing->getLinkCounts($page);
-                                       $this->oldTotalBrokenLink += $oldLinkCounts['brokenlinkCount'];
-                               }
-
-                               $processing->getLinkStatistics($array, $modTS['checkhidden']);
-
-                               if (!empty($this->email)) {
-                                       $linkCounts = $processing->getLinkCounts($page);
-                                       $this->totalBrokenLink += $linkCounts['brokenlinkCount'];
-                                       $pageSections .= $this->buildMail($page, $pageIds, $linkCounts, $oldLinkCounts);
-                               }
-
-                       }
-               }
-               if ($this->totalBrokenLink != $this->oldTotalBrokenLink) {
-                       $this->dif = TRUE;
-               }
-               if ($this->totalBrokenLink > 0
-                       && (!$this->emailonbrokenlinkonly || $this->dif)
-                       && !empty($this->email)
-               ) {
-                       $this->reportEmail($pageSections, $modTS);
-               }
-               return TRUE;
-       }
-
-
-       /**
-        * Build and send warning email when new broken links were found.
-        *
-        * @param       string          $pageSections: Content of page section
-        * @param       string          $modTS: TSconfig array
-        * @return      bool            Mail sent or not
-        */
-       function reportEmail($pageSections, $modTS) {
-               $content = t3lib_parsehtml::substituteSubpart($this->templateMail, '###PAGE_SECTION###', $pageSections);
-               $markerArray = array();
-               $markerArray['totalBrokenLink'] = $this->totalBrokenLink;
-               $markerArray['totalBrokenLink_old'] = $this->oldTotalBrokenLink;
-               $content = t3lib_parsehtml::substituteMarkerArray($content, $markerArray, '###|###', TRUE, TRUE);
-
-               $Typo3_htmlmail = t3lib_div::makeInstance('t3lib_htmlmail');
-               $Typo3_htmlmail->start();
-               $Typo3_htmlmail->useBase64();
-
-               $convObj = t3lib_div::makeInstance('t3lib_cs');
-
-               $charset = $convObj->parse_charset($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] ? $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] : 'utf-8');
-               $Typo3_htmlmail->subject = $convObj->conv($modTS['mail.']['subject'], $charset, $modTS['mail.']['encoding'], 0);
-               $Typo3_htmlmail->from_email = $modTS['mail.']['fromemail'];
-               $Typo3_htmlmail->from_name = $modTS['mail.']['fromname'];
-               $Typo3_htmlmail->replyto_email = $modTS['mail.']['replytoemail'];
-               $Typo3_htmlmail->replyto_name = $modTS['mail.']['replytoname'];
-
-               //$Typo3_htmlmail->addPlain($mcontent);
-               $Typo3_htmlmail->setHTML($Typo3_htmlmail->encodeMsg($convObj->conv($content, $charset, $modTS['mail.']['encoding'], 0)));
-
-               $Typo3_htmlmail->setHeaders();
-               $Typo3_htmlmail->setContent();
-               $Typo3_htmlmail->setRecipient($this->email);
-
-               return $Typo3_htmlmail->sendtheMail();
-       }
-
-
-       /**
-        * Build the mail content.
-        *
-        * @param       int                     $curPage: id of the current page
-        * @param       string          $pageList: list of pages id
-        * @param       array           $markerArray: array of markers
-        * @param       array           $oldBrokenLink: markerarray with the number of link found
-        * @return      string          Content of the mail
-        */
-       function buildMail($curPage, $pageList, $markerArray, $oldBrokenLink) {
-               $pageSectionHTML = t3lib_parsehtml::getSubpart($this->templateMail, '###PAGE_SECTION###');
-
-               if (is_array($markerArray)) {
-                       foreach ($markerArray as $markerKey => $markerValue) {
-                               if (empty($oldBrokenLink[$markerKey])) {
-                                       $oldBrokenLink[$markerKey] = 0;
-                               }
-                               if ($markerValue != $oldBrokenLink[$markerKey]) {
-                                       $this->dif = TRUE;
-                               }
-                               $markerArray[$markerKey . '_old'] = $oldBrokenLink[$markerKey];
-                       }
-               }
-               $markerArray['title'] = t3lib_BEfunc::getRecordTitle('pages', t3lib_BEfunc::getRecord('pages', $curPage));
-
-               $content = '';
-               if ($markerArray['brokenlinkCount'] > 0) {
-                       $content = t3lib_parsehtml::substituteMarkerArray($pageSectionHTML, $markerArray, '###|###', TRUE, TRUE);
-               }
-               return $content;
-       }
-
-
-       /**
-        * Simulate cli call with setting the required options to the $_SERVER['argv']
-        *
-        * @return      void
-        * @access protected
-        */
-       protected function setCliArguments() {
-               $_SERVER['argv'] = array(
-                       $_SERVER['argv'][0],
-                       'tx_link_scheduler_link',
-                       '0',
-                       '-ss',
-                       '--sleepTime',
-                       $this->sleepTime,
-                       '--sleepAfterFinish',
-                       $this->sleepAfterFinish,
-                       '--countInARun',
-                       $this->countInARun
-               );
-       }
-}
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validate.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validate.php']);
-}
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validateadditionalfieldprovider.php b/typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validateadditionalfieldprovider.php
deleted file mode 100644 (file)
index 6fc6165..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2005 - 2010 Michael Miousse (michael.miousse@infoglobe.ca)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/**
- * This class provides Scheduler Additional Field plugin implementation.
- *
- * @author Dimitri König <dk@cabag.ch>
- * @author Michael Miousse <michael.miousse@infoglobe.ca>
- * @package TYPO3
- * @subpackage linkvalidator
- */
-class tx_linkvalidator_tasks_ValidateAdditionalFieldProvider implements tx_scheduler_AdditionalFieldProvider {
-
-       /**
-        * Render additional information fields within the scheduler backend.
-        *
-        * @param       array           $taksInfo: array information of task to return
-        * @param       task            $task: task object
-        * @param       tx_scheduler_Module             $schedulerModule: reference to the calling object (BE module of the Scheduler)
-        * @return      array           additional fields
-        * @see interfaces/tx_scheduler_AdditionalFieldProvider#getAdditionalFields($taskInfo, $task, $schedulerModule)
-        */
-       public function getAdditionalFields(array &$taskInfo, $task, tx_scheduler_Module $schedulerModule) {
-               $additionalFields = array();
-               if (empty($taskInfo['configuration'])) {
-                       if ($schedulerModule->CMD == 'add') {
-                               $taskInfo['configuration'] = '';
-                       } elseif ($schedulerModule->CMD == 'edit') {
-                               $taskInfo['configuration'] = $task->configuration;
-                       } else {
-                               $taskInfo['configuration'] = $task->configuration;
-                       }
-               }
-
-               if (empty($taskInfo['depth'])) {
-                       if ($schedulerModule->CMD == 'add') {
-                               $taskInfo['depth'] = array();
-                       } elseif ($schedulerModule->CMD == 'edit') {
-                               $taskInfo['depth'] = $task->depth;
-                       } else {
-                               $taskInfo['depth'] = $task->depth;
-                       }
-               }
-
-               if (empty($taskInfo['page'])) {
-                       if ($schedulerModule->CMD == 'add') {
-                               $taskInfo['page'] = '';
-                       } elseif ($schedulerModule->CMD == 'edit') {
-                               $taskInfo['page'] = $task->page;
-                       } else {
-                               $taskInfo['page'] = $task->page;
-                       }
-               }
-               if (empty($taskInfo['email'])) {
-                       if ($schedulerModule->CMD == 'add') {
-                               $taskInfo['email'] = '';
-                       } elseif ($schedulerModule->CMD == 'edit') {
-                               $taskInfo['email'] = $task->email;
-                       } else {
-                               $taskInfo['email'] = $task->email;
-                       }
-               }
-
-               if (empty($taskInfo['emailonbrokenlinkonly'])) {
-                       if ($schedulerModule->CMD == 'add') {
-                               $taskInfo['emailonbrokenlinkonly'] = 1;
-                               $task->emailonbrokenlinkonly = 1;
-                       } elseif ($schedulerModule->CMD == 'edit') {
-                               $taskInfo['emailonbrokenlinkonly'] = $task->emailonbrokenlinkonly;
-                       } else {
-                               $taskInfo['emailonbrokenlinkonly'] = $task->emailonbrokenlinkonly;
-                       }
-               }
-               if (empty($taskInfo['emailfile'])) {
-                       if ($schedulerModule->CMD == 'add') {
-                               $taskInfo['emailfile'] = 'EXT:linkvalidator/res/mailtemplate.html';
-                       } elseif ($schedulerModule->CMD == 'edit') {
-                               $taskInfo['emailfile'] = $task->emailfile;
-                       } else {
-                               $taskInfo['emailfile'] = $task->emailfile;
-                       }
-               }
-
-
-               $fieldID = 'task_page';
-               $fieldCode = '<input type="text" name="tx_scheduler[page]"  id="' . $fieldID . '" value="' . $taskInfo['page'] . '"/>';
-               $label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.page');
-               $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
-               $additionalFields[$fieldID] = array(
-                       'code' => $fieldCode,
-                       'label' => $label
-               );
-
-                       // input for depth
-               $fieldID = 'task_depth';
-               $fieldValueArray = array(
-                       '0' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_0'),
-                       '1' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_1'),
-                       '2' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_2'),
-                       '3' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_3'),
-                       '4' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_4'),
-                       '999' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_infi'),
-               );
-               $fieldCode = '<select name="tx_scheduler[depth]" id="' . $fieldID . '">';
-
-               foreach ($fieldValueArray as $depth => $label) {
-                       $fieldCode .= "\t" . '<option value="' . $depth . '"' . (($depth == $taskInfo['depth']) ? ' selected="selected"' : '') . '>' . $label . '</option>';
-               }
-
-               $fieldCode .= '</select>';
-               $label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.depth');
-               $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
-               $additionalFields[$fieldID] = array(
-                       'code' => $fieldCode,
-                       'label' => $label
-               );
-
-               $fieldID = 'task_configuration';
-               $fieldCode = '<textarea  name="tx_scheduler[configuration]" id="' . $fieldID . '" >' . $taskInfo['configuration'] . '</textarea>';
-               $label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.conf');
-               $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
-               $additionalFields[$fieldID] = array(
-                       'code' => $fieldCode,
-                       'label' => $label
-               );
-
-               $fieldID = 'task_email';
-               $fieldCode = '<input type="text"  name="tx_scheduler[email]" id="' . $fieldID . '" value="' . $taskInfo['email'] . '" />';
-               $label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.email');
-               $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
-               $additionalFields[$fieldID] = array(
-                       'code' => $fieldCode,
-                       'label' => $label
-               );
-               $fieldID = 'task_emailonbrokenlinkonly';
-               $fieldCode = '<input type="checkbox"  name="tx_scheduler[emailonbrokenlinkonly]" id="' . $fieldID . '" ' . ($taskInfo['emailonbrokenlinkonly'] ? 'checked="checked"' : '') . ' />';
-               $label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.emailonbrokenlinkonly');
-               $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
-               $additionalFields[$fieldID] = array(
-                       'code' => $fieldCode,
-                       'label' => $label
-               );
-
-               $fieldID = 'task_emailfile';
-               $fieldCode = '<input type="text"  name="tx_scheduler[emailfile]" id="' . $fieldID . '" value="' . $taskInfo['emailfile'] . '" />';
-               $label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.emailfile');
-               $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
-               $additionalFields[$fieldID] = array(
-                       'code' => $fieldCode,
-                       'label' => $label
-               );
-
-               return $additionalFields;
-       }
-
-
-       /**
-        * Mark current value as selected by returning the "selected" attribute.
-        *
-        * @param       array           $configurationArray: array of configuration
-        * @param       string          $currentValue: value of selector object
-        * @return      string          Html fragment for a selected option or empty
-        * @access protected
-        */
-       protected function getSelectedState($configurationArray, $currentValue) {
-               $selected = '';
-               for ($i = 0; $i < count($configurationArray); $i++) {
-                       if (strcmp($configurationArray[$i], $currentValue) === 0) {
-                               $selected = 'selected="selected" ';
-                       }
-               }
-               return $selected;
-       }
-
-
-       /**
-        * This method checks any additional data that is relevant to the specific task.
-        * If the task class is not relevant, the method is expected to return TRUE.
-        *
-        * @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
-        */
-       public function validateAdditionalFields(array &$submittedData, tx_scheduler_Module $schedulerModule) {
-               $isValid = TRUE;
-
-               //!TODO add validation to validate the $submittedData['configuration'] wich is normally a comma seperated string
-               if (!empty($submittedData['email'])) {
-                       $emailList = t3lib_div::trimExplode(',', $submittedData['email']);
-                       foreach ($emailList as $emailAdd) {
-                               if (!t3lib_div::validEmail($emailAdd)) {
-                                       $isValid = FALSE;
-                                       $schedulerModule->addMessage(
-                                               $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.invalidEmail'),
-                                               t3lib_FlashMessage::ERROR
-                                       );
-                               }
-                       }
-               }
-
-               if ($res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'uid = ' . $submittedData['page'])) {
-                       if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) == 0 && $submittedData['page'] > 0) {
-                               $isValid = FALSE;
-                               $schedulerModule->addMessage(
-                                       $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.invalidPage'),
-                                       t3lib_FlashMessage::ERROR
-                               );
-                       }
-               } else {
-                       $isValid = FALSE;
-                       $schedulerModule->addMessage(
-                               $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.invalidPage'),
-                               t3lib_FlashMessage::ERROR
-                       );
-               }
-
-               if ($submittedData['depth'] < 0) {
-                       $isValid = FALSE;
-                       $schedulerModule->addMessage(
-                               $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.invalidDepth'),
-                               t3lib_FlashMessage::ERROR
-                       );
-               }
-
-               return $isValid;
-       }
-
-
-       /**
-        * This method is used to save any additional input into the current task object
-        * if the task class matches.
-        *
-        * @param       array           $submittedData: array containing the data submitted by the user
-        * @param       tx_scheduler_Task               $task: reference to the current task object
-        * @return      void
-        */
-       public function saveAdditionalFields(array $submittedData, tx_scheduler_Task $task) {
-               $task->depth = $submittedData['depth'];
-               $task->page = $submittedData['page'];
-               $task->email = $submittedData['email'];
-               $task->emailonbrokenlinkonly = $submittedData['emailonbrokenlinkonly'];
-               $task->configuration = $submittedData['configuration'];
-               $task->emailfile = $submittedData['emailfile'];
-       }
-
-
-}
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validateadditionalfieldprovider.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validateadditionalfieldprovider.php']);
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validator.php b/typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validator.php
new file mode 100644 (file)
index 0000000..078a5bf
--- /dev/null
@@ -0,0 +1,475 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2010 - 2011 Michael Miousse (michael.miousse@infoglobe.ca)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * This class provides Scheduler plugin implementation.
+ *
+ * @author Michael Miousse <michael.miousse@infoglobe.ca>
+ * @package TYPO3
+ * @subpackage linkvalidator
+ */
+class tx_linkvalidator_tasks_Validator extends tx_scheduler_Task {
+
+       /**
+        * @var integer
+        */
+       protected $sleepTime;
+
+       /**
+        * @var integer
+        */
+       protected $sleepAfterFinish;
+
+       /**
+        * @var integer
+        */
+       protected $countInARun;
+
+       /**
+        * Total number of broken links.
+        *
+        * @var integer
+        */
+       protected $totalBrokenLink = 0;
+
+       /**
+        * Total number of broken links from the last run.
+        *
+        * @var integer
+        */
+       protected $oldTotalBrokenLink = 0;
+
+       /**
+        * Mail template fetched from the given template file.
+        *
+        * @var string
+        */
+       protected $templateMail;
+       
+       /**
+        * specific TSconfig for this task.
+        *
+        * @var array
+        */
+       protected $configuration = array();
+
+       /**
+        * Shows if number of result was diferent from the result of the last check or not.
+        *
+        * @var boolean
+        */
+       protected $dif;
+
+       /**
+        * Template to be used for the email.
+        *
+        * @var string
+        */
+       protected $emailTemplateFile;
+
+       /**
+        * Level of pages the task should check.
+        *
+        * @var integer
+        */
+       protected $depth;
+
+       /**
+        * UID of the start page for this task.
+        *
+        * @var integer
+        */
+       protected $page;
+
+       /**
+        * Email address to which an email report is sent.
+        *
+        * @var string
+        */
+       protected $email;
+       
+       /**
+        * Only send an email, if new broken links were found.
+        *
+        * @var boolean
+        */
+       protected $emailOnBrokenLinkOnly;
+
+       /**
+        * Get the value of the protected property email.
+        *
+        * @return  string      Email address to which an email report is sent
+        */
+       public function getEmail() {
+               return $this->email;
+       }
+       
+       /**
+        * Set the value of the private property email.
+        *
+        * @param  string       Email address to which an email report is sent
+        * @return void
+        */
+       public function setEmail($email) {
+               $this->email=$email;
+       }
+       
+       /**
+        * Get the value of the protected property emailOnBrokenLinkOnly.
+        *
+        * @return  boolean      Only send an email, if new broken links were found.
+        */
+       public function getEmailOnBrokenLinkOnly() {
+               return $this->emailOnBrokenLinkOnly;
+       }
+       
+       /**
+        * Set the value of the private property emailOnBrokenLinkOnly.
+        *
+        * @param  boolean      Only send an email, if new broken links were found.
+        * @return void
+        */
+       public function setEmailOnBrokenLinkOnly($emailOnBrokenLinkOnly) {
+               $this->emailOnBrokenLinkOnly = $emailOnBrokenLinkOnly;
+       }
+       
+       /**
+        * Get the value of the protected property page.
+        *
+        * @return  integer      UID of the start page for this task.
+        */
+       public function getPage() {
+               return $this->page;
+       }
+       
+       /**
+        * Set the value of the private property page.
+        *
+        * @param  integer      UID of the start page for this task.
+        * @return void
+        */
+       public function setPage($page) {
+               $this->page =$page;
+       }
+       
+       /**
+        * Get the value of the protected property depth.
+        *
+        * @return  integer     Level of pages the task should check.
+        */
+       public function getDepth() {
+               return $this->depth;
+       }
+       
+       /**
+        * Set the value of the private property depth.
+        *
+        * @param  integer     Level of pages the task should check.
+        * @return void
+        */
+       public function setDepth($depth) {
+               $this->depth = $depth;
+       }
+       
+       /**
+        * Get the value of the protected property emailTemplateFile.
+        *
+        * @return  string    Template to be used for the email.
+        */
+       public function getEmailTemplateFile() {
+               return $this->emailTemplateFile;
+       }
+       
+       /**
+        * Set the value of the private property emailTemplateFile.
+        *
+        * @param  string    Template to be used for the email.
+        * @return void
+        */
+       public function setEmailTemplateFile($emailTemplateFile) {
+               $this->emailTemplateFile = $emailTemplateFile;
+       }
+       
+       /**
+        * Get the value of the protected property configuration.
+        *
+        * @return  array    specific TSconfig for this task.
+        */
+       public function getConfiguration() {
+               return $this->configuration;
+       }
+       
+       /**
+        * Set the value of the private property configuration.
+        *
+        * @param  array    specific TSconfig for this task.
+        * @return void
+        */
+       public function setConfiguration($configuration) {
+               $this->configuration = $configuration;
+       }
+       
+       
+       /**
+        * Function executed from the Scheduler.
+        *
+        * @return      void
+        */
+       public function execute() {
+               $this->setCliArguments();
+               $successfullyExecuted = TRUE;
+               if (!file_exists($file = t3lib_div::getFileAbsFileName($this->emailTemplateFile)) && !empty($this->email)) {
+                       throw new Exception(
+                               $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.error.invalidEmailTemplateFile'),
+                               '1295476972'
+                       );
+               }
+               $htmlFile = t3lib_div::getURL($file);
+               $this->templateMail = t3lib_parsehtml::getSubpart($htmlFile, '###REPORT_TEMPLATE###');
+
+                       // The array to put the content into
+               $html = array();
+               $pageSections = '';
+               $this->dif = FALSE;
+               $pageList = t3lib_div::trimExplode(',', $this->page, 1);
+               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);
+                               }
+
+                       }
+               }
+               if ($this->totalBrokenLink != $this->oldTotalBrokenLink) {
+                       $this->dif = TRUE;
+               }
+               if ($this->totalBrokenLink > 0
+                       && (!$this->emailOnBrokenLinkOnly || $this->dif)
+                       && !empty($this->email)
+               ) {
+                       $successfullyExecuted = $this->reportEmail($pageSections, $modTS);
+               }
+               return $successfullyExecuted;
+       }
+
+
+       /**
+        * Build and send warning email when new broken links were found.
+        *
+        * @param       string          $pageSections: Content of page section
+        * @param       string          $modTS: TSconfig array
+        * @return      bool            TRUE if mail was sent, FALSE if or not
+        */
+       protected function reportEmail($pageSections, $modTS) {
+               $content = t3lib_parsehtml::substituteSubpart($this->templateMail, '###PAGE_SECTION###', $pageSections);
+               /** @var array $markerArray */
+               $markerArray = array();
+               /** @var array $validEmailList */
+               $validEmailList = array();
+               /** @var boolean $sendEmail */
+               $sendEmail = TRUE;
+
+               $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 (t3lib_div::validEmail($modTS['mail.']['fromemail'])) {
+                       $mail->setFrom(array($modTS['mail.']['fromemail'] => $modTS['mail.']['fromname']));
+               } else {
+                       throw new Exception(
+                               $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.error.invalidFromEmail'),
+                               '1295476760'
+                       );
+               }
+               if(t3lib_div::validEmail($modTS['mail.']['replytoemail'])) {
+                       $mail->setReplyTo(array($modTS['mail.']['replytoemail'] => $modTS['mail.']['replytoname']));
+               }
+
+               if(!empty($modTS['mail.']['subject'])) {
+                       $mail->setSubject($modTS['mail.']['subject']);
+               } else {
+                       throw new Exception(
+                               $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.error.noSubject'),
+                               '1295476808'
+                       );
+               }
+               if (!empty($this->email)) {
+                       $emailList = t3lib_div::trimExplode(',', $this->email);
+                       foreach ($emailList as $emailAdd) {
+                               if (!t3lib_div::validEmail($emailAdd)) {
+                                       throw new Exception(
+                                               $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.error.invalidToEmail'),
+                                               '1295476821'
+                                       );
+                               } else {
+                                       $validEmailList[] = $emailAdd;
+                               }
+                       }
+               }
+               if (is_array($validEmailList) && !empty($validEmailList)) {
+                       $mail->setTo($this->email);
+               } else {
+                       $sendEmail = FALSE;
+               }
+
+               if($sendEmail) {
+                       $mail->setBody($content,'text/html');
+                       $mail->send();
+               }
+
+               return $sendEmail;
+       }
+
+
+       /**
+        * Build the mail content.
+        *
+        * @param       int                     $curPage: id of the current page
+        * @param       string          $pageList: list of pages id
+        * @param       array           $markerArray: array of markers
+        * @param       array           $oldBrokenLink: markerarray with the number of link found
+        * @return      string          Content of the mail
+        */
+       protected function buildMail($curPage, $pageList, $markerArray, $oldBrokenLink) {
+               $pageSectionHTML = t3lib_parsehtml::getSubpart($this->templateMail, '###PAGE_SECTION###');
+
+               if (is_array($markerArray)) {
+                       foreach ($markerArray as $markerKey => $markerValue) {
+                               if (empty($oldBrokenLink[$markerKey])) {
+                                       $oldBrokenLink[$markerKey] = 0;
+                               }
+                               if ($markerValue != $oldBrokenLink[$markerKey]) {
+                                       $this->dif = TRUE;
+                               }
+                               $markerArray[$markerKey . '_old'] = $oldBrokenLink[$markerKey];
+                       }
+               }
+               $markerArray['title'] = t3lib_BEfunc::getRecordTitle('pages', t3lib_BEfunc::getRecord('pages', $curPage));
+
+               $content = '';
+               if ($markerArray['brokenlinkCount'] > 0) {
+                       $content = t3lib_parsehtml::substituteMarkerArray($pageSectionHTML, $markerArray, '###|###', TRUE, TRUE);
+               }
+               return $content;
+       }
+
+
+       /**
+        * Simulate cli call with setting the required options to the $_SERVER['argv']
+        *
+        * @return      void
+        * @access protected
+        */
+       protected function setCliArguments() {
+               $_SERVER['argv'] = array(
+                       $_SERVER['argv'][0],
+                       'tx_link_scheduler_link',
+                       '0',
+                       '-ss',
+                       '--sleepTime',
+                       $this->sleepTime,
+                       '--sleepAfterFinish',
+                       $this->sleepAfterFinish,
+                       '--countInARun',
+                       $this->countInARun
+               );
+       }
+}
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validator.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validator.php']);
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validatoradditionalfieldprovider.php b/typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validatoradditionalfieldprovider.php
new file mode 100644 (file)
index 0000000..338f306
--- /dev/null
@@ -0,0 +1,277 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2010 - 2011 Michael Miousse (michael.miousse@infoglobe.ca)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+/**
+ * This class provides Scheduler Additional Field plugin implementation.
+ *
+ * @author Dimitri König <dk@cabag.ch>
+ * @author Michael Miousse <michael.miousse@infoglobe.ca>
+ * @package TYPO3
+ * @subpackage linkvalidator
+ */
+class tx_linkvalidator_tasks_ValidatorAdditionalFieldProvider implements tx_scheduler_AdditionalFieldProvider {
+
+       /**
+        * Render additional information fields within the scheduler backend.
+        *
+        * @param       array           $taksInfo: array information of task to return
+        * @param       task            $task: task object
+        * @param       tx_scheduler_Module             $schedulerModule: reference to the calling object (BE module of the Scheduler)
+        * @return      array           additional fields
+        * @see interfaces/tx_scheduler_AdditionalFieldProvider#getAdditionalFields($taskInfo, $task, $schedulerModule)
+        */
+       public function getAdditionalFields(array &$taskInfo, $task, tx_scheduler_Module $schedulerModule) {
+               $additionalFields = array();
+               if (empty($taskInfo['configuration'])) {
+                       if ($schedulerModule->CMD == 'add') {
+                               $taskInfo['configuration'] = '';
+                       } elseif ($schedulerModule->CMD == 'edit') {
+                               $taskInfo['configuration'] = $task->getConfiguration();
+                       } else {
+                               $taskInfo['configuration'] = $task->getConfiguration();
+                       }
+               }
+
+               if (empty($taskInfo['depth'])) {
+                       if ($schedulerModule->CMD == 'add') {
+                               $taskInfo['depth'] = array();
+                       } elseif ($schedulerModule->CMD == 'edit') {
+                               $taskInfo['depth'] = $task->getDepth();
+                       } else {
+                               $taskInfo['depth'] = $task->getDepth();
+                       }
+               }
+
+               if (empty($taskInfo['page'])) {
+                       if ($schedulerModule->CMD == 'add') {
+                               $taskInfo['page'] = '';
+                       } elseif ($schedulerModule->CMD == 'edit') {
+                               $taskInfo['page'] = $task->getPage();
+                       } else {
+                               $taskInfo['page'] = $task->getPage();
+                       }
+               }
+               if (empty($taskInfo['email'])) {
+                       if ($schedulerModule->CMD == 'add') {
+                               $taskInfo['email'] = '';
+                       } elseif ($schedulerModule->CMD == 'edit') {
+                               $taskInfo['email'] = $task->getEmail();
+                       } else {
+                               $taskInfo['email'] = $task->getEmail();
+                       }
+               }
+
+               if (empty($taskInfo['emailOnBrokenLinkOnly'])) {
+                       if ($schedulerModule->CMD == 'add') {
+                               $taskInfo['emailOnBrokenLinkOnly'] = 1;
+                       } elseif ($schedulerModule->CMD == 'edit') {
+                               $taskInfo['emailOnBrokenLinkOnly'] = $task->getEmailOnBrokenLinkOnly();
+                       } else {
+                               $taskInfo['emailOnBrokenLinkOnly'] = $task->getEmailOnBrokenLinkOnly();
+                       }
+               }
+               if (empty($taskInfo['emailTemplateFile'])) {
+                       if ($schedulerModule->CMD == 'add') {
+                               $taskInfo['emailTemplateFile'] = 'EXT:linkvalidator/res/mailtemplate.html';
+                       } elseif ($schedulerModule->CMD == 'edit') {
+                               $taskInfo['emailTemplateFile'] = $task->getEmailTemplateFile();
+                       } else {
+                               $taskInfo['emailTemplateFile'] = $task->getEmailTemplateFile();
+                       }
+               }
+
+
+               $fieldID = 'task_page';
+               $fieldCode = '<input type="text" name="tx_scheduler[linkvalidator][page]"  id="' . $fieldID . '" value="' . htmlspecialchars($taskInfo['page']) . '"/>';
+               $label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.page');
+               $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
+               $additionalFields[$fieldID] = array(
+                       'code' => $fieldCode,
+                       'label' => $label
+               );
+
+                       // input for depth
+               $fieldID = 'task_depth';
+               $fieldValueArray = array(
+                       '0' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_0'),
+                       '1' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_1'),
+                       '2' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_2'),
+                       '3' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_3'),
+                       '4' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_4'),
+                       '999' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_infi'),
+               );
+               $fieldCode = '<select name="tx_scheduler[linkvalidator][depth]" id="' . $fieldID . '">';
+
+               foreach ($fieldValueArray as $depth => $label) {
+                       $fieldCode .= "\t" . '<option value="' . $depth . '"' . (($depth == htmlspecialchars($taskInfo['depth'])) ? ' selected="selected"' : '') . '>' . $label . '</option>';
+               }
+
+               $fieldCode .= '</select>';
+               $label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.depth');
+               $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
+               $additionalFields[$fieldID] = array(
+                       'code' => $fieldCode,
+                       'label' => $label
+               );
+
+               $fieldID = 'task_configuration';
+               $fieldCode = '<textarea  name="tx_scheduler[linkvalidator][configuration]" id="' . $fieldID . '" >' . htmlspecialchars($taskInfo['configuration']) . '</textarea>';
+               $label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.conf');
+               $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
+               $additionalFields[$fieldID] = array(
+                       'code' => $fieldCode,
+                       'label' => $label
+               );
+
+               $fieldID = 'task_email';
+               $fieldCode = '<input type="text"  name="tx_scheduler[linkvalidator][email]" id="' . $fieldID . '" value="' . htmlspecialchars($taskInfo['email']) . '" />';
+               $label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.email');
+               $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
+               $additionalFields[$fieldID] = array(
+                       'code' => $fieldCode,
+                       'label' => $label
+               );
+               $fieldID = 'task_emailOnBrokenLinkOnly';
+               $fieldCode = '<input type="checkbox"  name="tx_scheduler[linkvalidator][emailOnBrokenLinkOnly]" id="' . $fieldID . '" ' . (htmlspecialchars($taskInfo['emailOnBrokenLinkOnly']) ? 'checked="checked"' : '') . ' />';
+               $label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.emailOnBrokenLinkOnly');
+               $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
+               $additionalFields[$fieldID] = array(
+                       'code' => $fieldCode,
+                       'label' => $label
+               );
+
+               $fieldID = 'task_emailTemplateFile';
+               $fieldCode = '<input type="text"  name="tx_scheduler[linkvalidator][emailTemplateFile]" id="' . $fieldID . '" value="' . htmlspecialchars($taskInfo['emailTemplateFile']) . '" />';
+               $label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.emailTemplateFile');
+               $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
+               $additionalFields[$fieldID] = array(
+                       'code' => $fieldCode,
+                       'label' => $label
+               );
+
+               return $additionalFields;
+       }
+
+
+       /**
+        * Mark current value as selected by returning the "selected" attribute.
+        *
+        * @param       array           $configurationArray: array of configuration
+        * @param       string          $currentValue: value of selector object
+        * @return      string          Html fragment for a selected option or empty
+        * @access protected
+        */
+       protected function getSelectedState($configurationArray, $currentValue) {
+               $selected = '';
+               for ($i = 0; $i < count($configurationArray); $i++) {
+                       if (strcmp($configurationArray[$i], $currentValue) === 0) {
+                               $selected = 'selected="selected" ';
+                       }
+               }
+               return $selected;
+       }
+
+
+       /**
+        * This method checks any additional data that is relevant to the specific task.
+        * If the task class is not relevant, the method is expected to return TRUE.
+        *
+        * @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
+        */
+       public function validateAdditionalFields(array &$submittedData, tx_scheduler_Module $schedulerModule) {
+               $isValid = TRUE;
+
+               //!TODO add validation to validate the $submittedData['configuration'] wich is normally a comma seperated string
+               if (!empty($submittedData['linkvalidator']['email'])) {
+                       $emailList = t3lib_div::trimExplode(',', $submittedData['linkvalidator']['email']);
+                       foreach ($emailList as $emailAdd) {
+                               if (!t3lib_div::validEmail($emailAdd)) {
+                                       $isValid = FALSE;
+                                       $schedulerModule->addMessage(
+                                               $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.invalidEmail'),
+                                               t3lib_FlashMessage::ERROR
+                                       );
+                               }
+                       }
+               }
+
+               if ($res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'uid = ' . $submittedData['linkvalidator']['page'])) {
+                       if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) == 0 && $submittedData['linkvalidator']['page'] > 0) {
+                               $isValid = FALSE;
+                               $schedulerModule->addMessage(
+                                       $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.invalidPage'),
+                                       t3lib_FlashMessage::ERROR
+                               );
+                       }
+               } else {
+                       $isValid = FALSE;
+                       $schedulerModule->addMessage(
+                               $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.invalidPage'),
+                               t3lib_FlashMessage::ERROR
+                       );
+               }
+
+               if ($submittedData['linkvalidator']['depth'] < 0) {
+                       $isValid = FALSE;
+                       $schedulerModule->addMessage(
+                               $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.invalidDepth'),
+                               t3lib_FlashMessage::ERROR
+                       );
+               }
+
+               return $isValid;
+       }
+
+
+       /**
+        * This method is used to save any additional input into the current task object
+        * if the task class matches.
+        *
+        * @param       array           $submittedData: array containing the data submitted by the user
+        * @param       tx_scheduler_Task               $task: reference to the current task object
+        * @return      void
+        */
+       public function saveAdditionalFields(array $submittedData, tx_scheduler_Task $task) {
+               $task->setDepth($submittedData['linkvalidator']['depth']);
+               $task->setPage($submittedData['linkvalidator']['page']);
+               $task->setEmail($submittedData['linkvalidator']['email']);
+               if($submittedData['linkvalidator']['emailOnBrokenLinkOnly']){
+                       $task->setEmailOnBrokenLinkOnly(1);
+               }
+               else{
+                       $task->setEmailOnBrokenLinkOnly(0);
+               }
+               $task->setConfiguration($submittedData['linkvalidator']['configuration']);
+               $task->setEmailTemplateFile($submittedData['linkvalidator']['emailTemplateFile']);
+       }
+
+
+}
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validatoradditionalfieldprovider.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validatoradditionalfieldprovider.php']);
+}
+
+?>
\ No newline at end of file
index 5d061c5..e200a50 100644 (file)
Binary files a/typo3/sysext/linkvalidator/doc/manual.sxw and b/typo3/sysext/linkvalidator/doc/manual.sxw differ
index 8f51c7a..d92c1ad 100644 (file)
@@ -122,18 +122,14 @@ Note: Depending on the number of page levels to check and on the number of links
 
 Note: Linkvalidator uses an internal cache to store information about the broken links, which it found in your website. If showUpdateButton is set to 0, you must use the scheduler task provided by linkvalidator to update these information. 
 1
-mail.encoding
-string
-Set the encoding of the report mail sent by the cron script. 
-utf-8
 mail.fromname
 string
 Set the from name of the report mail sent by the cron script. 
-
+Linkvalidator
 mail.fromemail
 string
 Set the from email of the report mail sent by the cron script. 
-
+Linkvalidator@example.com
 mail.replytoname
 string
 Set the replyto name of the report mail sent by the cron script. 
@@ -158,9 +154,8 @@ mod.linkvalidator {
        linktypes = db,file,external
        checkhidden = 0
        mail {
-               encoding = utf-8
-               fromname =
-               fromemail =
+               fromname = TYPO3 Linkvalidator
+               fromemail = no_reply@mydomain.com
                replytoname =
                replytoemail =
                subject = TYPO3 Linkvalidator report
index 4df9468..b2b96b4 100644 (file)
@@ -2,16 +2,16 @@
 $extensionPath = t3lib_extMgm::extPath('linkvalidator');
 
 return array(
-       'tx_linkvalidator_linktypes_abstract' => $extensionPath . 'classes/linktypes/class.tx_linkvalidator_linktypes_abstract.php',
-       'tx_linkvalidator_linktypes_interface' => $extensionPath . 'classes/linktypes/class.tx_linkvalidator_linktypes_interface.php',
-       'tx_linkvalidator_linktypes_external' => $extensionPath . 'classes/linktypes/class.tx_linkvalidator_linktypes_external.php',
-       'tx_linkvalidator_linktypes_file' => $extensionPath . 'classes/linktypes/class.tx_linkvalidator_linktypes_file.php',
-       'tx_linkvalidator_linktypes_internal' => $extensionPath . 'classes/linktypes/class.tx_linkvalidator_linktypes_internal.php',
-       'tx_linkvalidator_linktypes_linkhandler' => $extensionPath . 'classes/linktypes/class.tx_linkvalidator_linktypes_linkhandler.php',
+       'tx_linkvalidator_linktype_abstract' => $extensionPath . 'classes/linktype/class.tx_linkvalidator_linktype_abstract.php',
+       'tx_linkvalidator_linktype_interface' => $extensionPath . 'classes/linktype/class.tx_linkvalidator_linktype_interface.php',
+       'tx_linkvalidator_linktype_external' => $extensionPath . 'classes/linktype/class.tx_linkvalidator_linktype_external.php',
+       'tx_linkvalidator_linktype_file' => $extensionPath . 'classes/linktype/class.tx_linkvalidator_linktype_file.php',
+       'tx_linkvalidator_linktype_internal' => $extensionPath . 'classes/linktype/class.tx_linkvalidator_linktype_internal.php',
+       'tx_linkvalidator_linktype_linkhandler' => $extensionPath . 'classes/linktype/class.tx_linkvalidator_linktype_linkhandler.php',
 
-       'tx_linkvalidator_processing' => $extensionPath . 'classes/class.tx_linkvalidator_processing.php',
+       'tx_linkvalidator_processor' => $extensionPath . 'classes/class.tx_linkvalidator_processor.php',
 
-       'tx_linkvalidator_tasks_validate'  => $extensionPath . 'classes/tasks/class.tx_linkvalidator_tasks_validate.php',
-       'tx_linkvalidator_tasks_validateadditionalfieldprovider' => $extensionPath . 'classes/tasks/class.tx_linkvalidator_tasks_validateadditionalfieldprovider.php',
+       'tx_linkvalidator_tasks_validator'  => $extensionPath . 'classes/tasks/class.tx_linkvalidator_tasks_validator.php',
+       'tx_linkvalidator_tasks_validatoradditionalfieldprovider' => $extensionPath . 'classes/tasks/class.tx_linkvalidator_tasks_validatoradditionalfieldprovider.php',
 );
 ?>
\ No newline at end of file
index 7fd7e42..6d13c00 100644 (file)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext "linkvalidator".
 #
-# Auto generated 12-01-2011 17:43
+# Auto generated 21-01-2011 18:10
 #
 # Manual updates:
 # Only the data in the array - everything else is removed by next
@@ -41,7 +41,7 @@ $EM_CONF[$_EXTKEY] = array(
                'suggests' => array(
                ),
        ),
-       '_md5_values_when_last_written' => 'a:26:{s:9:"ChangeLog";s:4:"ed60";s:16:"ext_autoload.php";s:4:"619e";s:12:"ext_icon.gif";s:4:"6bc7";s:17:"ext_localconf.php";s:4:"0598";s:14:"ext_tables.php";s:4:"6d40";s:14:"ext_tables.sql";s:4:"317e";s:13:"locallang.xml";s:4:"ec0a";s:45:"classes/class.tx_linkvalidator_processing.php";s:4:"611a";s:63:"classes/linktypes/class.tx_linkvalidator_linktypes_abstract.php";s:4:"7f7e";s:63:"classes/linktypes/class.tx_linkvalidator_linktypes_external.php";s:4:"bdfa";s:59:"classes/linktypes/class.tx_linkvalidator_linktypes_file.php";s:4:"ee97";s:64:"classes/linktypes/class.tx_linkvalidator_linktypes_interface.php";s:4:"c385";s:63:"classes/linktypes/class.tx_linkvalidator_linktypes_internal.php";s:4:"6bf5";s:66:"classes/linktypes/class.tx_linkvalidator_linktypes_linkhandler.php";s:4:"cef8";s:55:"classes/tasks/class.tx_linkvalidator_tasks_validate.php";s:4:"d684";s:78:"classes/tasks/class.tx_linkvalidator_tasks_validateadditionalfieldprovider.php";s:4:"12af";s:14:"doc/manual.sxw";s:4:"6694";s:14:"doc/manual.txt";s:4:"d46d";s:44:"modfunc1/class.tx_linkvalidator_modfunc1.php";s:4:"cb5b";s:22:"modfunc1/locallang.xml";s:4:"2319";s:26:"modfunc1/locallang_csh.xml";s:4:"efa4";s:26:"modfunc1/locallang_mod.xml";s:4:"e370";s:26:"modfunc1/mod_template.html";s:4:"7ed2";s:21:"res/linkvalidator.css";s:4:"2f4e";s:21:"res/mailtemplate.html";s:4:"c425";s:20:"res/pagetsconfig.txt";s:4:"ab0f";}',
+       '_md5_values_when_last_written' => 'a:26:{s:9:"ChangeLog";s:4:"fd4e";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:"d6cb";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:"cbac";s:14:"doc/manual.sxw";s:4:"68cf";s:14:"doc/manual.txt";s:4:"1b30";s:54:"modfuncreport/class.tx_linkvalidator_modfuncreport.php";s:4:"1642";s:27:"modfuncreport/locallang.xml";s:4:"9d28";s:31:"modfuncreport/locallang_csh.xml";s:4:"efa4";s:31:"modfuncreport/locallang_mod.xml";s:4:"e370";s:31:"modfuncreport/mod_template.html";s:4:"7ed2";s:21:"res/linkvalidator.css";s:4:"2f4e";s:21:"res/mailtemplate.html";s:4:"c425";s:20:"res/pagetsconfig.txt";s:4:"f657";}',
        'suggests' => array(
        ),
 );
index 627a469..5250d47 100644 (file)
@@ -5,20 +5,20 @@ if (!defined ('TYPO3_MODE')) {
 
 t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:linkvalidator/res/pagetsconfig.txt">');
 
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_linkvalidator_tasks_Validate'] = array(
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_linkvalidator_tasks_Validator'] = array(
     'extension'        => $_EXTKEY,
     'title'            => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:tasks.validate.name',
     'description'      => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:tasks.validate.description',
-    'additionalFields' => 'tx_linkvalidator_tasks_ValidateAdditionalFieldProvider'
+    'additionalFields' => 'tx_linkvalidator_tasks_ValidatorAdditionalFieldProvider'
 );
 
 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
        $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] = array();
 }
 
-$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks']['db'] = 'EXT:linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_internal.php:tx_linkvalidator_linkTypes_Internal';
-$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks']['file'] = 'EXT:linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_file.php:tx_linkvalidator_linkTypes_File';
-$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks']['external'] = 'EXT:linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_external.php:tx_linkvalidator_linkTypes_External';
-$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks']['linkhandler'] = 'EXT:linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_linkhandler.php:tx_linkvalidator_linkTypes_LinkHandler';
+$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks']['db'] = 'tx_linkvalidator_linktype_Internal';
+$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks']['file'] = 'tx_linkvalidator_linktype_File';
+$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks']['external'] = 'tx_linkvalidator_linktype_External';
+$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks']['linkhandler'] = 'tx_linkvalidator_linktype_LinkHandler';
 
 ?>
\ No newline at end of file
index 0880926..6e804f4 100644 (file)
@@ -7,13 +7,13 @@ if (TYPO3_MODE == 'BE') {
                // add module
        t3lib_extMgm::insertModuleFunction(
                'web_info',
-               'tx_linkvalidator_modfunc1',
-               t3lib_extMgm::extPath('linkvalidator') . 'modfunc1/class.tx_linkvalidator_modfunc1.php',
+               'tx_linkvalidator_ModFuncReport',
+               t3lib_extMgm::extPath('linkvalidator') . 'modfuncreport/class.tx_linkvalidator_modfuncreport.php',
                'LLL:EXT:linkvalidator/locallang.xml:mod_linkvalidator'
        );
 }
 
        // Initialize Context Sensitive Help (CSH)
-t3lib_extMgm::addLLrefForTCAdescr('linkvalidator', 'EXT:linkvalidator/modfunc1/locallang_csh.xml');
+t3lib_extMgm::addLLrefForTCAdescr('linkvalidator', 'EXT:linkvalidator/modfuncreport/locallang_csh.xml');
 
 ?>
\ No newline at end of file
index f1507bd..16d3edd 100644 (file)
@@ -1,15 +1,15 @@
-CREATE TABLE tx_linkvalidator_links (
+CREATE TABLE tx_linkvalidator_link (
        uid int(11) NOT NULL auto_increment,
-       recuid int(11) DEFAULT '0' NOT NULL,
-       recpid int(11) DEFAULT '0' NOT NULL,
+       record_uid int(11) DEFAULT '0' NOT NULL,
+       record_pid int(11) DEFAULT '0' NOT NULL,
        headline varchar(255) DEFAULT '' NOT NULL,
        field varchar(255) DEFAULT '' NOT NULL,
-       tablename varchar(255) DEFAULT '' NOT NULL,
-       linktitle text,
+       table_name varchar(255) DEFAULT '' NOT NULL,
+       link_title text,
        url text,
-       urlresponse text,
-       lastcheck int(11) DEFAULT '0' NOT NULL,
-       typelinks varchar(50) DEFAULT '' NOT NULL,
+       url_response text,
+       last_check int(11) DEFAULT '0' NOT NULL,
+       link_type varchar(50) DEFAULT '' NOT NULL,
 
        PRIMARY KEY (uid)
 );
\ No newline at end of file
index 3bf3435..b6dbff1 100644 (file)
@@ -9,18 +9,23 @@
        </meta>
        <data type="array">
                <languageKey index="default" type="array">
-                       <label index="mod_linkvalidator">Link validator</label>
-                       <label index="tasks.validate.name">Link validator</label>
-                       <label index="tasks.validate.description">Search for broken links and store the result into the temporary table sys_register in order to ease up the backend module.</label>
+                       <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.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.emailfile">Email template file</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>
                </languageKey>
        </data>
 </T3locallang>
diff --git a/typo3/sysext/linkvalidator/modfunc1/class.tx_linkvalidator_modfunc1.php b/typo3/sysext/linkvalidator/modfunc1/class.tx_linkvalidator_modfunc1.php
deleted file mode 100644 (file)
index 83f656e..0000000
+++ /dev/null
@@ -1,563 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2005 - 2010 Michael Miousse (michael.miousse@infoglobe.ca)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * Module 'Link Validator' for the 'linkvalidator' extension.
- *
- * @author Michael Miousse <michael.miousse@infoglobe.ca>
- * @author Jochen Rieger <j.rieger@connecta.ag>
- * @package TYPO3
- * @subpackage linkvalidator
- */
-class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
-
-       /**
-        * @var template
-        */
-       public $doc;
-       protected $relativePath;
-       protected $pageRecord = array();
-       protected $isAccessibleForCurrentUser = FALSE;
-       
-       protected $processing;
-
-       /**
-        * Main method of modfunc1
-        *
-        * @return      html    Module content
-        */
-       public function main() {
-               $GLOBALS['LANG']->includeLLFile('EXT:linkvalidator/modfunc1/locallang.xml');
-
-               $this->search_level = t3lib_div::_GP('search_levels');
-
-               if (isset($this->pObj->id)) {
-                       $this->modTS = t3lib_BEfunc::getModTSconfig($this->pObj->id, 'mod.linkvalidator');
-                       $this->modTS = $this->modTS['properties'];
-               }
-
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $value) {
-                                       // Compile list of all available types. Used for checking with button "Check Links".
-                               if (strpos($this->modTS['linktypes'], $linkType) !== FALSE) {
-                                       $this->availableOptions[$linkType] = 1;
-                               }
-                                       // Compile list of types currently selected by the checkboxes.
-                               if ($this->pObj->MOD_SETTINGS[$linkType]) {
-                                       $this->checkOpt[$linkType] = 1;
-                               }
-                       }
-               }
-
-               $this->initialize();
-
-               $this->firstSteps = $GLOBALS['LANG']->getLL('first.steps');
-
-               if ($this->modTS['showUpdateButton'] == 1) {
-                       $this->firstSteps .= ' ' . $GLOBALS['LANG']->getLL('first.steps.info.update.button');
-                       $this->updateListHtml = '<input type="submit" name="updateLinkList" value="' . $GLOBALS['LANG']->getLL('label_update') . '"/>';
-               }
-
-               if (t3lib_extMgm::isLoaded('scheduler')) {
-                       if ($GLOBALS['BE_USER']->isAdmin()) {
-                               $this->firstSteps .= ' ' . 
-                               sprintf($GLOBALS['LANG']->getLL('first.steps.info.scheduler'),
-                                       '<a href="' . t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'typo3/mod.php?M=tools_txschedulerM1">', '</a>'
-                               );
-                       } else {
-                               $this->firstSteps .= ' ' . $GLOBALS['LANG']->getLL('first.steps.info.scheduler.admin');
-                       }
-               }
-
-               $this->refreshListHtml = '<input type="submit" name="refreshLinkList" value="' . $GLOBALS['LANG']->getLL('label_refresh') . '"/>';
-
-               $this->processing = t3lib_div::makeInstance('tx_linkvalidator_processing');
-               $this->updateBrokenLinks();
-
-               $brokenLinkOverView = $this->processing->getLinkCounts($this->pObj->id);
-               $this->checkOptHtml = $this->getCheckOptions($brokenLinkOverView);
-
-               $this->render();
-
-
-               return $this->flush();
-       }
-
-
-       /**
-        * Initializes the menu array internally.
-        *
-        * @return      Module          menu
-        */
-       public function modMenu() {
-               $modMenu = array (
-                       'checkAllLink' => 0,
-               );
-
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $value) {
-                               $modMenu[$linkType] = 1;
-                       }
-               }
-
-               return $modMenu;
-       }
-
-
-       /**
-        * Initializes the Module.
-        *
-        * @return      void
-        */
-       protected function initialize() {
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $classRef) {
-                               $this->hookObjectsArr[$linkType] = &t3lib_div::getUserObj($classRef);
-                       }
-               }
-
-               $this->doc = t3lib_div::makeInstance('template');
-               $this->doc->setModuleTemplate(t3lib_extMgm::extPath('linkvalidator') . 'modfunc1/mod_template.html');
-               $this->doc->backPath = $GLOBALS['BACK_PATH'];
-
-               $this->relativePath = t3lib_extMgm::extRelPath('linkvalidator');
-               $this->pageRecord = t3lib_BEfunc::readPageAccess($this->pObj->id, $this->perms_clause);
-
-               $this->isAccessibleForCurrentUser = FALSE;
-               if ($this->pObj->id && is_array($this->pageRecord) || !$this->pObj->id && $this->isCurrentUserAdmin()) {
-                       $this->isAccessibleForCurrentUser = TRUE;
-               }
-
-               $this->loadHeaderData();
-
-                       // Don't access in workspace
-               if ($GLOBALS['BE_USER']->workspace !== 0) {
-                       $this->isAccessibleForCurrentUser = FALSE;
-               }
-       }
-
-
-       /**
-        * Updates the table of stored broken links.
-        *
-        * @param       array           Processing object
-        * @return      void
-        */
-       protected function updateBrokenLinks() {
-               $searchFields = array();
-
-                       // get the searchFields from TypoScript
-               foreach ($this->modTS['searchFields.'] as $table => $fieldList) {
-                       $fields = t3lib_div::trimExplode(',', $fieldList);
-                       foreach ($fields as $field) {
-                               if (!$searchFields || !is_array($searchFields[$table]) || array_search($field, $searchFields[$table]) == FALSE) {
-                                       $searchFields[$table][] = $field;
-                               }
-                       }
-               }
-                       // get children pages
-               $pageList = $this->processing->extGetTreeList(
-                       $this->pObj->id,
-                       $this->search_level,
-                       0,
-                       $GLOBALS['BE_USER']->getPagePermsClause(1)
-               );
-               $pageList .= $this->pObj->id;
-
-               $this->processing->init($searchFields, $pageList);
-
-                       // check if button press
-               $update = t3lib_div::_GP('updateLinkList');
-
-               if (!empty($update)) {
-                       $this->processing->getLinkStatistics($this->availableOptions, $this->modTS['checkhidden']);
-               }
-       }
-
-
-       /**
-        * Renders the content of the module.
-        *
-        * @return      void
-        */
-       protected function render() {
-               if ($this->isAccessibleForCurrentUser) {
-                       $this->content = $this->drawBrokenLinksTable();
-               } else {
-                               // If no access or if ID == zero
-                       $this->content .= $this->doc->spacer(10);
-               }
-       }
-
-
-       /**
-        * Flushes the rendered content to the browser.
-        *
-        * @return      void
-        */
-       protected function flush() {
-               $content.= $this->doc->moduleBody(
-                       $this->pageRecord,
-                       $this->getDocHeaderButtons(),
-                       $this->getTemplateMarkers()
-               );
-
-               return $content;
-       }
-
-
-       /**
-        * Builds the selector for the level of pages to search.
-        *
-        * @return      string  Html code of that selector
-        */
-       private function getLevelSelector() {
-                       // Make level selector:
-               $opt = array();
-               $parts = array(
-                       0 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_0'),
-                       1 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_1'),
-                       2 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_2'),
-                       3 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_3'),
-                       999 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_infi'),
-               );
-
-               foreach ($parts as $kv => $label) {
-                       $opt[] = '<option value="' . $kv . '"' . ($kv == intval($this->search_level) ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>';
-               }
-               $lMenu = '<select name="search_levels">' . implode('', $opt) . '</select>';
-               return $lMenu;
-       }
-
-       /**
-        * Displays the table of broken links or a note if there were no broken links.
-        *
-        * @return      html    Content of the table or of the note
-        */
-       private function drawBrokenLinksTable() {
-               $content = '';
-               $items = array();
-               $brokenLinkItems = '';
-               $keyOpt = array();
-
-               if (is_array($this->checkOpt)) {
-                       $keyOpt = array_keys($this->checkOpt);
-               }
-
-               $pageList = $this->processing->extGetTreeList(
-                       $this->pObj->id,
-                       $this->search_level,
-                       0,
-                       $GLOBALS['BE_USER']->getPagePermsClause(1)
-               );
-               $pageList .= $this->pObj->id;
-
-               if (($res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                       '*',
-                       'tx_linkvalidator_links',
-                       'recpid in (' . $pageList . ') and typelinks in (\'' . implode("','", $keyOpt) . '\')',
-                       '',
-                       'recuid 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###');
-
-                               $brokenLinksItemTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###BROKENLINKS_ITEM###');
-
-                                       // Table header
-                               $brokenLinksMarker = $this->startTable();
-
-                                       // Table rows containing the broken links
-                               while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
-                                       $items[] = $this->drawTableRow($row['tablename'], $row, $brokenLinksItemTemplate);
-                               }
-                               $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();
-                       }
-               }
-               $brokenLinksTemplate = t3lib_parsehtml::substituteMarkerArray($brokenLinksTemplate, $brokenLinksMarker, '###|###', TRUE);
-
-               $content = t3lib_parsehtml::substituteSubpart($brokenLinksTemplate, '###BROKENLINKS_ITEM', $brokenLinkItems);
-
-               return $content;
-       }
-
-
-
-       /**
-        * Displays the table header of the table with the broken links.
-        *
-        * @return      html            Code of content
-        */
-       private function startTable() {
-               global $TYPO3_CONF_VARS;
-
-                       // Listing head
-               $makerTableHead = array();
-
-               $makerTableHead['tablehead_path'] = $GLOBALS['LANG']->getLL('list.tableHead.path');
-               $makerTableHead['tablehead_element'] = $GLOBALS['LANG']->getLL('list.tableHead.element');
-               $makerTableHead['tablehead_headlink'] = $GLOBALS['LANG']->getLL('list.tableHead.headlink');
-               $makerTableHead['tablehead_linktarget'] = $GLOBALS['LANG']->getLL('list.tableHead.linktarget');
-               $makerTableHead['tablehead_linkmessage'] = $GLOBALS['LANG']->getLL('list.tableHead.linkmessage');
-               $makerTableHead['tablehead_lastcheck'] = $GLOBALS['LANG']->getLL('list.tableHead.lastCheck');
-
-                       // Add CSH to the header of each column
-               foreach($makerTableHead as $column => $label) {
-                       $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $column, $label);
-                       $makerTableHead[$column] = $label;
-               }
-
-                       // Add section header
-               $makerTableHead['list_header'] = $this->doc->sectionHeader($GLOBALS['LANG']->getLL('list.header'));
-
-               return $makerTableHead;
-       }
-
-
-       /**
-        * Displays one line of the broken links table.
-        *
-        * @param       string          table
-        * @param       string          row record
-        * @return      html            code of content
-        */
-       private function drawTableRow($table, $row, $brokenLinksItemTemplate) {
-               $markerArray = array();
-               if (is_array($row) && !empty($row['typelinks'])) {
-                       if (($hookObj = $this->hookObjectsArr[$row['typelinks']])) {
-                               $brokenUrl = $hookObj->getBrokenUrl($row);
-                       }
-               }
-
-               $params = '&edit[' . $table . '][' . $row['recuid'] . ']=edit';
-               $actionLinks = '<a href="#" onclick="' .
-                               t3lib_BEfunc::editOnClick(
-                                       $params,
-                                       $GLOBALS['BACK_PATH'],
-                                       t3lib_div::getIndpEnv('REQUEST_URI') . '?id=' . $this->pObj->id . '&search_levels=' . $this->search_level
-                               ) . '"' .
-                               ' title="' . $GLOBALS['LANG']->getLL('list.edit') . '">' .
-                               t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
-
-               $elementHeadline = $row['headline'];
-               if (empty($elementHeadline)) {
-                       $elementHeadline = $GLOBALS['LANG']->getLL('list.no.headline');
-               }
-
-                       // Get the language label for the field from TCA
-               if ($GLOBALS['TCA'][$table]['columns'][$row['field']]['label']) {
-                       $fieldName = $GLOBALS['TCA'][$table]['columns'][$row['field']]['label'];
-                       $fieldName = $GLOBALS['LANG']->sL($fieldName);
-                               // Crop colon from end if present.
-                       if (substr($fieldName, '-1', '1') === ':') {
-                               $fieldName = substr($fieldName, '0', strlen($fieldName)-1);
-                       }
-               }
-                       // Fallback, if there is no label
-               $fieldName = $fieldName ? $fieldName : $row['field'];
-
-                       // column "Element"
-               $element = t3lib_iconWorks::getSpriteIconForRecord($table, $row, array('title' => $table . ':' . $row['recuid']));
-               $element .= $elementHeadline;
-               $element .= ' ' . sprintf($GLOBALS['LANG']->getLL('list.field'), $fieldName);
-
-               $markerArray['actionlink'] = $actionLinks;
-               $markerArray['path'] = t3lib_BEfunc::getRecordPath($row['recpid'], '', 0, 0);
-               $markerArray['element'] = $element; 
-               $markerArray['headlink'] = $row['linktitle'];
-               $markerArray['linktarget'] = $brokenUrl;
-
-               $response = unserialize($row['urlresponse']);
-               if ($response['valid']) {
-                       $linkMessage = '<span style="color: green;">' . $GLOBALS['LANG']->getLL('list.msg.ok') . '</span>';
-               } else {
-                       $linkMessage = '<span style="color: red;">' . $hookObj->getErrorMessage($response['errorParams']) . '</span>';
-               }
-               $markerArray['linkmessage'] = $linkMessage;
-
-               $lastRunDate = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $row['lastcheck']);
-               $lastRunTime = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'], $row['lastcheck']);
-               $message = sprintf($GLOBALS['LANG']->getLL('list.msg.lastRun'), $lastRunDate, $lastRunTime);
-               $markerArray['lastcheck'] = $message;
-
-                       // Return the table html code as string
-               return t3lib_parsehtml::substituteMarkerArray($brokenLinksItemTemplate, $markerArray, '###|###', TRUE, TRUE);
-       }
-
-
-       /**
-        * Builds the checkboxes out of the hooks array.
-        *
-        * @param       array           array of broken links information
-        * @return      html            code content
-        */
-       private function getCheckOptions($brokenLinkOverView) {
-               $content = '';
-               $checkOptionsTemplate = '';
-               $checkOptionsTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###CHECKOPTIONS_SECTION###');
-
-               $hookSectionContent = '';
-               $hookSectionTemplate = t3lib_parsehtml::getSubpart($checkOptionsTemplate, '###HOOK_SECTION###');
-
-               $markerArray['statistics_header'] = $this->doc->sectionHeader($GLOBALS['LANG']->getLL('overviews.statistics.header'));
-
-               $totalCountLabel = $GLOBALS['LANG']->getLL('overviews.nbtotal');
-               $totalCountLabel = t3lib_BEfunc::wrapInHelp('linkvalidator', 'checkboxes', $totalCountLabel);
-               $markerArray['total_count_label'] = $totalCountLabel;
-
-               if (empty($brokenLinkOverView['brokenlinkCount'])) {
-                       $markerArray['total_count'] = '0';
-               } else {
-                       $markerArray['total_count'] = $brokenLinkOverView['brokenlinkCount'];
-               }
-
-               $linktypes = t3lib_div::trimExplode(',', $this->modTS['linktypes'], 1);
-               $hookSectionContent = '';
-
-               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)) {
-                                               $hookSectionMarker = array();
-                                               if (empty($brokenLinkOverView[$type])) {
-                                                       $hookSectionMarker['count'] = '0';
-                                               } else {
-                                                       $hookSectionMarker['count'] = $brokenLinkOverView[$type];
-                                               }
-                                               $translation = $GLOBALS['LANG']->getLL('hooks.' . $type);
-                                               $translation = $translation ? $translation : $type;
-                                               $option = t3lib_BEfunc::getFuncCheck(
-                                                       array('id' => $this->pObj->id, 'search_levels' => $this->search_level),
-                                                       'SET[' . $type . ']',
-                                                       $this->pObj->MOD_SETTINGS[$type],
-                                                       '',
-                                                       '',
-                                                       'id="SET[' . $type . ']"'
-                                               ) . '<label for="SET[' . $type . ']">' . $translation . '</label>';
-                                               $hookSectionMarker['option'] = $option;
-                                               $hookSectionContent .= t3lib_parsehtml::substituteMarkerArray($hookSectionTemplate, $hookSectionMarker, '###|###', TRUE, TRUE);
-                                       }
-                               }
-                       }
-               }
-
-               $checkOptionsTemplate = t3lib_parsehtml::substituteSubpart($checkOptionsTemplate, '###HOOK_SECTION###', $hookSectionContent);
-
-               return t3lib_parsehtml::substituteMarkerArray($checkOptionsTemplate, $markerArray, '###|###', TRUE, TRUE);
-       }
-
-
-       /**
-        * Loads data in the HTML head section (e.g. JavaScript or stylesheet information).
-        *
-        * @return      void
-        */
-       private function loadHeaderData() {
-               $this->doc->addStyleSheet('linkvalidator', $this->relativePath . 'res/linkvalidator.css', 'linkvalidator');
-       }
-
-
-       /**
-        * Gets the buttons that shall be rendered in the docHeader.
-        *
-        * @return      array           Available buttons for the docHeader
-        */
-       private function getDocHeaderButtons() {
-               $buttons = array(
-                       'csh' => t3lib_BEfunc::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH']),
-                       'shortcut' => $this->getShortcutButton(),
-                       'save' => ''
-               );
-               return $buttons;
-       }
-
-
-       /**
-        * Gets the button to set a new shortcut in the backend (if current user is allowed to).
-        *
-        * @return      string          HTML representiation of the shortcut button
-        */
-       private function getShortcutButton() {
-               $result = '';
-               if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
-                       $result = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']);
-               }
-               return $result;
-       }
-
-
-       /**
-        * Gets the filled markers that are used in the HTML template.
-        *
-        * @return      array           The filled marker array
-        */
-       private function getTemplateMarkers() {
-
-               $markers = array(
-                       'FIRST_STEPS'                   => $this->firstSteps,
-                       'FUNC_MENU'                             => $this->getLevelSelector(),
-                       'CONTENT'                               => $this->content,
-                       'TITLE'                                 => $GLOBALS['LANG']->getLL('title'),
-                       'CHECKALLLINK'                  => $this->checkAllHtml,
-                       'CHECKOPTIONS'                  => $this->checkOptHtml,
-                       'ID'                                    => '<input type="hidden" name="id" value="' . $this->pObj->id . '"/>',
-                       'REFRESH'                               => $this->refreshListHtml,
-                   'UPDATE'                => $this->updateListHtml
-               );
-
-               return $markers;
-       }
-
-
-       /**
-        * Determines whether the current user is an admin.
-        *
-        * @return      boolean         Whether the current user is admin
-        */
-       private function isCurrentUserAdmin() {
-               return ((bool) $GLOBALS['BE_USER']->user['admin']);
-       }
-}
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/modfunc1/class.tx_linkvalidator_modfunc1.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/modfunc1/class.tx_linkvalidator_modfunc1.php']);
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/modfunc1/locallang.xml b/typo3/sysext/linkvalidator/modfunc1/locallang.xml
deleted file mode 100644 (file)
index e99c2dd..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<T3locallang>
-       <meta type="array">
-               <description>Labels for the linkvalidator Backend module.</description>
-               <type>module</type>
-               <csh_table></csh_table>
-               <labelContext type="array">
-               </labelContext>
-       </meta>
-       <data type="array">
-               <languageKey index="default" type="array">
-                       <label index="title">Check Links</label>
-                       <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="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="first.steps">Choose the level of pages to check and press "Refresh display" to show the results.</label>
-                       <label index="first.steps.info.update.button">You can update the stored results by pressing "Check links". Note that this process can take some time.</label>
-                       <label index="first.steps.info.scheduler">Alternatively you can also configure the %sTYPO3 Scheduler%s to update the stored results regularly.</label>
-                       <label index="first.steps.info.scheduler.admin">Alternatively your administrator can also configure the TYPO3 Scheduler to update the stored results regularly.</label>
-                       <label index="label_refresh">Refresh display</label>
-                       <label index="label_update">Check links</label>
-                       <label index="overviews.statistics.header">Statistics of broken Links</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="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.field">(Field: %s)</label>
-                       <label index="list.no.headline">&lt;i&gt;(no headline)&lt;/i&gt;</label>
-                       <label index="list.report.pagedeleted">Page '###title###' (###uid###) is deleted.</label>
-                       <label index="list.report.pagenotexisting">Page (###uid###) does not exist.</label>
-                       <label index="list.report.pagenotvisible">Page '###title###' (###uid###) is not visible.</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.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>
-               </languageKey>
-       </data>
-</T3locallang>
diff --git a/typo3/sysext/linkvalidator/modfunc1/locallang_csh.xml b/typo3/sysext/linkvalidator/modfunc1/locallang_csh.xml
deleted file mode 100644 (file)
index 3856287..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<T3locallang>
-       <meta type="array">
-               <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 display or to hide 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
diff --git a/typo3/sysext/linkvalidator/modfunc1/locallang_mod.xml b/typo3/sysext/linkvalidator/modfunc1/locallang_mod.xml
deleted file mode 100644 (file)
index 9631ef1..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<T3locallang>
-       <meta type="array">
-               <description>Labels for linkvalidator.</description>
-               <type>module</type>
-               <csh_table></csh_table>
-               <labelContext type="array">
-               </labelContext>
-       </meta>
-       <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>
-               </languageKey>
-       </data>
-</T3locallang>
diff --git a/typo3/sysext/linkvalidator/modfunc1/mod_template.html b/typo3/sysext/linkvalidator/modfunc1/mod_template.html
deleted file mode 100644 (file)
index 11f9cd3..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<!-- ###FULLDOC### begin -->
-                       <h3>###TITLE###</h3>
-                       <p id="linkvalidator_firstSteps">###FIRST_STEPS###</p>
-                       <div class="linkvalidator_funcmenu">###FUNC_MENU######REFRESH######UPDATE###</div>
-                       <div class="linkvalidator_checkoptions">
-                               ###ID###
-                               ###CHECKALLLINK###
-                               ###CHECKOPTIONS###
-                       </div>
-                       ###CONTENT###
-<!-- ###FULLDOC### end -->
-
-
-<!-- ###CHECKOPTIONS_SECTION### begin -->
-       ###STATISTICS_HEADER###
-       <table class="typo3-dblist" id="linkvalidator_statsTable" cellspacing="0" cellpadding="0">
-               <tr class="t3-row-header">
-                       <td>
-                               ###TOTAL_COUNT_LABEL###
-                       </td>
-                       <td class="number">###TOTAL_COUNT###</td>
-               </tr>
-               <!-- ###HOOK_SECTION### begin -->
-               <tr class="db_list_normal">
-                       <td>
-                               <div class="linkvalidator_singleOption">###OPTION###</div>
-                       </td>
-                       <td class="number">###COUNT###</td>
-               </tr>
-               <!-- ###HOOK_SECTION### end -->
-       </table>
-<!-- ###CHECKOPTIONS_SECTION### end -->
-
-
-<!-- ###BROKENLINKS_CONTENT### begin -->
-       ###LIST_HEADER###
-       <table class="typo3-dblist" id="linkvalidator_brokenLinksTable" cellspacing="0" cellpadding="0">
-               <tr class="t3-row-header">
-                       <td></td>
-                       <td>###TABLEHEAD_PATH###</td>
-                       <td>###TABLEHEAD_ELEMENT###</td>
-                       <td>###TABLEHEAD_HEADLINK###</td>
-                       <td>###TABLEHEAD_LINKTARGET###</td>
-                       <td>###TABLEHEAD_LINKMESSAGE###</td>
-                       <td>###TABLEHEAD_LASTCHECK###</td>
-               </tr>
-               <!-- ###BROKENLINKS_ITEM### begin -->
-               <tr class="db_list_normal">
-                       <td>###ACTIONLINK###</td>
-                       <td>###PATH###</td>
-                       <td>###ELEMENT###</td>
-                       <td>###HEADLINK###</td>
-                       <td><a href="###LINKTARGET###" target="_blank">###LINKTARGET###</a></td>
-                       <td>###LINKMESSAGE###</td>
-                       <td>###LASTCHECK###</td>
-               </tr>
-               <!-- ###BROKENLINKS_ITEM### end -->
-       </table>
-<!-- ###BROKENLINKS_CONTENT### end -->
-
-<!-- ###NOBROKENLINKS_CONTENT### begin -->
-       ###LIST_HEADER###
-       ###NO_BROKEN_LINKS###
-<!-- ###NOBROKENLINKS_CONTENT### end -->
diff --git a/typo3/sysext/linkvalidator/modfuncreport/class.tx_linkvalidator_modfuncreport.php b/typo3/sysext/linkvalidator/modfuncreport/class.tx_linkvalidator_modfuncreport.php
new file mode 100644 (file)
index 0000000..d22a0d3
--- /dev/null
@@ -0,0 +1,657 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2005 - 2010 Jochen Rieger (j.rieger@connecta.ag) 
+ *  (c) 2010 - 2011 Michael Miousse (michael.miousse@infoglobe.ca)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Module 'Linkvalidator' for the 'linkvalidator' extension.
+ *
+ * @author Michael Miousse <michael.miousse@infoglobe.ca>
+ * @author Jochen Rieger <j.rieger@connecta.ag>
+ * @package TYPO3
+ * @subpackage linkvalidator
+ */
+class tx_linkvalidator_ModFuncReport extends t3lib_extobjbase {
+
+       /**
+        * @var template
+        */
+       public $doc;
+
+       /**
+        * @var string
+        */
+       protected $relativePath;
+
+       /**
+        * Information about the current page record.
+        *
+        * @var array
+        */
+       protected $pageRecord = array();
+
+       /**
+        * Information, if the module is accessible for the current user or not.
+        *
+        * @var boolean
+        */
+       protected $isAccessibleForCurrentUser = FALSE;
+
+       /**
+        * Depth for the recursivity of the link validation.
+        *
+        * @var integer
+        */
+       protected $searchLevel;
+
+       /**
+        * Link validation class.
+        *
+        * @var tx_linkvalidator_Processor
+        */
+       protected $processor;
+
+       /**
+        * TSconfig of the current module.
+        *
+        * @var array
+        */
+       protected $modTS = array();
+
+       /**
+        * List of available link types to check defined in the TSconfig.
+        *
+        * @var array
+        */
+       protected $availableOptions = array();
+
+       /**
+        * List of link types currently chosen in the Statistics table.
+        * Used to show broken links of these types only.
+        *
+        * @var array
+        */
+       protected $checkOpt = array();
+
+       /**
+        * Html for the button "Check Links".
+        *
+        * @var string
+        */
+       protected $updateListHtml;
+
+       /**
+        * Html for the button "Refresh Display".
+        *
+        * @var string
+        */
+       protected $refreshListHtml;
+
+       /**
+        * Html for the Statistics table with the checkboxes of the link types and the numbers of broken links.
+        *
+        * @var string
+        */
+       protected $checkOptHtml;
+
+       /**
+        * Complete content (html) to be displayed.
+        *
+        * @var string
+        */
+       protected $content;
+
+       /**
+        * Main method of modfuncreport
+        *
+        * @return string Module content
+        */
+       public function main() {
+               $GLOBALS['LANG']->includeLLFile('EXT:linkvalidator/modfuncreport/locallang.xml');
+
+               $this->searchLevel = t3lib_div::_GP('search_levels');
+
+               if (isset($this->pObj->id)) {
+                       $this->modTS = t3lib_BEfunc::getModTSconfig($this->pObj->id, 'mod.linkvalidator');
+                       $this->modTS = $this->modTS['properties'];
+               }
+
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $value) {
+                                       // Compile list of all available types. Used for checking with button "Check Links".
+                               if (strpos($this->modTS['linktypes'], $linkType) !== FALSE) {
+                                       $this->availableOptions[$linkType] = 1;
+                               }
+                                       // Compile list of types currently selected by the checkboxes.
+                               if ($this->pObj->MOD_SETTINGS[$linkType]) {
+                                       $this->checkOpt[$linkType] = 1;
+                               }
+                       }
+               }
+
+               $this->initialize();
+
+               if ($this->modTS['showUpdateButton'] == 1) {
+                       $this->updateListHtml = '<input type="submit" name="updateLinkList" value="' . $GLOBALS['LANG']->getLL('label_update') . '"/>';
+               }
+
+               $this->refreshListHtml = '<input type="submit" name="refreshLinkList" value="' . $GLOBALS['LANG']->getLL('label_refresh') . '"/>';
+
+               $this->processor = t3lib_div::makeInstance('tx_linkvalidator_Processor');
+               $this->updateBrokenLinks();
+
+               $brokenLinkOverView = $this->processor->getLinkCounts($this->pObj->id);
+               $this->checkOptHtml = $this->getCheckOptions($brokenLinkOverView);
+
+               $this->render();
+
+
+               return $this->flush();
+       }
+
+
+       /**
+        * Initializes the menu array internally.
+        *
+        * @return array Module menu
+        */
+       public function modMenu() {
+               $modMenu = array (
+                       'checkAllLink' => 0,
+               );
+
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $value) {
+                               $modMenu[$linkType] = 1;
+                       }
+               }
+
+               return $modMenu;
+       }
+
+
+       /**
+        * Initializes the Module.
+        *
+        * @return void
+        */
+       protected function initialize() {
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $classRef) {
+                               $this->hookObjectsArr[$linkType] = &t3lib_div::getUserObj($classRef);
+                       }
+               }
+
+               $this->doc = t3lib_div::makeInstance('template');
+               $this->doc->setModuleTemplate(t3lib_extMgm::extPath('linkvalidator') . 'modfuncreport/mod_template.html');
+               $this->doc->backPath = $GLOBALS['BACK_PATH'];
+
+               $this->relativePath = t3lib_extMgm::extRelPath('linkvalidator');
+               $this->pageRecord = t3lib_BEfunc::readPageAccess($this->pObj->id, $this->perms_clause);
+
+               $this->isAccessibleForCurrentUser = FALSE;
+               if ($this->pObj->id && is_array($this->pageRecord) || !$this->pObj->id && $this->isCurrentUserAdmin()) {
+                       $this->isAccessibleForCurrentUser = TRUE;
+               }
+
+               $this->loadHeaderData();
+
+                       // Don't access in workspace
+               if ($GLOBALS['BE_USER']->workspace !== 0) {
+                       $this->isAccessibleForCurrentUser = FALSE;
+               }
+       }
+
+
+       /**
+        * Updates the table of stored broken links.
+        *
+        * @return void
+        */
+       protected function updateBrokenLinks() {
+               $searchFields = array();
+
+                       // get the searchFields from TypoScript
+               foreach ($this->modTS['searchFields.'] as $table => $fieldList) {
+                       $fields = t3lib_div::trimExplode(',', $fieldList);
+                       foreach ($fields as $field) {
+                               if (!$searchFields || !is_array($searchFields[$table]) || array_search($field, $searchFields[$table]) == FALSE) {
+                                       $searchFields[$table][] = $field;
+                               }
+                       }
+               }
+                       // get children pages
+               $pageList = $this->processor->extGetTreeList(
+                       $this->pObj->id,
+                       $this->searchLevel,
+                       0,
+                       $GLOBALS['BE_USER']->getPagePermsClause(1)
+               );
+               $pageList .= $this->pObj->id;
+
+               $this->processor->init($searchFields, $pageList);
+
+                       // check if button press
+               $update = t3lib_div::_GP('updateLinkList');
+
+               if (!empty($update)) {
+                       $this->processor->getLinkStatistics($this->availableOptions, $this->modTS['checkhidden']);
+               }
+       }
+
+
+       /**
+        * Renders the content of the module.
+        *
+        * @return void
+        */
+       protected function render() {
+               if ($this->isAccessibleForCurrentUser) {
+                       $this->content = $this->renderBrokenLinksTable();
+               } else {
+                               // If no access or if ID == zero
+                       $message = t3lib_div::makeInstance(
+                               't3lib_FlashMessage',
+                               $GLOBALS['LANG']->getLL('no.access'),
+                               $GLOBALS['LANG']->getLL('no.access.title'),
+                               t3lib_FlashMessage::ERROR
+                       );
+                       $this->content .= $message->render();
+               }
+       }
+
+
+       /**
+        * Flushes the rendered content to the browser.
+        *
+        * @return void
+        */
+       protected function flush() {
+               $content.= $this->doc->moduleBody(
+                       $this->pageRecord,
+                       $this->getDocHeaderButtons(),
+                       $this->getTemplateMarkers()
+               );
+
+               return $content;
+       }
+
+
+       /**
+        * Builds the selector for the level of pages to search.
+        *
+        * @return string Html code of that selector
+        */
+       protected function getLevelSelector() {
+                       // Make level selector:
+               $opt = array();
+               $parts = array(
+                       0 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_0'),
+                       1 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_1'),
+                       2 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_2'),
+                       3 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_3'),
+                       999 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_infi'),
+               );
+
+               foreach ($parts as $kv => $label) {
+                       $opt[] = '<option value="' . $kv . '"' . ($kv == intval($this->searchLevel) ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>';
+               }
+               $lMenu = '<select name="search_levels">' . implode('', $opt) . '</select>';
+               return $lMenu;
+       }
+
+       /**
+        * Displays the table of broken links or a note if there were no broken links.
+        *
+        * @return html Content of the table or of the note
+        */
+       protected function renderBrokenLinksTable() {
+               $content = '';
+               $items = array();
+               $brokenLinkItems = '';
+               $keyOpt = array();
+
+               if (is_array($this->checkOpt)) {
+                       $keyOpt = array_keys($this->checkOpt);
+               }
+
+               $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')
+               )) {
+                               // Display table with broken links
+                       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###');
+
+                                       // 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);
+                               }
+                               $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();
+                       }
+               }
+               $brokenLinksTemplate = t3lib_parsehtml::substituteMarkerArray($brokenLinksTemplate, $brokenLinksMarker, '###|###', TRUE);
+
+               $content = t3lib_parsehtml::substituteSubpart($brokenLinksTemplate, '###BROKENLINKS_ITEM', $brokenLinkItems);
+
+               return $content;
+       }
+
+
+
+       /**
+        * Displays the table header of the table with the broken links.
+        *
+        * @return string Code of content
+        */
+       protected function startTable() {
+               global $TYPO3_CONF_VARS;
+
+                       // Listing head
+               $makerTableHead = array();
+
+               $makerTableHead['tablehead_path'] = $GLOBALS['LANG']->getLL('list.tableHead.path');
+               $makerTableHead['tablehead_element'] = $GLOBALS['LANG']->getLL('list.tableHead.element');
+               $makerTableHead['tablehead_headlink'] = $GLOBALS['LANG']->getLL('list.tableHead.headlink');
+               $makerTableHead['tablehead_linktarget'] = $GLOBALS['LANG']->getLL('list.tableHead.linktarget');
+               $makerTableHead['tablehead_linkmessage'] = $GLOBALS['LANG']->getLL('list.tableHead.linkmessage');
+               $makerTableHead['tablehead_lastcheck'] = $GLOBALS['LANG']->getLL('list.tableHead.lastCheck');
+
+                       // Add CSH to the header of each column
+               foreach($makerTableHead as $column => $label) {
+                       $label = t3lib_BEfunc::wrapInHelp('linkvalidator', $column, $label);
+                       $makerTableHead[$column] = $label;
+               }
+
+                       // Add section header
+               $makerTableHead['list_header'] = $this->doc->sectionHeader($GLOBALS['LANG']->getLL('list.header'));
+
+               return $makerTableHead;
+       }
+
+
+       /**
+        * Displays one line of the broken links table.
+        *
+        * @param string $table Name of database table
+        * @param array $row Record row to be processed
+        * @param string $brokenLinksItemTemplate Markup of the template to be used
+        * @return string HTML of the rendered row
+        */
+       protected function renderTableRow($table, array $row, $brokenLinksItemTemplate) {
+               $markerArray = array();
+               if (is_array($row) && !empty($row['link_type'])) {
+                       if (($hookObj = $this->hookObjectsArr[$row['link_type']])) {
+                               $brokenUrl = $hookObj->getBrokenUrl($row);
+                       }
+               }
+
+               $params = '&edit[' . $table . '][' . $row['record_uid'] . ']=edit';
+               $actionLinks = '<a href="#" onclick="' .
+                               t3lib_BEfunc::editOnClick(
+                                       $params,
+                                       $GLOBALS['BACK_PATH'],
+                                       t3lib_div::getIndpEnv('REQUEST_URI') . '?id=' . $this->pObj->id . '&search_levels=' . $this->searchLevel
+                               ) . '"' .
+                               ' title="' . $GLOBALS['LANG']->getLL('list.edit') . '">' .
+                               t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
+
+               $elementHeadline = $row['headline'];
+               if (empty($elementHeadline)) {
+                       $elementHeadline = '<i>' . $GLOBALS['LANG']->getLL('list.no.headline') . '</i>';
+               }
+
+                       // Get the language label for the field from TCA
+               if ($GLOBALS['TCA'][$table]['columns'][$row['field']]['label']) {
+                       $fieldName = $GLOBALS['TCA'][$table]['columns'][$row['field']]['label'];
+                       $fieldName = $GLOBALS['LANG']->sL($fieldName);
+                               // Crop colon from end if present.
+                       if (substr($fieldName, '-1', '1') === ':') {
+                               $fieldName = substr($fieldName, '0', strlen($fieldName)-1);
+                       }
+               }
+                       // Fallback, if there is no label
+               $fieldName = $fieldName ? $fieldName : $row['field'];
+
+                       // column "Element"
+               $element = t3lib_iconWorks::getSpriteIconForRecord($table, $row, array('title' => $table . ':' . $row['record_uid']));
+               $element .= $elementHeadline;
+               $element .= ' ' . sprintf($GLOBALS['LANG']->getLL('list.field'), $fieldName);
+
+               $markerArray['actionlink'] = $actionLinks;
+               $markerArray['path'] = t3lib_BEfunc::getRecordPath($row['record_pid'], '', 0, 0);
+               $markerArray['element'] = $element; 
+               $markerArray['headlink'] = $row['link_title'];
+               $markerArray['linktarget'] = $brokenUrl;
+
+               $response = unserialize($row['url_response']);
+               if ($response['valid']) {
+                       $linkMessage = '<span style="color: green;">' . $GLOBALS['LANG']->getLL('list.msg.ok') . '</span>';
+               } else {
+                       $linkMessage = '<span style="color: red;">' . $hookObj->getErrorMessage($response['errorParams']) . '</span>';
+               }
+               $markerArray['linkmessage'] = $linkMessage;
+
+               $lastRunDate = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $row['last_check']);
+               $lastRunTime = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'], $row['last_check']);
+               $message = sprintf($GLOBALS['LANG']->getLL('list.msg.lastRun'), $lastRunDate, $lastRunTime);
+               $markerArray['lastcheck'] = $message;
+
+                       // Return the table html code as string
+               return t3lib_parsehtml::substituteMarkerArray($brokenLinksItemTemplate, $markerArray, '###|###', TRUE, TRUE);
+       }
+
+
+       /**
+        * Builds the checkboxes out of the hooks array.
+        *
+        * @param array $brokenLinkOverView array of broken links information
+        * @return string code content
+        */
+       protected function getCheckOptions(array $brokenLinkOverView) {
+               $content = '';
+               $checkOptionsTemplate = '';
+               $checkOptionsTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###CHECKOPTIONS_SECTION###');
+
+               $hookSectionContent = '';
+               $hookSectionTemplate = t3lib_parsehtml::getSubpart($checkOptionsTemplate, '###HOOK_SECTION###');
+
+               $markerArray['statistics_header'] = $this->doc->sectionHeader($GLOBALS['LANG']->getLL('overviews.statistics.header'));
+
+               $totalCountLabel = $GLOBALS['LANG']->getLL('overviews.nbtotal');
+               $totalCountLabel = t3lib_BEfunc::wrapInHelp('linkvalidator', 'checkboxes', $totalCountLabel);
+               $markerArray['total_count_label'] = $totalCountLabel;
+
+               if (empty($brokenLinkOverView['brokenlinkCount'])) {
+                       $markerArray['total_count'] = '0';
+               } else {
+                       $markerArray['total_count'] = $brokenLinkOverView['brokenlinkCount'];
+               }
+
+               $linktypes = t3lib_div::trimExplode(',', $this->modTS['linktypes'], 1);
+               $hookSectionContent = '';
+
+               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)) {
+                                               $hookSectionMarker = array();
+                                               if (empty($brokenLinkOverView[$type])) {
+                                                       $hookSectionMarker['count'] = '0';
+                                               } else {
+                                                       $hookSectionMarker['count'] = $brokenLinkOverView[$type];
+                                               }
+                                               $translation = $GLOBALS['LANG']->getLL('hooks.' . $type);
+                                               $translation = $translation ? $translation : $type;
+                                               $option = t3lib_BEfunc::getFuncCheck(
+                                                       array('id' => $this->pObj->id, 'search_levels' => $this->searchLevel),
+                                                       'SET[' . $type . ']',
+                                                       $this->pObj->MOD_SETTINGS[$type],
+                                                       '',
+                                                       '',
+                                                       'id="SET[' . $type . ']"'
+                                               ) . '<label for="SET[' . $type . ']">' . $translation . '</label>';
+                                               $hookSectionMarker['option'] = $option;
+                                               $hookSectionContent .= t3lib_parsehtml::substituteMarkerArray($hookSectionTemplate, $hookSectionMarker, '###|###', TRUE, TRUE);
+                                       }
+                               }
+                       }
+               }
+
+               $checkOptionsTemplate = t3lib_parsehtml::substituteSubpart($checkOptionsTemplate, '###HOOK_SECTION###', $hookSectionContent);
+
+               return t3lib_parsehtml::substituteMarkerArray($checkOptionsTemplate, $markerArray, '###|###', TRUE, TRUE);
+       }
+
+
+       /**
+        * Loads data in the HTML head section (e.g. JavaScript or stylesheet information).
+        *
+        * @return void
+        */
+       protected function loadHeaderData() {
+               $this->doc->addStyleSheet('linkvalidator', $this->relativePath . 'res/linkvalidator.css', 'linkvalidator');
+       }
+
+
+       /**
+        * Gets the buttons that shall be rendered in the docHeader.
+        *
+        * @return array Available buttons for the docHeader
+        */
+       protected function getDocHeaderButtons() {
+               $buttons = array(
+                       'csh' => t3lib_BEfunc::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH']),
+                       'shortcut' => $this->getShortcutButton(),
+                       'save' => ''
+               );
+               return $buttons;
+       }
+
+
+       /**
+        * Gets the button to set a new shortcut in the backend (if current user is allowed to).
+        *
+        * @return string HTML representiation of the shortcut button
+        */
+       protected function getShortcutButton() {
+               $result = '';
+               if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
+                       $result = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']);
+               }
+               return $result;
+       }
+       /**
+        * construct the Hint message displayed on top of the module.
+        *
+        * @return string Hint message displayed on top of the module.
+        */
+       protected function getFirstSteps(){
+               $firstSteps = $GLOBALS['LANG']->getLL('first.steps');
+
+               if ($this->modTS['showUpdateButton'] == 1) {
+                       $firstSteps .= ' ' . $GLOBALS['LANG']->getLL('first.steps.info.update.button');
+               }
+
+               if (t3lib_extMgm::isLoaded('scheduler')) {
+                       if ($GLOBALS['BE_USER']->isAdmin()) {
+                               $firstSteps .= ' ' . 
+                               sprintf($GLOBALS['LANG']->getLL('first.steps.info.scheduler'),
+                                       '<a href="' . t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'typo3/mod.php?M=tools_txschedulerM1">', '</a>'
+                               );
+                       } else {
+                               $firstSteps .= ' ' . $GLOBALS['LANG']->getLL('first.steps.info.scheduler.admin');
+                       }
+               }
+               return $firstSteps;
+       }
+
+       /**
+        * Gets the filled markers that are used in the HTML template.
+        *
+        * @return array The filled marker array
+        */
+       protected function getTemplateMarkers() {
+
+               $markers = array(
+                       'FIRST_STEPS'           => $this->getFirstSteps(),
+                       'FUNC_MENU'             => $this->getLevelSelector(),
+                       'CONTENT'               => $this->content,
+                       'TITLE'                 => $GLOBALS['LANG']->getLL('title'),
+                       'CHECKALLLINK'          => $this->checkAllHtml,
+                       'CHECKOPTIONS'          => $this->checkOptHtml,
+                       'ID'                    => '<input type="hidden" name="id" value="' . $this->pObj->id . '"/>',
+                       'REFRESH'               => $this->refreshListHtml,
+                       'UPDATE'                => $this->updateListHtml
+               );
+
+               return $markers;
+       }
+
+
+       /**
+        * Determines whether the current user is an admin.
+        *
+        * @return boolean Whether the current user is admin
+        */
+       protected function isCurrentUserAdmin() {
+               return ((bool) $GLOBALS['BE_USER']->user['admin']);
+       }
+}
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/modfuncreport/class.tx_linkvalidator_modfuncreport.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/modfuncreport/class.tx_linkvalidator_modfuncreport.php']);
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/modfuncreport/locallang.xml b/typo3/sysext/linkvalidator/modfuncreport/locallang.xml
new file mode 100644 (file)
index 0000000..a6388a0
--- /dev/null
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+       <meta type="array">
+               <description>Labels for the linkvalidator Backend module.</description>
+               <type>module</type>
+               <csh_table></csh_table>
+               <labelContext type="array">
+               </labelContext>
+       </meta>
+       <data type="array">
+               <languageKey index="default" type="array">
+                       <label index="title">Check Links</label>
+                       <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="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="first.steps">Choose the level of pages to check and press "Refresh display" to show the results.</label>
+                       <label index="first.steps.info.update.button">You can update the stored results by pressing "Check links". Note that this process can take some time.</label>
+                       <label index="first.steps.info.scheduler">Alternatively you can also configure the %sTYPO3 Scheduler%s to update the stored results regularly.</label>
+                       <label index="first.steps.info.scheduler.admin">Alternatively your administrator can also configure the TYPO3 Scheduler to update the stored results regularly.</label>
+                       <label index="label_refresh">Refresh display</label>
+                       <label index="label_update">Check links</label>
+                       <label index="overviews.statistics.header">Statistics of broken Links</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="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.field">(Field: %s)</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.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.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.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.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>
+               </languageKey>
+       </data>
+</T3locallang>
diff --git a/typo3/sysext/linkvalidator/modfuncreport/locallang_csh.xml b/typo3/sysext/linkvalidator/modfuncreport/locallang_csh.xml
new file mode 100644 (file)
index 0000000..3856287
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+       <meta type="array">
+               <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 display or to hide 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
diff --git a/typo3/sysext/linkvalidator/modfuncreport/locallang_mod.xml b/typo3/sysext/linkvalidator/modfuncreport/locallang_mod.xml
new file mode 100644 (file)
index 0000000..9631ef1
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+       <meta type="array">
+               <description>Labels for linkvalidator.</description>
+               <type>module</type>
+               <csh_table></csh_table>
+               <labelContext type="array">
+               </labelContext>
+       </meta>
+       <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>
+               </languageKey>
+       </data>
+</T3locallang>
diff --git a/typo3/sysext/linkvalidator/modfuncreport/mod_template.html b/typo3/sysext/linkvalidator/modfuncreport/mod_template.html
new file mode 100644 (file)
index 0000000..11f9cd3
--- /dev/null
@@ -0,0 +1,64 @@
+<!-- ###FULLDOC### begin -->
+                       <h3>###TITLE###</h3>
+                       <p id="linkvalidator_firstSteps">###FIRST_STEPS###</p>
+                       <div class="linkvalidator_funcmenu">###FUNC_MENU######REFRESH######UPDATE###</div>
+                       <div class="linkvalidator_checkoptions">
+                               ###ID###
+                               ###CHECKALLLINK###
+                               ###CHECKOPTIONS###
+                       </div>
+                       ###CONTENT###
+<!-- ###FULLDOC### end -->
+
+
+<!-- ###CHECKOPTIONS_SECTION### begin -->
+       ###STATISTICS_HEADER###
+       <table class="typo3-dblist" id="linkvalidator_statsTable" cellspacing="0" cellpadding="0">
+               <tr class="t3-row-header">
+                       <td>
+                               ###TOTAL_COUNT_LABEL###
+                       </td>
+                       <td class="number">###TOTAL_COUNT###</td>
+               </tr>
+               <!-- ###HOOK_SECTION### begin -->
+               <tr class="db_list_normal">
+                       <td>
+                               <div class="linkvalidator_singleOption">###OPTION###</div>
+                       </td>
+                       <td class="number">###COUNT###</td>
+               </tr>
+               <!-- ###HOOK_SECTION### end -->
+       </table>
+<!-- ###CHECKOPTIONS_SECTION### end -->
+
+
+<!-- ###BROKENLINKS_CONTENT### begin -->
+       ###LIST_HEADER###
+       <table class="typo3-dblist" id="linkvalidator_brokenLinksTable" cellspacing="0" cellpadding="0">
+               <tr class="t3-row-header">
+                       <td></td>
+                       <td>###TABLEHEAD_PATH###</td>
+                       <td>###TABLEHEAD_ELEMENT###</td>
+                       <td>###TABLEHEAD_HEADLINK###</td>
+                       <td>###TABLEHEAD_LINKTARGET###</td>
+                       <td>###TABLEHEAD_LINKMESSAGE###</td>
+                       <td>###TABLEHEAD_LASTCHECK###</td>
+               </tr>
+               <!-- ###BROKENLINKS_ITEM### begin -->
+               <tr class="db_list_normal">
+                       <td>###ACTIONLINK###</td>
+                       <td>###PATH###</td>
+                       <td>###ELEMENT###</td>
+                       <td>###HEADLINK###</td>
+                       <td><a href="###LINKTARGET###" target="_blank">###LINKTARGET###</a></td>
+                       <td>###LINKMESSAGE###</td>
+                       <td>###LASTCHECK###</td>
+               </tr>
+               <!-- ###BROKENLINKS_ITEM### end -->
+       </table>
+<!-- ###BROKENLINKS_CONTENT### end -->
+
+<!-- ###NOBROKENLINKS_CONTENT### begin -->
+       ###LIST_HEADER###
+       ###NO_BROKEN_LINKS###
+<!-- ###NOBROKENLINKS_CONTENT### end -->
index 72ac0eb..a9c7326 100644 (file)
@@ -7,10 +7,9 @@ mod.linkvalidator {
        linktypes = db,file,external
        checkhidden = 0
        showUpdateButton = 1
-       mail{
-               encoding = utf-8
-               fromname =
-               fromemail =
+       mail {
+               fromname = Linkvalidator
+               fromemail = Linkvalidator@example.com
                replytoname =
                replytoemail =
                subject = TYPO3 Linkvalidator report