Merged Linkvalidator (tagged as 4.5beta4)
authorErnesto Baschny <ernst@cron-it.de>
Thu, 13 Jan 2011 00:35:28 +0000 (00:35 +0000)
committerErnesto Baschny <ernst@cron-it.de>
Thu, 13 Jan 2011 00:35:28 +0000 (00:35 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10057 709f56b5-9817-0410-a4d7-c38de5d9e867

39 files changed:
ChangeLog
typo3/sysext/linkvalidator/ChangeLog
typo3/sysext/linkvalidator/README.txt [deleted file]
typo3/sysext/linkvalidator/classes/class.tx_linkvalidator_processing.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_abstract.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_external.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_file.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_interface.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_internal.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_linkhandler.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validate.php [new file with mode: 0644]
typo3/sysext/linkvalidator/classes/tasks/class.tx_linkvalidator_tasks_validateadditionalfieldprovider.php [new file with mode: 0644]
typo3/sysext/linkvalidator/doc/manual.sxw
typo3/sysext/linkvalidator/doc/manual.txt [new file with mode: 0644]
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/lib/class.tx_linkvalidator_checkbase.php [deleted file]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkexternallinks.php [deleted file]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkfilelinks.php [deleted file]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkinternallinks.php [deleted file]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checklinkhandlerlinks.php [deleted file]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_processing.php [deleted file]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_scheduler_link.php [deleted file]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_scheduler_linkAdditionalFieldProvider.php [deleted file]
typo3/sysext/linkvalidator/locallang.xml
typo3/sysext/linkvalidator/modfunc1/class.tx_linkvalidator_modfunc1.php
typo3/sysext/linkvalidator/modfunc1/clear.gif [deleted file]
typo3/sysext/linkvalidator/modfunc1/locallang.xml
typo3/sysext/linkvalidator/modfunc1/locallang_csh.xml [new file with mode: 0644]
typo3/sysext/linkvalidator/modfunc1/locallang_mod.xml
typo3/sysext/linkvalidator/modfunc1/mod_template.html
typo3/sysext/linkvalidator/res/linkvalidator.css
typo3/sysext/linkvalidator/res/mailTemplate.html [deleted file]
typo3/sysext/linkvalidator/res/mailtemplate.html [new file with mode: 0644]
typo3/sysext/linkvalidator/res/pageTSconfig.txt [deleted file]
typo3/sysext/linkvalidator/res/pagetsconfig.txt [new file with mode: 0644]

index c461254..a9ef52e 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -46,6 +46,7 @@
 
 2011-01-12  Ernesto Baschny  <ernst@cron-it.de>
 
+       * Merged Linkvalidator (tagged as 4.5beta4)
        * Merged Pagetree (tagged as 45b4)
        * Fixed bug #16970: Backwards compatibility in PHP_SCRIPT and accessing $this-> methods
        * Fixed bug #16966: be_layout setting "none" is not working and be_layout should not be inherited automatically (Thanks to Jo Hasenau)
index 36a06f4..bd5c035 100644 (file)
@@ -1,6 +1,117 @@
+2011-01-08  Christopher  <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
+       * Fixed bug #12022: Add CSH labels for the labels of the Scheduler job
+       * Fixed bug #12024: Remove cellspacing (thanks to Steffen Gebert)
+       * Fixed bug #12025: Add link to scheduler
+
+2011-01-07  Christopher  <chrissitopher@gmx.de>
+
+       * Followup to bug #11269: Proofread the manual
+       * Followup to bug #11822: Add extension description in ext_emconf.php
+       * Fixed bug #12008: Row "Title" should be called "Headline"
+       * Fixed bug #12009: Display a nice text, if an element does not have a headline
+
+2011-01-07  Pierre Boivin <pierre.boivin@infoglobe.ca>
+
+       * Followup to bug #11794: If website root is active, searching for links does not work
+
+2011-01-06  Christopher  <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 #11269: Proofread the manual
+
+2011-01-05  Pierre Boivin <pierre.boivin@infoglobe.ca>
+
+       * Fixed bug #11794: If website root is active, searching for links does not work
+
+2011-01-05  Christopher  <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>
+
+       * Fixed bug #11889: Clean up CSS
+
+2011-01-03  Christopher  <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>
+
+       * 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>
+
+       * Fixed bug #11822: Add extension description in ext_emconf.php
+       * Fixed bug #11820: Remove comments "End of function xy"
+       * Fixed bug #11817: Use new documentation template for the manual
+       * Fixed bug #11269: Proofread the manual
+       * Fixed bug #11799: Improve usability of the linkvalidator interface
+       * Fixed bug #11834: Do not show the table with the list of broken links, if there are no broken links
+       * Fixed bug #11836: Make use of Flash Messages
+       * 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>
+
+       * 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 #11803: Fix locallang files
+       * Fixed bug #11801: Variable in the message "Page '' does not exist." will never be filled
+       * Fixed bug #11798: Table displaying the number of broken links must be styled
+       * Fixed bug #11813: Give the User Interface a clear structure
+       * Fixed bug #11811: Label tags in Statistics table do not work
+       * 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>
+
+       * Fixed bug #11779: Unify usage of tooltips in table rows
+       * Fixed bug #11775: Table should use new design for TYPO3 4.5
+       * Fixed bug #11796: Improve usage of $GLOBALS['LANG']
+
+2010-12-28  Pierre Boivin <pierre.boivin@infoglobe.ca>
+
+       * Fixed bug #11715: Use localized format for date and time
+
+2010-12-06  Pierre Boivin <pierre.boivin@infoglobe.ca>
+
+       * Fixed bug #11277: Initialize and other methods in modfunc1 could be protected
+       * Fixed bug #11278: Create an interface for the linktype classes
+       * Fixed bug #10589: HTTP errors might not be detected (Thanks to Tolleiv Nietsch)
+       * Fixed bug #11274: Change true to 1 for showUpdateButton
+       * Fixed bug #11272: Fix dos line endings in ext_tables.php
+       * Fixed bug #11270: List in the BE module should be sorted by record
+       * Fixed bug #11275: Remove clear.gif in modfunc1
+       * Fixed bug #10987: linkvalidator doesn't detect hidden pages (Thanks to Joh. Feustel)
+
+2010-12-03  Pierre Boivin <pierre.boivin@infoglobe.ca>
+
+       * Fixed bug #11271: Lowercase all filenames
+       * Fixed bug #11280: Refactor class tx_linkvalidator_processing
+       * Fixed bug #10907: Invalid external url not detected
+
+2010-11-22  Tolleiv Nietsch  <info@tolleiv.de>
+
+       * Fixed bug #10988: getBrokenUrl returns wrong url (Thanks to Johannes Feustel)
+
+2010-11-20  Christian Kuhn  <lolli@schwarzbu.ch>
+
+       * Fixed bug #10998: Rename and move link classes and processing class
+
 2010-11-17  Christian Kuhn  <lolli@schwarzbu.ch>
 
+       * Fixed bug #10912: Rename and move task to classes/tasks and change locallang namespace
        * Fixed bug #10900: Regression: Fatal error in class.tx_linkvalidator_modfunc1.php
+       * Tagging version 1.0.0
        * Fixed bug #10892: Basic cleanup throughout the extension
        * Fixed bug #10891: Fix deprecation warning "call by reference" in modfunc1
        * Fixed bug #10820: Error and warning in scheduler task
 2010-11-11  Michael Miousse  <michael.miousse@infoglobe.ca>
 
        * Fixed bug #10740: news field added in the table tx_linkvalidator_links, 2 new index in locallang.xml for the header of the new column and the format of the string in the column, news column added in tx_linkvalidator_modfunc1 and time() saved in the new field added to the table tx_linkvalidator_links
-       * Fixed bug #10737:  news mod tsconfig added to remove the check link button. mod.linkvalidator.noUpdateButton = 0
-       * Fixed bug #10739 : Button added in tx_linkvalidator_modfunc1, news index in the locallang file, new marquer in the template mod_template.html and new css
-       * Fixed bug #10736: automatic refresh on changing selection of depth level has been removed
-       * Fixed bug #10643: modification of the line 166, add of is_array check before doing a array_search
+       * Fixed bug #10737: news mod tsconfig added to remove the check link button. mod.linkvalidator.noUpdateButton = 0
+       * Fixed bug #10739: Refresh Button added in tx_linkvalidator_modfunc1, news index in the locallang file, new marquer in the template mod_template.html and new css
+       * Fixed bug #10736: Automatic refresh on changing selection of depth level has been removed
+       * Fixed bug #10643: Fix PHP Warning "array_search() expects parameter 2 to be array, null given" in modfunc1/class.tx_linkvalidator_modfunc1.php
 
 2010-11-03  Tolleiv Nietsch  <info@tolleiv.de>
 
-       * Fixed bug #10598: - extend tx_linkvalidator_checkbase API a bit
+       * Fixed bug #10598: Extend tx_linkvalidator_checkbase API a bit
 
-2010-07-19 Jochen Rieger / Dimitri Knig / Michael Miousse  <j.rieger@connecta.ag, mmiousse@infoglobe.ca>
+2010-07-19  Jochen Rieger / Dimitri König / Michael Miousse  <j.rieger@connecta.ag, mmiousse@infoglobe.ca>
 
        * initial code generated with kickstarter
diff --git a/typo3/sysext/linkvalidator/README.txt b/typo3/sysext/linkvalidator/README.txt
deleted file mode 100644 (file)
index 2b9aebe..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-Feel free to add some documentation or simply add a link to the online manual.
diff --git a/typo3/sysext/linkvalidator/classes/class.tx_linkvalidator_processing.php b/typo3/sysext/linkvalidator/classes/class.tx_linkvalidator_processing.php
new file mode 100644 (file)
index 0000000..6e6e718
--- /dev/null
@@ -0,0 +1,300 @@
+<?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/linktypes/class.tx_linkvalidator_linktypes_abstract.php b/typo3/sysext/linkvalidator/classes/linktypes/class.tx_linkvalidator_linktypes_abstract.php
new file mode 100644 (file)
index 0000000..eb8352c
--- /dev/null
@@ -0,0 +1,80 @@
+<?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
new file mode 100644 (file)
index 0000000..4a6e235
--- /dev/null
@@ -0,0 +1,173 @@
+<?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
new file mode 100644 (file)
index 0000000..9fb7b52
--- /dev/null
@@ -0,0 +1,79 @@
+<?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
new file mode 100644 (file)
index 0000000..77fa133
--- /dev/null
@@ -0,0 +1,46 @@
+<?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
new file mode 100644 (file)
index 0000000..b3c01a7
--- /dev/null
@@ -0,0 +1,127 @@
+<?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
new file mode 100644 (file)
index 0000000..786cc09
--- /dev/null
@@ -0,0 +1,137 @@
+<?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
new file mode 100644 (file)
index 0000000..dd23bb2
--- /dev/null
@@ -0,0 +1,254 @@
+<?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
new file mode 100644 (file)
index 0000000..6fc6165
--- /dev/null
@@ -0,0 +1,273 @@
+<?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
index 7f52464..5d061c5 100644 (file)
Binary files a/typo3/sysext/linkvalidator/doc/manual.sxw and b/typo3/sysext/linkvalidator/doc/manual.sxw differ
diff --git a/typo3/sysext/linkvalidator/doc/manual.txt b/typo3/sysext/linkvalidator/doc/manual.txt
new file mode 100644 (file)
index 0000000..8f51c7a
--- /dev/null
@@ -0,0 +1,179 @@
+Manual for Linkvalidator
+Extension Key: linkvalidator
+Language: en
+Version: 1.0.0
+Keywords: forEditors, forAdmins, forBeginners, forIntermediates, forAdvanced
+Copyright 2000-2011, Linkvalidator Team, <j.rieger@connecta.ag>, <mmiousse@infoglobe.ca>
+
+This document is published under the Open Content License
+available from http://www.opencontent.org/opl.shtml
+
+The content of this document is related to TYPO3 
+- a GNU/GPL CMS/Framework available from www.typo3.org
+
+
+
+
+
+Official documentation
+This document is included as part of the official TYPO3 documentation. It has been approved by the TYPO3 Documentation Team following a peer-review process. The reader should expect the information in this document to be accurate - please report discrepancies to the Documentation Team (documentation@typo3.org). Official documents are kept up-to-date to the best of the Documentation Team's abilities.
+
+Core Manual
+This document is a Core Manual. Core Manuals address the built in functionality of TYPO3 and are designed to provide the reader with in-depth information. Each Core Manual addresses a particular process or function and how it is implemented within the TYPO3 source code. These may include information on available APIs, specific configuration options, etc.
+Core Manuals are written as reference manuals. The reader should rely on the Table of Contents to identify what particular section will best address the task at hand.
+Table of Contents
+Manual for Linkvalidator       1
+Introduction   3
+About this document    3
+What's new     3
+Credits        3
+Feedback       3
+Introduction   4
+What does it do?       4
+Screenshots    4
+Administration 6
+Configuration  7
+Reference      7
+Hint for large sites   9
+Next steps     10
+
+
+Introduction
+About this document
+Linkvalidator is a system extension which enables you to conveniently check your website for broken links. This manual explains how to install and configure the extension for your needs. 
+What's new
+The extension is based on cag_linkchecker. For inclusion in TYPO3 4.5 the code has undergone a major overhaul. As a result not only some bugs were fixed, but also the styling was adapted and a brand new scheduler task added. 
+Credits
+This extension is particularly based on the extension "cag_linkchecker", which was originally developed for Connecta AG, Wiesbaden. cag_linkchecker is maintained by Jochen Rieger and Dimitri König. 
+Feedback
+For general questions about the documentation get in touch by writing to documentation@typo3.org.
+If you find a bug in this manual, please file an issue in the bug tracker of this extension: http://forge.typo3.org/projects/extension-linkvalidator/issues
+Maintaining quality documentation is hard work and the Documentation Team is always looking for volunteers. If you feel like helping please join the documentation mailing list (typo3.projects.documentation on lists.typo3.org).
+
+Introduction
+What does it do?
+Linkvalidator checks the links in your website for validity, reports broken links or missing files in your TYPO3 installation and provides a way to conveniently fix these problems. 
+
+It includes the following features: 
+Linkvalidator can check all kinds of links. This includes internal links to content elements, file links to files in the local file system and external links to files somewhere else in the web. 
+Linkvalidator by default looks into header fields and bodytext fields. It can be configured to check any field you like. 
+Linkvalidator offers a just in time check of your website. Additionally the TYPO3 scheduler is fully supported to run checks automatically. In this case you can choose, if you want to receive an email report, if broken links were found. 
+Linkvalidator is extendable. It provides hooks to check special types of links like those from the extension "linkhandler". The possibility to check these already is built in. 
+
+Screenshots
+This is the linkvalidator backend module. It is located inside the info module. 
+
+
+The workflow in the module is the following: 
+First you set the depth of pages you want to consider when viewing the results and when checking for broken links. 
+In the statistics table you then already see the number of broken links in the selected pages. Choose the kinds of links to display! 
+The results are finally displayed in the table at the bottom. The type and ID of the content containing the broken link becomes visible when you move the mouse over the icon for the content type. The pencil icons at the beginning of each row enable you to quickly fix the displayed elements. 
+
+Linkvalidator features full support of the TYPO3 scheduler. This is the linkvalidator task: 
+With this task you can run linkvalidator regularly via cron without having to manually update the cached information on broken links. 
+You can e.g. overwrite the TypoScript configuration. Without any change, the linkvalidator settings which apply for the respective pages will be used. If you set values there, the former will be overwritten. 
+The linkvalidator task can send you a status report via email. You can create an own email template as needed. The default template is located in typo3/sysext/linkvalidator/res/mailtemplate.html. 
+Administration
+Use the extension manager to install linkvalidator. It is not installed by default. 
+Apply the needed changes to the database. 
+
+
+Configuration
+You find the standard configuration in typo3/sysext/linkvalidator/res/pagetsconfig.txt. 
+This may serve you as an example on how to configure the extension for your needs. 
+
+Reference
+You can set the following options in the TSconfig for a page (e.g. the root page) and override them in user or groups TSconfig. You must prefix them with mod.linkvalidator, e.g. mod.linkvalidator.searchFields.pages = media. 
+Property
+Data type
+Description
+Default
+searchFields.[key]
+string
+Comma separated list of table fields in which to check for broken links. 
+
+Example:
+
+pages = media,url
+pages = media,url
+tt_content = bodytext,header_link,records
+tt_news = bodytext,links
+linktypes
+string
+Comma separated list of hooks to load. 
+
+Possible values: 
+
+db: Check links to database records. 
+file: Check links to files located in your local TYPO3 installation. 
+external: Check links to external files. 
+linkhandler: Check links provided by the extension "linkhandler". 
+db,file,external
+checkhidden
+boolean
+If set, hidden content elements are checked for broken links, too. 
+0
+showUpdateButton
+boolean
+If set, the backend module shows a "Check Links" button to trigger the check for broken links directly. 
+
+
+Note: Depending on the number of page levels to check and on the number of links in these pages, this check can take some time and need some resources. For large sites it might therefore be advisable to hide the button. 
+
+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. 
+
+mail.fromemail
+string
+Set the from email of the report mail sent by the cron script. 
+
+mail.replytoname
+string
+Set the replyto name of the report mail sent by the cron script. 
+
+mail.replytoemail
+string
+Set the replyto email of the report mail sent by the cron script. 
+
+mail.subject
+string
+Set the subject of the report mail sent by the cron script. 
+TYPO3 Linkvalidator report
+[page:mod.linkvalidator; beuser:mod.linkvalidator]
+
+Example:
+mod.linkvalidator {
+       searchFields {
+               pages = media,url
+               tt_content = bodytext,header_link,records
+               tt_news = bodytext,links
+       }
+       linktypes = db,file,external
+       checkhidden = 0
+       mail {
+               encoding = utf-8
+               fromname =
+               fromemail =
+               replytoname =
+               replytoemail =
+               subject = TYPO3 Linkvalidator report
+       }
+}
+
+
+Hint for large sites
+If you have a website with many hundreds of pages, checking all links will take some time and might lead to a time out. It will also need some resources so that it might make sense to do the check at night. If you want to check many pages, you should not use the button "Check Links" in the backend module of linkvalidator. Use the TYPO3 scheduler instead. The task provided by linkvalidator will cache the broken links just like the button "Check Links" would do. Afterwards you can use the backend module as usual to fix the according elements. 
+If you still want to check trees with many pages just in time, set the depth to a reasonable level like 2 or 3. Do not use "infinite". 
+
+
+Next steps
+If you need more information on how to use the TYPO3 scheduler to run linkvalidator regularly via cron job, please refer to the scheduler manual. You can open it from the TYPO3 extension manager. 
+
+
index ed6ee6c..4df9468 100644 (file)
@@ -2,10 +2,16 @@
 $extensionPath = t3lib_extMgm::extPath('linkvalidator');
 
 return array(
-       'tx_linkvalidator_processing' => $extensionPath . 'lib/class.tx_linkvalidator_processing.php',
-       'tx_linkvalidator_scheduler_linkadditionalfieldprovider' => $extensionPath . 'lib/class.tx_linkvalidator_scheduler_linkAdditionalFieldProvider.php',
-       'tx_linkvalidator_scheduler_link'  => $extensionPath . 'lib/class.tx_linkvalidator_scheduler_link.php',
-       'tx_linkvalidator_checkbase'  => $extensionPath . 'lib/class.tx_linkvalidator_checkbase.php',
+       '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_processing' => $extensionPath . 'classes/class.tx_linkvalidator_processing.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',
 );
 ?>
\ No newline at end of file
index a6d26e3..7fd7e42 100644 (file)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext "linkvalidator".
 #
-# Auto generated 20-10-2010 19:34
+# Auto generated 12-01-2011 17:43
 #
 # Manual updates:
 # Only the data in the array - everything else is removed by next
@@ -11,8 +11,8 @@
 ########################################################################
 
 $EM_CONF[$_EXTKEY] = array(
-       'title' => 'Link validator',
-       'description' => '',
+       'title' => 'Linkvalidator',
+       'description' => 'Linkvalidator checks the links in your website for validity. It can validate all kinds of links: internal, external and file links. Scheduler is supported to run Linkvalidator via Cron including the option to send status mails, if broken links were detected.',
        'category' => 'module',
        'author' => 'Jochen Rieger / Dimitri König / Michael Miousse',
        'author_email' => 'j.rieger@connecta.ag, mmiousse@infoglobe.ca',
@@ -41,7 +41,7 @@ $EM_CONF[$_EXTKEY] = array(
                'suggests' => array(
                ),
        ),
-       '_md5_values_when_last_written' => 'a:26:{s:9:"ChangeLog";s:4:"605b";s:10:"README.txt";s:4:"ee2d";s:16:"ext_autoload.php";s:4:"e79b";s:12:"ext_icon.gif";s:4:"6bc7";s:17:"ext_localconf.php";s:4:"539f";s:14:"ext_tables.php";s:4:"338c";s:14:"ext_tables.sql";s:4:"61f1";s:13:"locallang.xml";s:4:"6351";s:19:"doc/wizard_form.dat";s:4:"ecc2";s:20:"doc/wizard_form.html";s:4:"633b";s:40:"lib/class.tx_linkvalidator_checkbase.php";s:4:"f228";s:49:"lib/class.tx_linkvalidator_checkexternallinks.php";s:4:"13b4";s:45:"lib/class.tx_linkvalidator_checkfilelinks.php";s:4:"03cb";s:49:"lib/class.tx_linkvalidator_checkinternallinks.php";s:4:"4706";s:52:"lib/class.tx_linkvalidator_checklinkhandlerlinks.php";s:4:"2f8b";s:41:"lib/class.tx_linkvalidator_processing.php";s:4:"c757";s:45:"lib/class.tx_linkvalidator_scheduler_link.php";s:4:"00b5";s:68:"lib/class.tx_linkvalidator_scheduler_linkAdditionalFieldProvider.php";s:4:"8f02";s:44:"modfunc1/class.tx_linkvalidator_modfunc1.php";s:4:"e604";s:18:"modfunc1/clear.gif";s:4:"cc11";s:22:"modfunc1/locallang.xml";s:4:"88fb";s:26:"modfunc1/locallang_mod.xml";s:4:"a53c";s:26:"modfunc1/mod_template.html";s:4:"25a9";s:21:"res/linkvalidator.css";s:4:"6e83";s:21:"res/mailTemplate.html";s:4:"51f6";s:20:"res/pageTSconfig.txt";s:4:"8d5f";}',
+       '_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";}',
        'suggests' => array(
        ),
 );
index 73ba3f9..627a469 100644 (file)
@@ -3,22 +3,22 @@ if (!defined ('TYPO3_MODE')) {
        die ('Access denied.');
 }
 
-t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:linkvalidator/res/pageTSconfig.txt">');
+t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:linkvalidator/res/pagetsconfig.txt">');
 
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_linkvalidator_scheduler_link'] = array(
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_linkvalidator_tasks_Validate'] = array(
     'extension'        => $_EXTKEY,
-    'title'            => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:link.name',
-    'description'      => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:link.description',
-    'additionalFields' => 'tx_linkvalidator_scheduler_linkAdditionalFieldProvider'
+    'title'            => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:tasks.validate.name',
+    'description'      => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:tasks.validate.description',
+    'additionalFields' => 'tx_linkvalidator_tasks_ValidateAdditionalFieldProvider'
 );
 
 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/lib/class.tx_linkvalidator_checkinternallinks.php:tx_linkvalidator_checkinternallinks';
-$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks']['file'] = 'EXT:linkvalidator/lib/class.tx_linkvalidator_checkfilelinks.php:tx_linkvalidator_checkfilelinks';
-$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks']['external'] = 'EXT:linkvalidator/lib/class.tx_linkvalidator_checkexternallinks.php:tx_linkvalidator_checkexternallinks';
-$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks']['linkhandler'] = 'EXT:linkvalidator/lib/class.tx_linkvalidator_checklinkhandlerlinks.php:tx_linkvalidator_checklinkhandlerlinks';
+$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';
 
-?>
+?>
\ No newline at end of file
index ab1bf7c..0880926 100644 (file)
@@ -1,13 +1,19 @@
-<?php\r
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');\r
-if (TYPO3_MODE == 'BE') {\r
-\r
-               // add module\r
+<?php
+if (!defined ('TYPO3_MODE')) {
+       die ('Access denied.');
+}
+
+if (TYPO3_MODE == 'BE') {
+               // add module
        t3lib_extMgm::insertModuleFunction(
                'web_info',
                'tx_linkvalidator_modfunc1',
-               t3lib_extMgm::extPath('linkvalidator').'modfunc1/class.tx_linkvalidator_modfunc1.php',
+               t3lib_extMgm::extPath('linkvalidator') . 'modfunc1/class.tx_linkvalidator_modfunc1.php',
                'LLL:EXT:linkvalidator/locallang.xml:mod_linkvalidator'
-       );\r
-}\r
-?>\r
+       );
+}
+
+       // Initialize Context Sensitive Help (CSH)
+t3lib_extMgm::addLLrefForTCAdescr('linkvalidator', 'EXT:linkvalidator/modfunc1/locallang_csh.xml');
+
+?>
\ No newline at end of file
index d2e9628..f1507bd 100644 (file)
@@ -8,7 +8,7 @@ CREATE TABLE tx_linkvalidator_links (
        linktitle text,
        url text,
        urlresponse text,
-    lastcheck int(11) DEFAULT '0' NOT NULL,
+       lastcheck int(11) DEFAULT '0' NOT NULL,
        typelinks varchar(50) DEFAULT '' NOT NULL,
 
        PRIMARY KEY (uid)
diff --git a/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkbase.php b/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkbase.php
deleted file mode 100644 (file)
index 2782ddb..0000000
+++ /dev/null
@@ -1,61 +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>
- */
-abstract class tx_linkvalidator_checkbase {
-
-       abstract 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
-        */
-       function fetchType($value, $type, $key) {
-               if ($value['type'] == $key) {
-                       $type = $value['type'];
-               }
-               return $type;
-       }
-
-       /**
-        * Base url parsing
-        *
-        * @param       array           $row: broken link record
-        * @return      string          parsed broken url
-        */
-       function getBrokenUrl($row) {
-               return $row['url'];
-       }
-}
-
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkexternallinks.php b/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkexternallinks.php
deleted file mode 100644 (file)
index 2f58f5f..0000000
+++ /dev/null
@@ -1,90 +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>
- */
-class tx_linkvalidator_checkexternallinks extends tx_linkvalidator_checkbase {
-
-       var $url_reports = 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          validation error message or succes code
-        */
-       function checkLink($url, $softRefEntry, $reference) {
-               if ($this->url_reports[$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 (just fetching of headers doesn't work!)
-               $report = array();
-               t3lib_div::getURL($url, 1, FALSE, $report);
-
-               $ret = 1;
-
-               // analyze the response
-               if ($report['error']) {
-                       $ret = $GLOBALS['LANG']->getLL('list.report.noresponse');
-               }
-
-               $this->url_reports[$url] = $ret;
-               return $ret;
-       }
-
-       /**
-        * get the external type from the softRefParserObj result.
-        *
-        * @param   array         $value: reference properties
-        * @param   string       $type: current type
-        * @return      string          fetched type
-        */
-       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/lib/class.tx_linkvalidator_checkexternallinks.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_checkexternallinks.php']);
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkfilelinks.php b/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkfilelinks.php
deleted file mode 100644 (file)
index e8fbe2a..0000000
+++ /dev/null
@@ -1,54 +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>
- */
-class tx_linkvalidator_checkfilelinks extends tx_linkvalidator_checkbase {
-
-       /**
-        * 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
-        */
-       function checkLink($url, $softRefEntry, $reference) {
-               if (!@file_exists(PATH_site . rawurldecode($url))) {
-                       return $GLOBALS['LANG']->getLL('list.report.filenotexisting');
-               }
-
-               return 1;
-       }
-}
-
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_checkfilelinks.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_checkfilelinks.php']);
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkinternallinks.php b/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkinternallinks.php
deleted file mode 100644 (file)
index 5cf1aa1..0000000
+++ /dev/null
@@ -1,77 +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>
- */
-class tx_linkvalidator_checkinternallinks extends tx_linkvalidator_checkbase {
-
-       /**
-        * 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
-        */
-       function checkLink($url, $softRefEntry, $reference) {
-               $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
-                       'uid, deleted, title',
-                       'pages',
-                       'uid = ' . intval($url)
-               );
-
-               if ($rows[0]) {
-                       if ($rows[0]['deleted'] == '1') {
-                               $response = $GLOBALS['LANG']->getLL('list.report.pagedeleted');
-                               $response = str_replace('###title###', $rows[0]['title'], $response);
-                               return $response;
-                       }
-               } else {
-                       return $GLOBALS['LANG']->getLL('list.report.pagenotexisting');
-               }
-
-               return 1;
-       }
-
-       /**
-        * Url parsing
-        *
-        * @param   array          $row: broken link record
-        * @return  string        parsed broken url
-        */
-       function getBrokenUrl($row) {
-               $domaine = t3lib_BEfunc::getViewDomain($row['pid']);
-               return $domaine . 'index.php?id=' . $row['url'];
-       }
-}
-
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_checkinternallinks.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_checkinternallinks.php']);
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checklinkhandlerlinks.php b/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checklinkhandlerlinks.php
deleted file mode 100644 (file)
index 6ceffd4..0000000
+++ /dev/null
@@ -1,98 +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>
- */
-class tx_linkvalidator_checklinkhandlerlinks extends tx_linkvalidator_checkbase {
-       public $tsconfig;
-
-       /**
-        * 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        validation error message or succes code
-        */
-       function checkLink($url, $softRefEntry, $reference) {
-               $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)
-                       );
-                       $title = 'Link';
-                       if ($this->tsconfig['properties'][$tablename . '.']) {
-                               $title = $this->tsconfig['properties'][$tablename . '.']['label'];
-                       }
-                       if ($rows[0]) {
-                               if ($rows[0]['deleted'] == '1') {
-                                       $response = $GLOBALS['LANG']->getLL('list.report.rowdeleted');
-                                       $response = str_replace('###title###', $title, $response);
-                                       return $response;
-                               }
-                       } else {
-                               $response = $GLOBALS['LANG']->getLL('list.report.rownotexisting');
-                               $response = str_replace('###title###', $title, $response);
-                               return $response;
-                       }
-               }
-
-               return 1;
-       }
-
-       /**
-        * type fetching method, based on the type that softRefParserObj returns.
-        *
-        * @param   array         $value: reference properties
-        * @param   string       $type: current type
-        * @return  string       fetched type
-        */
-       function fetchType($value, $type) {
-               if ($type == 'string' && strtolower(substr($value['tokenValue'], 0, 7)) == 'record:') {
-                       $type = 'linkhandler';
-               }
-               return $type;
-       }
-}
-
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_checklinkhandlerlinks.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_checklinkhandlerlinks.php']);
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_processing.php b/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_processing.php
deleted file mode 100644 (file)
index 68c9f8b..0000000
+++ /dev/null
@@ -1,227 +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>
- */
-
-$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 links type 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 comat separated page uid 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 it in tx_linkvalidator_links
-        * @param       array           $checkOptions: list of hook object to activate
-        * @param       int                     $hidden: define if 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)) {
-
-                                       // 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');
-                                       // get all references
-                               foreach ($fields as $field) {
-                                       $haystack .= $row[$field] . ' --- ';
-                                       $conf = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
-                                               // Check if a TCA configured field has softreferences defined (see TYPO3 Core API document)
-                                       if ($conf['softref'] && strlen($row[$field])) {
-                                                       // 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 (is_object($softRefObj)) { // If there was an object returned...:
-                                                                       // Do processing
-                                                               $resultArray = $softRefObj->findRef($table, $field, $row['uid'], $row[$field], $spKey, $spParams);
-                                                               if (!empty($resultArray['elements'])) {
-
-                                                                       $tagAttr = array();
-                                                                       if ($spKey == 'typolink_tag') {
-                                                                               $linkTags = $htmlParser->splitIntoBlock('link', $resultArray['content']);
-                                                                               foreach ($linkTags as $tag) {
-                                                                                       $attr = $htmlParser->split_tag_attributes($tag);
-                                                                                       $tagAttr[$tag] = $attr[0];
-                                                                               }
-                                                                       }
-                                                                       foreach ($resultArray['elements'] as $element) {
-                                                                               $r = $element['subst'];
-                                                                               $title = '';
-                                                                                       // Parse string for special TYPO3 <link> tag:
-
-                                                                               if ($spKey == 'typolink_tag') {
-                                                                                       foreach ($tagAttr as $tag => $attr) {
-                                                                                               if (in_array('{softref:' . $r['tokenID'] . '}', $attr)) {
-                                                                                                       $title = strip_tags($tag);
-                                                                                               }
-                                                                                       }
-                                                                               }
-                                                                               $type = '';
-                                                                               if (!empty($r)) {
-                                                                                       foreach ($this->hookObjectsArr as $key => $hookObj) {
-                                                                                               $type = $hookObj->fetchType($r, $type, $key);
-                                                                                       }
-                                                                                       $results[$type][$table . ':' . $field . ':' . $row['uid'] . ':' . $r["tokenID"]]["substr"] = $r;
-                                                                                       $results[$type][$table . ':' . $field . ':' . $row['uid'] . ':' . $r["tokenID"]]["row"] = $row;
-                                                                                       $results[$type][$table . ':' . $field . ':' . $row['uid'] . ':' . $r["tokenID"]]["table"] = $table;
-                                                                                       $results[$type][$table . ':' . $field . ':' . $row['uid'] . ':' . $r["tokenID"]]["field"] = $field;
-                                                                                       $results[$type][$table . ':' . $field . ':' . $row['uid'] . ':' . $r["tokenID"]]["uid"] = $row['uid'];
-                                                                                       $results[$type][$table . ':' . $field . ':' . $row['uid'] . ':' . $r["tokenID"]]["linktitle"] = $title;
-                                                                               }
-
-                                                                       }
-                                                               }
-                                                       }
-                                               }
-                                       }
-                               }
-                       } // end while ($row = ...)
-               } // end foreach $table
-
-               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 != 1) {
-                                               $this->brokenLinkCounts[$table]++;
-                                               $record['typelinks'] = $key;
-                                               $record['url'] = $url;
-                                               $record['urlresponse'] = '<span style="color:red">' . $checkURL . '</span>';
-                                               $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_linkvalidator_links', $record);
-                                       } elseif (t3lib_div::_GP('showalllinks')) {
-                                               $this->brokenLinkCounts[$table]++;
-                                               $record['url'] = $url;
-                                               $record['typelinks'] = $key;
-                                               $record['urlresponse'] = '<span style="color:green">OK</span>';
-                                               $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_linkvalidator_links', $record);
-                                       }
-
-                               }
-                       }
-               }
-
-       } // end function getLinkStatistics
-
-       /**
-        * Fill a markerarray with the number of link found in a list of page.
-        * @param   string        $curPage: commat separeted page uid list
-        * @return  array          markerarray with the number of link found
-        */
-       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;
-       }
-
-}
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_processing.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_processing.php']);
-}
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_scheduler_link.php b/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_scheduler_link.php
deleted file mode 100644 (file)
index f70100f..0000000
+++ /dev/null
@@ -1,270 +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>
- */
-class tx_linkvalidator_scheduler_link 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 $key => $value) {
-                                                       if (in_array($key, $linktypes)) {
-                                                               $array[$key] = 1;
-                                                       }
-                                               }
-                                       }
-                               }
-                               $pageIds = $this->extGetTreeList($page, $this->depth, 0, '1=1');
-                               $pageIds .= $page;
-                               $processing = t3lib_div::makeInstance('tx_linkvalidator_processing');
-                               $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;
-       } // end function execute()
-
-       /**
-        * Build and send the new borken links found warning email.
-        *
-        * @param       string          $pageSections: Content of page section
-        * @param       string          $modTS: TsConfig array
-        * @return      bool            Mail sended 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;
-       }
-
-       /**
-        * 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-uid's 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 uid's. 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!)
-        */
-       function extGetTreeList($id, $depth, $begin = 0, $perms_clause) {
-               return t3lib_tsfeBeUserAuth::extGetTreeList($id, $depth, $begin, $perms_clause);
-       }
-
-
-       /**
-        * 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/lib/class.tx_linkvalidator_scheduler_link.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_scheduler_link.php']);
-}
-?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_scheduler_linkAdditionalFieldProvider.php b/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_scheduler_linkAdditionalFieldProvider.php
deleted file mode 100644 (file)
index b341987..0000000
+++ /dev/null
@@ -1,261 +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>
- */
-class tx_linkvalidator_scheduler_linkAdditionalFieldProvider 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 (Scheduler's BE module)
-        * @return      array           additionnal 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'] . '"/>';
-
-
-               $additionalFields[$fieldID] = array(
-                       'code' => $fieldCode,
-                       'label' => 'LLL:EXT:linkvalidator/locallang.xml:link.page'
-               );
-
-                       // input for depth
-               $fieldID = 'task_depth';
-               $fieldValueArray = array(
-                       '0' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_0'),
-                       '1' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_1'),
-                       '2' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_2'),
-                       '3' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_3'),
-                       '4' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_4'),
-                       '999' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_infi'),
-               );
-               $fieldCode = '<select name="tx_scheduler[depth]" id="' . $fieldID . '">';
-
-               foreach ($fieldValueArray as $key => $label) {
-                       $fieldCode .= "\t" . '<option value="' . $key . '"' . (($key == $taskInfo['depth']) ? ' selected="selected"' : '') . '>' . $label . '</option>';
-               }
-
-               $fieldCode .= '</select>';
-               $additionalFields[$fieldID] = array(
-                       'code' => $fieldCode,
-                       'label' => 'LLL:EXT:linkvalidator/locallang.xml:link.depth'
-               );
-
-               $fieldID = 'task_configuration';
-               $fieldCode = '<textarea  name="tx_scheduler[configuration]" id="' . $fieldID . '" >' . $taskInfo['configuration'] . '</textarea>';
-
-               $additionalFields[$fieldID] = array(
-                       'code' => $fieldCode,
-                       'label' => 'LLL:EXT:linkvalidator/locallang.xml:link.conf'
-               );
-
-               $fieldID = 'task_email';
-               $fieldCode = '<input type="text"  name="tx_scheduler[email]" id="' . $fieldID . '" value="' . $taskInfo['email'] . '" />';
-
-               $additionalFields[$fieldID] = array(
-                       'code' => $fieldCode,
-                       'label' => 'LLL:EXT:linkvalidator/locallang.xml:link.email'
-               );
-               $fieldID = 'task_emailonbrokenlinkonly';
-               $fieldCode = '<input type="checkbox"  name="tx_scheduler[emailonbrokenlinkonly]" id="' . $fieldID . '" ' . ($taskInfo['emailonbrokenlinkonly'] ? 'checked="checked"' : '') . ' />';
-
-               $additionalFields[$fieldID] = array(
-                       'code' => $fieldCode,
-                       'label' => 'LLL:EXT:linkvalidator/locallang.xml:link.emailonbrokenlinkonly'
-               );
-               $fieldID = 'task_emailfile';
-               $fieldCode = '<input type="text"  name="tx_scheduler[emailfile]" id="' . $fieldID . '" value="' . $taskInfo['emailfile'] . '" />';
-
-               $additionalFields[$fieldID] = array(
-                       'code' => $fieldCode,
-                       'label' => 'LLL:EXT:linkvalidator/locallang.xml:link.emailfile'
-               );
-
-               return $additionalFields;
-       } // end function getAdditionalFields()
-
-       /**
-        * 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          Selected html 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 (Scheduler's BE module)
-        * @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:linkvalidator_im.invalidEmail'),
-                                               t3lib_FlashMessage::ERROR
-                                       );
-                               }
-                       }
-               }
-
-               if ($res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'uid = ' . $submittedData['page'])) {
-                       if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) != 1) {
-                               $isValid = FALSE;
-                               $schedulerModule->addMessage(
-                                       $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:linkvalidator_im.invalidPage'),
-                                       t3lib_FlashMessage::ERROR
-                               );
-                       }
-               } else {
-                       $isValid = FALSE;
-                       $schedulerModule->addMessage(
-                               $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:linkvalidator_im.invalidPage'),
-                               t3lib_FlashMessage::ERROR
-                       );
-               }
-
-               if ($submittedData['depth'] < 0) {
-                       $isValid = FALSE;
-                       $schedulerModule->addMessage(
-                               $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:linkvalidator_im.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/lib/class.tx_linkvalidator_scheduler_linkAdditionalFieldProvider.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_scheduler_linkAdditionalFieldProvider.php']);
-}
-
-?>
\ No newline at end of file
index 372e788..3bf3435 100644 (file)
@@ -1,28 +1,26 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <T3locallang>
-    <meta type="array">
-        <description>Labels for linkvalidator mod1</description>
-        <type>module</type>
-        <csh_table></csh_table>
-        <labelContext type="array">
-        </labelContext>
-    </meta>
-    <data type="array">
-        <languageKey index="default" type="array">
-            <label index="mod_linkvalidator">Link validator</label>
-            <label index="link.name">Link validator</label>
-            <label index="link.page">Start page</label>
-            <label index="link.depth">Depth</label>
-            <label index="link.conf">tsconfig override</label>
-            <label index="link.email">Send repport to</label>
-            <label index="link.emailonbrokenlinkonly">Send email on news broken links only</label>
-            <label index="link.emailfile">Email template file</label>
-            <label index="link.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="linkvalidator_im.invalidEmail">Invalid email format!</label>
-            <label index="linkvalidator_im.invalidPage">Invalid page uid, please enter a valid page uid!</label>
-            <label index="linkvalidator_im.invalidDepth">There is no depth set, please set it to a value!</label>
-            
-       
-        </languageKey>
-    </data>
+       <meta type="array">
+               <description>Labels for the linkvalidator task.</description>
+               <type>module</type>
+               <csh_table></csh_table>
+               <labelContext type="array">
+               </labelContext>
+       </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="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.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>
+               </languageKey>
+       </data>
 </T3locallang>
index a16680d..83f656e 100644 (file)
@@ -39,6 +39,8 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
        protected $relativePath;
        protected $pageRecord = array();
        protected $isAccessibleForCurrentUser = FALSE;
+       
+       protected $processing;
 
        /**
         * Main method of modfunc1
@@ -50,8 +52,18 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
 
                $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;
                                }
@@ -60,25 +72,41 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
 
                $this->initialize();
 
-               $this->modTS = t3lib_BEfunc::getModTSconfig($this->pObj->id, 'mod.linkvalidator');
-               $this->modTS = $this->modTS['properties'];
-               if ($this->modTS['showUpdateButton'] === 'true' || $this->modTS['showUpdateButton'] === 1) {
+               $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') . '"/>';
-               $processing = t3lib_div::makeInstance('tx_linkvalidator_processing');
-               $this->updateBrokenLinks($processing);
 
-               $brokenLinkOverView = $processing->getLinkCounts($this->pObj->id);
+               $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();
-       } // end function main()
+       }
+
 
        /**
-        * Initialize menu array internally
+        * Initializes the menu array internally.
         *
         * @return      Module          menu
         */
@@ -94,15 +122,15 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
                }
 
                return $modMenu;
-       } // end function modMenu()
+       }
 
 
        /**
-        * Initializes the Module
+        * Initializes the Module.
         *
         * @return      void
         */
-       public function initialize() {
+       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);
@@ -127,16 +155,16 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
                if ($GLOBALS['BE_USER']->workspace !== 0) {
                        $this->isAccessibleForCurrentUser = FALSE;
                }
-       } // end function initialize()
+       }
 
 
        /**
-        * Update the table of stored broken links
+        * Updates the table of stored broken links.
         *
         * @param       array           Processing object
         * @return      void
         */
-       public function updateBrokenLinks($processing) {
+       protected function updateBrokenLinks() {
                $searchFields = array();
 
                        // get the searchFields from TypoScript
@@ -149,24 +177,23 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
                        }
                }
                        // get children pages
-               $pageList = t3lib_tsfeBeUserAuth::extGetTreeList(
+               $pageList = $this->processing->extGetTreeList(
                        $this->pObj->id,
                        $this->search_level,
                        0,
                        $GLOBALS['BE_USER']->getPagePermsClause(1)
                );
-
                $pageList .= $this->pObj->id;
 
-               $processing->init($searchFields, $pageList);
+               $this->processing->init($searchFields, $pageList);
 
-               // check if button press
+                       // check if button press
                $update = t3lib_div::_GP('updateLinkList');
 
                if (!empty($update)) {
-                       $processing->getLinkStatistics($this->checkOpt, $this->modTS['checkhidden']);
+                       $this->processing->getLinkStatistics($this->availableOptions, $this->modTS['checkhidden']);
                }
-       } // end function updateBrokenLinks()
+       }
 
 
        /**
@@ -174,22 +201,22 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
         *
         * @return      void
         */
-       public function render() {
+       protected function render() {
                if ($this->isAccessibleForCurrentUser) {
                        $this->content = $this->drawBrokenLinksTable();
                } else {
                                // If no access or if ID == zero
                        $this->content .= $this->doc->spacer(10);
                }
-       } // end function render()
+       }
 
 
        /**
-        * Flushes the rendered content to browser.
+        * Flushes the rendered content to the browser.
         *
         * @return      void
         */
-       public function flush() {
+       protected function flush() {
                $content.= $this->doc->moduleBody(
                        $this->pageRecord,
                        $this->getDocHeaderButtons(),
@@ -197,20 +224,23 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
                );
 
                return $content;
-       } // end function flush()
+       }
+
 
        /**
-        * @return string
+        * Builds the selector for the level of pages to search.
+        *
+        * @return      string  Html code of that selector
         */
-       protected function getLevelSelector() {
+       private function getLevelSelector() {
                        // Make level selector:
                $opt = array();
                $parts = array(
-                       0 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_0'),
-                       1 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_1'),
-                       2 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_2'),
-                       3 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_3'),
-                       999 => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_infi'),
+                       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) {
@@ -221,113 +251,112 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
        }
 
        /**
-        * Display the table of broken links
+        * Displays the table of broken links or a note if there were no broken links.
         *
-        * @return      html    Content of the table
+        * @return      html    Content of the table or of the note
         */
-       protected function drawBrokenLinksTable() {
+       private function drawBrokenLinksTable() {
                $content = '';
                $items = array();
                $brokenLinkItems = '';
                $keyOpt = array();
 
-               $brokenLinksTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###BROKENLINKS_CONTENT###');
-
-                       // table header
-               $brokenLinksMarker = $this->startTable();
-               $brokenLinksTemplate = t3lib_parsehtml::substituteMarkerArray($brokenLinksTemplate, $brokenLinksMarker, '###|###', TRUE);
-
-               $brokenLinksItemTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###BROKENLINKS_ITEM###');
                if (is_array($this->checkOpt)) {
                        $keyOpt = array_keys($this->checkOpt);
                }
 
-               $pageList = t3lib_tsfeBeUserAuth::extGetTreeList(
+               $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) . '\')')
+                       'recpid in (' . $pageList . ') and typelinks in (\'' . implode("','", $keyOpt) . '\')',
+                       '',
+                       'recuid ASC, uid ASC')
                )) {
-                               // table rows containing the broken links
-                       while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
-                               $alter = $alter % 2 ? FALSE : TRUE;
-                               $items[] = $this->drawTableRow($row['tablename'], $row, $alter, $brokenLinksItemTemplate);
-                       }
-               }
+                               // Display table with broken links
+                       if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) {
+                               $brokenLinksTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###BROKENLINKS_CONTENT###');
 
-               if (is_array($items)) {
-                       $brokenLinkItems = implode(chr(10), $items);
+                               $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;
-       } // end function drawBrokenLinksTable()
-
-
-       /**
-        * 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-uid's 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 uid's. 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) {
-               return t3lib_tsfeBeUserAuth::extGetTreeList($id, $depth, $begin, $perms_clause);
        }
 
 
+
        /**
-        * Display table begin of the broken links
+        * Displays the table header of the table with the broken links.
         *
         * @return      html            Code of content
         */
-       protected function startTable() {
-               global $LANG;
+       private function startTable() {
+               global $TYPO3_CONF_VARS;
 
                        // Listing head
                $makerTableHead = array();
-               $makerTableHead['list_header'] = $this->doc->sectionHeader($LANG->getLL('list.header'), $h_func);
-               $makerTableHead['bgColor2'] = $this->doc->bgColor2;
-
-               $makerTableHead['tablehead_path'] = $LANG->getLL('list.tableHead.path');
-               $makerTableHead['tablehead_type'] = $LANG->getLL('list.tableHead.type');
-               $makerTableHead['tablehead_headline'] = $LANG->getLL('list.tableHead.headline');
-               $makerTableHead['tablehead_field'] = $LANG->getLL('list.tableHead.field');
-               $makerTableHead['tablehead_headlink'] = $LANG->getLL('list.tableHead.headlink');
-               $makerTableHead['tablehead_linktarget'] = $LANG->getLL('list.tableHead.linktarget');
-               $makerTableHead['tablehead_linkmessage'] = $LANG->getLL('list.tableHead.linkmessage');
-               $makerTableHead['tablehead_lastcheck'] = $LANG->getLL('list.tableHead.lastCheck');
+
+               $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;
-       } // end function startTable()
+       }
 
 
        /**
-        * Display line of the broken links table
+        * Displays one line of the broken links table.
         *
         * @param       string          table
         * @param       string          row record
-        * @param       bool            alternate color between rows
         * @return      html            code of content
         */
-       protected function drawTableRow($table, $row, $switch, $brokenLinksItemTemplate) {
+       private function drawTableRow($table, $row, $brokenLinksItemTemplate) {
                $markerArray = array();
                if (is_array($row) && !empty($row['typelinks'])) {
                        if (($hookObj = $this->hookObjectsArr[$row['typelinks']])) {
@@ -336,31 +365,51 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
                }
 
                $params = '&edit[' . $table . '][' . $row['recuid'] . ']=edit';
-               $actionLinks = '<a href="#" onclick="' . t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], '') . '">'.
+               $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>';
 
-               $elementType = $row['headline'];
-               if (empty($elementType)) {
-                       $elementType = $table . ':' . $row['recuid'];
+               $elementHeadline = $row['headline'];
+               if (empty($elementHeadline)) {
+                       $elementHeadline = $GLOBALS['LANG']->getLL('list.no.headline');
                }
 
-                       //Alternating row colors
-               if ($switch == TRUE) {
-                       $switch = FALSE;
-                       $markerArray['bgcolor_alternating'] = $this->doc->bgColor3;
-               } elseif ($switch == FALSE) {
-                       $switch = TRUE;
-                       $markerArray['bgcolor_alternating'] = $this->doc->bgColor5;
+                       // 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['type'] = t3lib_iconWorks::getSpriteIconForRecord($table, $row, array('title' => $row['recuid']));
-               $markerArray['headline'] = $elementType;
-               $markerArray['field'] = $row['field'];
+               $markerArray['element'] = $element; 
                $markerArray['headlink'] = $row['linktitle'];
                $markerArray['linktarget'] = $brokenUrl;
-               $markerArray['linkmessage'] = $row['urlresponse'];
+
+               $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);
@@ -368,17 +417,16 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
 
                        // Return the table html code as string
                return t3lib_parsehtml::substituteMarkerArray($brokenLinksItemTemplate, $markerArray, '###|###', TRUE, TRUE);
-       } // end function drawTableRow()
+       }
 
 
        /**
-        * Builds the checkboxes out of the hooks array
+        * Builds the checkboxes out of the hooks array.
         *
-        * @param       array           array of broken links informations
+        * @param       array           array of broken links information
         * @return      html            code content
         */
-       protected function getCheckOptions($brokenLinkOverView) {
-               global $LANG;
+       private function getCheckOptions($brokenLinkOverView) {
                $content = '';
                $checkOptionsTemplate = '';
                $checkOptionsTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###CHECKOPTIONS_SECTION###');
@@ -386,8 +434,17 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
                $hookSectionContent = '';
                $hookSectionTemplate = t3lib_parsehtml::getSubpart($checkOptionsTemplate, '###HOOK_SECTION###');
 
-               $markerArray['total_count_label'] = $LANG->getLL('overviews.nbtotal');
-               $markerArray['total_count'] = $brokenLinkOverView['brokenlinkCount'];
+               $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 = '';
@@ -396,16 +453,24 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
                        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 $key => $value) {
-                                       if (in_array($key, $linktypes)) {
+                               foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $type => $value) {
+                                       if (in_array($type, $linktypes)) {
                                                $hookSectionMarker = array();
-                                               $hookSectionMarker['count'] = $brokenLinkOverView[$key];
-                                               $trans = $GLOBALS['LANG']->getLL('hooks.' . $key);
-                                               $trans = $trans ? $trans : $key;
+                                               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(
-                                                       $this->pObj->id, 'SET[' . $key . ']',
-                                                       $this->pObj->MOD_SETTINGS[$key]
-                                               ) . '<label for="' . $key . '">' . $trans . '</label>';
+                                                       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);
                                        }
@@ -416,7 +481,7 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
                $checkOptionsTemplate = t3lib_parsehtml::substituteSubpart($checkOptionsTemplate, '###HOOK_SECTION###', $hookSectionContent);
 
                return t3lib_parsehtml::substituteMarkerArray($checkOptionsTemplate, $markerArray, '###|###', TRUE, TRUE);
-       } // end function getCheckOptions()
+       }
 
 
        /**
@@ -424,7 +489,7 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
         *
         * @return      void
         */
-       protected function loadHeaderData() {
+       private function loadHeaderData() {
                $this->doc->addStyleSheet('linkvalidator', $this->relativePath . 'res/linkvalidator.css', 'linkvalidator');
        }
 
@@ -434,7 +499,7 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
         *
         * @return      array           Available buttons for the docHeader
         */
-       protected function getDocHeaderButtons() {
+       private function getDocHeaderButtons() {
                $buttons = array(
                        'csh' => t3lib_BEfunc::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH']),
                        'shortcut' => $this->getShortcutButton(),
@@ -449,7 +514,7 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
         *
         * @return      string          HTML representiation of the shortcut button
         */
-       protected function getShortcutButton() {
+       private function getShortcutButton() {
                $result = '';
                if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
                        $result = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']);
@@ -463,8 +528,10 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
         *
         * @return      array           The filled marker array
         */
-       protected function getTemplateMarkers() {
+       private function getTemplateMarkers() {
+
                $markers = array(
+                       'FIRST_STEPS'                   => $this->firstSteps,
                        'FUNC_MENU'                             => $this->getLevelSelector(),
                        'CONTENT'                               => $this->content,
                        'TITLE'                                 => $GLOBALS['LANG']->getLL('title'),
@@ -472,25 +539,25 @@ class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
                        'CHECKOPTIONS'                  => $this->checkOptHtml,
                        'ID'                                    => '<input type="hidden" name="id" value="' . $this->pObj->id . '"/>',
                        'REFRESH'                               => $this->refreshListHtml,
-                   'UPDATE'                =>$this->updateListHtml
+                   'UPDATE'                => $this->updateListHtml
                );
 
                return $markers;
-       } // end function getTemplateMarkers()
+       }
 
 
        /**
-        * Determines whether the current user is admin.
+        * Determines whether the current user is an admin.
         *
         * @return      boolean         Whether the current user is admin
         */
-       protected function isCurrentUserAdmin() {
+       private function isCurrentUserAdmin() {
                return ((bool) $GLOBALS['BE_USER']->user['admin']);
        }
-} // end class
+}
 
 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/clear.gif b/typo3/sysext/linkvalidator/modfunc1/clear.gif
deleted file mode 100644 (file)
index 9ed1269..0000000
Binary files a/typo3/sysext/linkvalidator/modfunc1/clear.gif and /dev/null differ
index 4c2eb21..e99c2dd 100644 (file)
@@ -1,50 +1,65 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <T3locallang>
-    <meta type="array">
-        <description>Labels for linkvalidator mod1</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="list.tableHead.lastCheck">Last check (DD-MM-YYYY HH:MM)</label>
-            <label index="list.header">Listing of certainly broken links</label>
-            <label index="list.tableHead.path">Path</label>
-            <label index="list.tableHead.type">Type</label>
-            <label index="list.tableHead.headline">Title</label>
-            <label index="list.tableHead.headlink">Link</label>
-            <label index="list.tableHead.field">field</label>
-            <label index="list.tableHead.linktarget">URL / Link Target</label>
-            <label index="list.tableHead.linkmessage">Error message</label>
-            <label index="list.report.pagedeleted">Page deleted</label>
-            <label index="list.report.pagenotexisting">Page '###title###' doesn't exist</label>
-            <label index="list.report.rowdeleted">###title### row deleted</label>
-            <label index="list.report.rownotexisting">###title### row doesn't exist</label>
-            <label index="list.report.noresponse">External Link not reachable</label>
-            <label index="list.report.filenotexisting">File doesn't exist</label>
-            <label index="label_update">Check links</label>
-            <label index="label_refresh">Refresh display</label>
-            <label index="list.msg.lastRun">on %1$s at %2$s</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="overviews.nbtotal">Broken link total</label>
-        </languageKey>
-    </data>
+       <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
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
index 5d384af..9631ef1 100644 (file)
@@ -1,17 +1,17 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <T3locallang>
-    <meta type="array">
-        <description>Labels for linkvalidator mod1</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 of your website for validity</label>
-            <label index="mlang_labels_tablabel">Validates links</label>
-        </languageKey>
-    </data>
+       <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>
index dd0a012..11f9cd3 100644 (file)
@@ -1,69 +1,64 @@
 <!-- ###FULLDOC### begin -->
-            <h3>###TITLE###</h3>
-            <div class="linkvalidator_funcmenu">###FUNC_MENU######REFRESH######UPDATE###</div>
-            <div class="linkvalidator_checkoptions">
-                    ###ID###
-                    ###CHECKALLLINK###                    
-                    ###CHECKOPTIONS###
-            </div>
-            ###CONTENT###
+                       <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 -->
-    <table class="linkvalidator_table">
-        <tr>     
-               <td>
-                  <label>
-                      ###TOTAL_COUNT_LABEL###
-                  </label>
-               </td>
-               <td>
-                  <span>
-                      ###TOTAL_COUNT###
-                  </span>
-               </td>
-           </tr>
-           <!-- ###HOOK_SECTION### begin -->
-                <tr>
-                   <td>
-                           <div class="linkvalidator_singleOption">
-                                   ###OPTION###
-                               </div>
-                   </td>
-                   <td>
-                       <span>
-                            ###COUNT###
-                           </span>
-                   </td>
-                </tr>
-           <!-- ###HOOK_SECTION### end -->
-    </table>
+       ###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 id="brokenLinksList" border="0" width="100%" cellspacing="1" cellpadding="3" align="center" bgcolor="###BGCOLOR2###">
-            <tr>
-                <td class="head" align="center"></td>
-                <td class="head" align="center"><b>###TABLEHEAD_PATH###</b></td>
-                <td class="head" align="center"><b>###TABLEHEAD_TYPE###</b></td>
-                <td class="head" align="center"><b>###TABLEHEAD_HEADLINE###</b></td>
-                <td class="head" align="center"><b>###TABLEHEAD_FIELD###</b></td>
-                <td class="head" align="center"><b>###TABLEHEAD_HEADLINK###</b></td>
-                <td class="head" align="center"><b>###TABLEHEAD_LINKTARGET###</b></td>
-                <td class="head" align="center"><b>###TABLEHEAD_LINKMESSAGE###</b></td>
-                <td class="head" align="center"><b>###TABLEHEAD_LASTCHECK###</b></td>
-            </tr>
-            <!-- ###BROKENLINKS_ITEM### begin -->
-            <tr bgcolor="###BGCOLOR_ALTERNATING###">
-                <td class="content">###ACTIONLINK###</td>
-                <td class="content">###PATH###</td>
-                <td class="content" style="text-align: center">###TYPE###</td>
-                <td class="content">###HEADLINE###</td>
-                <td class="content">###FIELD###</td>
-                <td class="content">###HEADLINK###</td>
-                <td class="content"><a href="###LINKTARGET###" target="_blank">###LINKTARGET###</a></td>
-                <td class="content">###LINKMESSAGE###</td>
-                <td class="content">###LASTCHECK###</td>
-            </tr>
-            <!-- ###BROKENLINKS_ITEM### end -->
-            </table>
+       ###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 8b27cc1..679d614 100644 (file)
@@ -1,26 +1,27 @@
-@CHARSET "UTF-8";
+@charset "UTF-8";
 
-#typo3-mod-php .docheader-row2-right a {
-       display: inline;
+#linkvalidator_firstSteps {
+       margin-bottom: 10px;
 }
-.linkvalidator_funcmenu{
-       margin-bottom:10px;
+       
+.linkvalidator_funcmenu {
+       margin-bottom: 25px;
 }
 
-.linkvalidator_funcmenu input{
-    margin-left: 5px;
+.linkvalidator_funcmenu input {
+       margin-left: 5px;
 }
 
 .linkvalidator_checkoptions {
        margin-bottom: 10px;
 }
 
-.linkvalidator_checkoptions_send {
-       margin-top: 5px;
+.linkvalidator_checkoptions .typo3-message {
+       margin-top: 16px;
 }
 
 .linkvalidator_singleOption {
-       padding: 2px 0;
+       padding: 0;
 }
 
 .linkvalidator_singleOption label {
        vertical-align: middle;
 }
 
+.linkvalidator_singleOption .checkbox,
+.linkvalidator_singleOption .checkbox:hover {
+       margin-top: 0px;
+       margin-bottom: 0px;
+}
+
 .linkvalidator_singleOption-showalllinks {
        padding-bottom: 10px;
 }
 
-.linkvalidator_table td {
-    padding: 0 10px 0 0;
+#linkvalidator_statsTable {
+       width: 230px;
+       margin-bottom: 18px;
+}
+
+#linkvalidator_statsTable .t3-row-header td.number {
+       padding-top: 4px;
+}
+
+#linkvalidator_statsTable td,
+#linkvalidator_statsTable span {
+       vertical-align: middle;
+}
+
+#linkvalidator_statsTable td.number {
+       padding-right: 6px;
+       text-align: center;
 }
 
-.linkvalidator_table td, .linkvalidator_table span{
-    vertical-align: middle;
+#linkvalidator_statsTable td,
+#linkvalidator_brokenLinksTable td {
+       border-left: 1px solid white;
+} 
+#linkvalidator_statsTable td:first-child,
+#linkvalidator_brokenLinksTable td:first-child {
+       border-left: none;
 }
diff --git a/typo3/sysext/linkvalidator/res/mailTemplate.html b/typo3/sysext/linkvalidator/res/mailTemplate.html
deleted file mode 100644 (file)
index 11b79f2..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<!--  ###REPORT_TEMPLATE### -->
-<html>
-<body>
-
-
-Total broken links: ###TOTALBROKENLINK### (last report: ###TOTALBROKENLINK_OLD###)<br />
- <br />
- <!-- ###PAGE_SECTION### -->
-       Page: ###TITLE###<br />
-       All links types: ###BROKENLINKCOUNT###  (last report: ###BROKENLINKCOUNT_OLD###)<br />
-       Internal link: ###DB### (last report: ###DB_OLD###)<br />
-       External link: ###EXTERNAL### (last report: ###EXTERNAL_OLD###)<br />
-       
- <!-- ###PAGE_SECTION### -->
-
-
-</body>
-</html>
-<!--  ###REPORT_TEMPLATE### -->
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/res/mailtemplate.html b/typo3/sysext/linkvalidator/res/mailtemplate.html
new file mode 100644 (file)
index 0000000..8758d71
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+        "http://www.w3.org/TR/html4/loose.dtd">
+<!-- ###REPORT_TEMPLATE### -->
+<html>
+<body>
+
+
+Total broken links: ###TOTALBROKENLINK### (last report: ###TOTALBROKENLINK_OLD###)<br />
+ <br />
+
+ <!-- ###PAGE_SECTION### -->
+       Page: ###TITLE###<br />
+       All links types: ###BROKENLINKCOUNT###  (last report: ###BROKENLINKCOUNT_OLD###)<br />
+       Internal link: ###DB### (last report: ###DB_OLD###)<br />
+       External link: ###EXTERNAL### (last report: ###EXTERNAL_OLD###)<br />
+
+ <!-- ###PAGE_SECTION### -->
+
+
+</body>
+</html>
+<!-- ###REPORT_TEMPLATE### -->
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/res/pageTSconfig.txt b/typo3/sysext/linkvalidator/res/pageTSconfig.txt
deleted file mode 100644 (file)
index cf1488d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-mod.linkvalidator {
-       searchFields {
-               pages = media,url
-               tt_content = bodytext, header_link,records
-               tt_news = bodytext, links
-       }       
-       linktypes = db,file,external    
-       checkhidden = 0
-       showUpdateButton = true
-       mail{
-               encoding = utf-8
-               fromname = 
-               fromemail = 
-               replytoname =
-               replytoemail =
-               subject = TYPO3 Linkvalidator report 
-       }
-}
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/res/pagetsconfig.txt b/typo3/sysext/linkvalidator/res/pagetsconfig.txt
new file mode 100644 (file)
index 0000000..72ac0eb
--- /dev/null
@@ -0,0 +1,18 @@
+mod.linkvalidator {
+       searchFields {
+               pages = media,url
+               tt_content = bodytext,header_link,records
+               tt_news = bodytext,links
+       }
+       linktypes = db,file,external
+       checkhidden = 0
+       showUpdateButton = 1
+       mail{
+               encoding = utf-8
+               fromname =
+               fromemail =
+               replytoname =
+               replytoemail =
+               subject = TYPO3 Linkvalidator report
+       }
+}
\ No newline at end of file