Added feature #16420: Add link validator module (Thanks to Patrick Gaumond)
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 17 Nov 2010 11:36:23 +0000 (11:36 +0000)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 17 Nov 2010 11:36:23 +0000 (11:36 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9443 709f56b5-9817-0410-a4d7-c38de5d9e867

27 files changed:
ChangeLog
typo3/sysext/linkvalidator/ChangeLog [new file with mode: 0644]
typo3/sysext/linkvalidator/README.txt [new file with mode: 0644]
typo3/sysext/linkvalidator/doc/manual.sxw [new file with mode: 0644]
typo3/sysext/linkvalidator/ext_autoload.php [new file with mode: 0644]
typo3/sysext/linkvalidator/ext_emconf.php [new file with mode: 0644]
typo3/sysext/linkvalidator/ext_icon.gif [new file with mode: 0644]
typo3/sysext/linkvalidator/ext_localconf.php [new file with mode: 0644]
typo3/sysext/linkvalidator/ext_tables.php [new file with mode: 0644]
typo3/sysext/linkvalidator/ext_tables.sql [new file with mode: 0644]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkbase.php [new file with mode: 0644]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkexternallinks.php [new file with mode: 0644]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkfilelinks.php [new file with mode: 0644]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkinternallinks.php [new file with mode: 0644]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checklinkhandlerlinks.php [new file with mode: 0644]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_processing.php [new file with mode: 0644]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_scheduler_link.php [new file with mode: 0644]
typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_scheduler_linkAdditionalFieldProvider.php [new file with mode: 0644]
typo3/sysext/linkvalidator/locallang.xml [new file with mode: 0644]
typo3/sysext/linkvalidator/modfunc1/class.tx_linkvalidator_modfunc1.php [new file with mode: 0644]
typo3/sysext/linkvalidator/modfunc1/clear.gif [new file with mode: 0644]
typo3/sysext/linkvalidator/modfunc1/locallang.xml [new file with mode: 0644]
typo3/sysext/linkvalidator/modfunc1/locallang_mod.xml [new file with mode: 0644]
typo3/sysext/linkvalidator/modfunc1/mod_template.html [new file with mode: 0644]
typo3/sysext/linkvalidator/res/linkvalidator.css [new file with mode: 0644]
typo3/sysext/linkvalidator/res/mailTemplate.html [new file with mode: 0644]
typo3/sysext/linkvalidator/res/pageTSconfig.txt [new file with mode: 0644]

index a9cb622..e78f093 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,13 @@
+2010-11-17  Christian Kuhn  <lolli@schwarzbu.ch>
+
+       * Added feature #16420: Add link validator extension (Thanks to Patrick Gaumond)
+
 2010-11-17  Steffen Kamper  <steffen@typo3.org>
 
        * Fixed bug #16320: Prepare userauthgroup to support custom staging (Thanks to Tolleiv Nietsch)
        * Fixed bug #16436: Call to undefined method SC_mod_tools_em_index::uploadExtensionToTER()
 
-2010-11-17  Jochen Rau <jochen.rau@typoplanet.de>
+2010-11-17  Jochen Rau  <jochen.rau@typoplanet.de>
 
        * Added feature #16395: Add basic support for RDFa in core (semantic web)
 
@@ -13915,4 +13919,4 @@ Charsets:
 
 --------------------
 
-SVN ID: $Id$
\ No newline at end of file
+SVN ID: $Id$
diff --git a/typo3/sysext/linkvalidator/ChangeLog b/typo3/sysext/linkvalidator/ChangeLog
new file mode 100644 (file)
index 0000000..01babaf
--- /dev/null
@@ -0,0 +1,27 @@
+2010-11-17  Christian Kuhn  <lolli@schwarzbu.ch>
+
+       * 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
+       * Fixed bug #10890: Add ext:info as dependency in ext_emconf
+
+2010-11-12  Tolleiv Nietsch  <info@tolleiv.de>
+
+       * Fixed bug #10763: The mailtemplate setting should have a default setting
+       * Fixed bug #10598: "Check links" button must be hideable with TS - renamed noUpdateButton to showUpdateButton, manual updated
+
+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
+
+2010-11-03  Tolleiv Nietsch  <info@tolleiv.de>
+
+       * 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>
+
+       * initial code generated with kickstarter
diff --git a/typo3/sysext/linkvalidator/README.txt b/typo3/sysext/linkvalidator/README.txt
new file mode 100644 (file)
index 0000000..2b9aebe
--- /dev/null
@@ -0,0 +1,2 @@
+
+Feel free to add some documentation or simply add a link to the online manual.
diff --git a/typo3/sysext/linkvalidator/doc/manual.sxw b/typo3/sysext/linkvalidator/doc/manual.sxw
new file mode 100644 (file)
index 0000000..7f52464
Binary files /dev/null and b/typo3/sysext/linkvalidator/doc/manual.sxw differ
diff --git a/typo3/sysext/linkvalidator/ext_autoload.php b/typo3/sysext/linkvalidator/ext_autoload.php
new file mode 100644 (file)
index 0000000..ed6ee6c
--- /dev/null
@@ -0,0 +1,11 @@
+<?php
+$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',
+
+);
+?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/ext_emconf.php b/typo3/sysext/linkvalidator/ext_emconf.php
new file mode 100644 (file)
index 0000000..a6d26e3
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+
+########################################################################
+# Extension Manager/Repository config file for ext "linkvalidator".
+#
+# Auto generated 20-10-2010 19:34
+#
+# Manual updates:
+# Only the data in the array - everything else is removed by next
+# writing. "version" and "dependencies" must not be touched!
+########################################################################
+
+$EM_CONF[$_EXTKEY] = array(
+       'title' => 'Link validator',
+       'description' => '',
+       'category' => 'module',
+       'author' => 'Jochen Rieger / Dimitri König / Michael Miousse',
+       'author_email' => 'j.rieger@connecta.ag, mmiousse@infoglobe.ca',
+       'shy' => '',
+       'dependencies' => 'info',
+       'conflicts' => '',
+       'priority' => '',
+       'module' => '',
+       'state' => 'stable',
+       'internal' => '',
+       'uploadfolder' => 0,
+       'createDirs' => '',
+       'modify_tables' => '',
+       'clearCacheOnLoad' => 0,
+       'lockType' => '',
+       'author_company' => 'Connecta AG / cab services ag / Infoglobe',
+       'version' => '1.0.0',
+       'constraints' => array(
+               'depends' => array(
+                       'typo3' => '4.1.0-0.0.0',
+                       'php' => '5.0.0-0.0.0',
+                       'info' => '1.0.0-0.0.0',
+               ),
+               'conflicts' => 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";}',
+       'suggests' => array(
+       ),
+);
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/ext_icon.gif b/typo3/sysext/linkvalidator/ext_icon.gif
new file mode 100644 (file)
index 0000000..b8edc12
Binary files /dev/null and b/typo3/sysext/linkvalidator/ext_icon.gif differ
diff --git a/typo3/sysext/linkvalidator/ext_localconf.php b/typo3/sysext/linkvalidator/ext_localconf.php
new file mode 100644 (file)
index 0000000..73ba3f9
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+if (!defined ('TYPO3_MODE')) {
+       die ('Access denied.');
+}
+
+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(
+    'extension'        => $_EXTKEY,
+    'title'            => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:link.name',
+    'description'      => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:link.description',
+    'additionalFields' => 'tx_linkvalidator_scheduler_linkAdditionalFieldProvider'
+);
+
+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';
+
+?>
diff --git a/typo3/sysext/linkvalidator/ext_tables.php b/typo3/sysext/linkvalidator/ext_tables.php
new file mode 100644 (file)
index 0000000..ab1bf7c
--- /dev/null
@@ -0,0 +1,13 @@
+<?php\r
+if (!defined ('TYPO3_MODE'))   die ('Access denied.');\r
+if (TYPO3_MODE == 'BE') {\r
+\r
+               // add module\r
+       t3lib_extMgm::insertModuleFunction(
+               'web_info',
+               'tx_linkvalidator_modfunc1',
+               t3lib_extMgm::extPath('linkvalidator').'modfunc1/class.tx_linkvalidator_modfunc1.php',
+               'LLL:EXT:linkvalidator/locallang.xml:mod_linkvalidator'
+       );\r
+}\r
+?>\r
diff --git a/typo3/sysext/linkvalidator/ext_tables.sql b/typo3/sysext/linkvalidator/ext_tables.sql
new file mode 100644 (file)
index 0000000..d2e9628
--- /dev/null
@@ -0,0 +1,15 @@
+CREATE TABLE tx_linkvalidator_links (
+       uid int(11) NOT NULL auto_increment,
+       recuid int(11) DEFAULT '0' NOT NULL,
+       recpid int(11) DEFAULT '0' NOT NULL,
+       headline varchar(255) DEFAULT '' NOT NULL,
+       field varchar(255) DEFAULT '' NOT NULL,
+       tablename varchar(255) DEFAULT '' NOT NULL,
+       linktitle text,
+       url text,
+       urlresponse text,
+    lastcheck int(11) DEFAULT '0' NOT NULL,
+       typelinks varchar(50) DEFAULT '' NOT NULL,
+
+       PRIMARY KEY (uid)
+);
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkbase.php b/typo3/sysext/linkvalidator/lib/class.tx_linkvalidator_checkbase.php
new file mode 100644 (file)
index 0000000..2782ddb
--- /dev/null
@@ -0,0 +1,61 @@
+<?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
new file mode 100644 (file)
index 0000000..d8705dd
--- /dev/null
@@ -0,0 +1,90 @@
+<?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') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_checkexternallinks.php']) {
+       include_once($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
new file mode 100644 (file)
index 0000000..f738478
--- /dev/null
@@ -0,0 +1,54 @@
+<?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') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_checkfilelinks.php']) {
+       include_once($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
new file mode 100644 (file)
index 0000000..37c06e2
--- /dev/null
@@ -0,0 +1,77 @@
+<?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') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_checkinternallinks.php']) {
+       include_once($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
new file mode 100644 (file)
index 0000000..99a1950
--- /dev/null
@@ -0,0 +1,98 @@
+<?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') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_checklinkhandlerlinks.php']) {
+       include_once($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
new file mode 100644 (file)
index 0000000..bc26cc2
--- /dev/null
@@ -0,0 +1,227 @@
+<?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') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_processing.php']) {
+       include_once($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
new file mode 100644 (file)
index 0000000..65199e0
--- /dev/null
@@ -0,0 +1,270 @@
+<?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') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_scheduler_link.php']) {
+       include_once($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
new file mode 100644 (file)
index 0000000..3b94b53
--- /dev/null
@@ -0,0 +1,261 @@
+<?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') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_scheduler_linkAdditionalFieldProvider.php']) {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/linkvalidator/lib/class.tx_linkvalidator_scheduler_linkAdditionalFieldProvider.php']);
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/linkvalidator/locallang.xml b/typo3/sysext/linkvalidator/locallang.xml
new file mode 100644 (file)
index 0000000..372e788
--- /dev/null
@@ -0,0 +1,28 @@
+<?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>
+</T3locallang>
diff --git a/typo3/sysext/linkvalidator/modfunc1/class.tx_linkvalidator_modfunc1.php b/typo3/sysext/linkvalidator/modfunc1/class.tx_linkvalidator_modfunc1.php
new file mode 100644 (file)
index 0000000..6de2c84
--- /dev/null
@@ -0,0 +1,496 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2005 - 2010 Michael Miousse (michael.miousse@infoglobe.ca)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Module 'Link Validator' for the 'linkvalidator' extension.
+ *
+ * @author Michael Miousse <michael.miousse@infoglobe.ca>
+ * @author Jochen Rieger <j.rieger@connecta.ag>
+ * @package TYPO3
+ * @subpackage linkvalidator
+ */
+class tx_linkvalidator_modfunc1 extends t3lib_extobjbase {
+
+       /**
+        * @var template
+        */
+       public $doc;
+       protected $relativePath;
+       protected $pageRecord = array();
+       protected $isAccessibleForCurrentUser = FALSE;
+
+       /**
+        * Main method of modfunc1
+        *
+        * @return      html    Module content
+        */
+       public function main() {
+               $LANG->includeLLFile('EXT:linkvalidator/modfunc1/locallang.xml');
+
+               $this->search_level = t3lib_div::_GP('search_levels');
+
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $value) {
+                               if ($this->pObj->MOD_SETTINGS[$linkType]) {
+                                       $this->checkOpt[$linkType] = 1;
+                               }
+                       }
+               }
+
+               $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->updateListHtml = '<input type="submit" name="updateLinkList" value="' . $GLOBALS['LANG']->getLL('label_update') . '"/>';
+               }
+               $this->refreshListHtml = '<input type="submit" name="refreshLinkList" value="' . $GLOBALS['LANG']->getLL('label_refresh') . '"/>';
+               $processing = t3lib_div::makeInstance('tx_linkvalidator_processing');
+               $this->updateBrokenLinks($processing);
+
+               $brokenLinkOverView = $processing->getLinkCounts($this->pObj->id);
+               $this->checkOptHtml = $this->getCheckOptions($brokenLinkOverView);
+
+               $this->render();
+
+               return $this->flush();
+       } // end function main()
+
+       /**
+        * Initialize menu array internally
+        *
+        * @return      Module          menu
+        */
+       public function modMenu() {
+               $modMenu = array (
+                       'checkAllLink' => 0,
+               );
+
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $value) {
+                               $modMenu[$linkType] = 1;
+                       }
+               }
+
+               return $modMenu;
+       } // end function modMenu()
+
+
+       /**
+        * Initializes the Module
+        *
+        * @return      void
+        */
+       public function initialize() {
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $classRef) {
+                               $this->hookObjectsArr[$linkType] = &t3lib_div::getUserObj($classRef);
+                       }
+               }
+
+               $this->doc = t3lib_div::makeInstance('template');
+               $this->doc->setModuleTemplate(t3lib_extMgm::extPath('linkvalidator') . 'modfunc1/mod_template.html');
+               $this->doc->backPath = $GLOBALS['BACK_PATH'];
+
+               $this->relativePath = t3lib_extMgm::extRelPath('linkvalidator');
+               $this->pageRecord = t3lib_BEfunc::readPageAccess($this->pObj->id, $this->perms_clause);
+
+               $this->isAccessibleForCurrentUser = FALSE;
+               if ($this->pObj->id && is_array($this->pageRecord) || !$this->pObj->id && $this->isCurrentUserAdmin()) {
+                       $this->isAccessibleForCurrentUser = TRUE;
+               }
+
+               $this->loadHeaderData();
+
+                       // Don't access in workspace
+               if ($GLOBALS['BE_USER']->workspace !== 0) {
+                       $this->isAccessibleForCurrentUser = FALSE;
+               }
+       } // end function initialize()
+
+
+       /**
+        * Update the table of stored broken links
+        *
+        * @param       array           Processing object
+        * @return      void
+        */
+       public function updateBrokenLinks($processing) {
+               $searchFields = array();
+
+                       // get the searchFields from TypoScript
+               foreach ($this->modTS['searchFields.'] as $table => $fieldList) {
+                       $fields = t3lib_div::trimExplode(',', $fieldList);
+                       foreach ($fields as $field) {
+                               if (!$searchFields || !is_array($searchFields[$table]) || array_search($field, $searchFields[$table]) == FALSE) {
+                                       $searchFields[$table][] = $field;
+                               }
+                       }
+               }
+                       // get children pages
+               $pageList = t3lib_tsfeBeUserAuth::extGetTreeList(
+                       $this->pObj->id,
+                       $this->search_level,
+                       0,
+                       $GLOBALS['BE_USER']->getPagePermsClause(1)
+               );
+
+               $pageList .= $this->pObj->id;
+
+               $processing->init($searchFields, $pageList);
+
+               // check if button press
+               $update = t3lib_div::_GP('updateLinkList');
+
+               if (!empty($update)) {
+                       $processing->getLinkStatistics($this->checkOpt, $this->modTS['checkhidden']);
+               }
+       } // end function updateBrokenLinks()
+
+
+       /**
+        * Renders the content of the module.
+        *
+        * @return      void
+        */
+       public 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.
+        *
+        * @return      void
+        */
+       public function flush() {
+               $content.= $this->doc->moduleBody(
+                       $this->pageRecord,
+                       $this->getDocHeaderButtons(),
+                       $this->getTemplateMarkers()
+               );
+
+               return $content;
+       } // end function flush()
+
+       /**
+        * @return string
+        */
+       protected 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'),
+               );
+
+               foreach ($parts as $kv => $label) {
+                       $opt[] = '<option value="' . $kv . '"' . ($kv == intval($this->search_level) ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>';
+               }
+               $lMenu = '<select name="search_levels">' . implode('', $opt) . '</select>';
+               return $lMenu;
+       }
+
+       /**
+        * Display the table of broken links
+        *
+        * @return      html    Content of the table
+        */
+       protected 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(
+                       $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) . '\')')
+               )) {
+                               // 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);
+                       }
+               }
+
+               if (is_array($items)) {
+                       $brokenLinkItems = implode(chr(10), $items);
+               }
+
+               $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
+        *
+        * @return      html            Code of content
+        */
+       protected function startTable() {
+               global $LANG;
+
+                       // 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');
+
+               return $makerTableHead;
+       } // end function startTable()
+
+
+       /**
+        * Display 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) {
+               $markerArray = array();
+               if (is_array($row) && !empty($row['typelinks'])) {
+                       if (($hookObj = $this->hookObjectsArr[$row['typelinks']])) {
+                               $brokenUrl = $hookObj->getBrokenUrl($row);
+                       }
+               }
+
+               $params = '&edit[' . $table . '][' . $row['recuid'] . ']=edit';
+               $actionLinks = '<a href="#" onclick="' . t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], '') . '">'.
+                               t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
+
+               $elementType = $row['headline'];
+               if (empty($elementType)) {
+                       $elementType = $table . ':' . $row['recuid'];
+               }
+
+                       //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;
+               }
+
+               $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['headlink'] = $row['linktitle'];
+               $markerArray['linktarget'] = $brokenUrl;
+               $markerArray['linkmessage'] = $row['urlresponse'];
+               $lastRunDate = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $row['lastcheck']);
+               $lastRunTime = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'], $row['lastcheck']);
+               $message = sprintf($GLOBALS['LANG']->getLL('list.msg.lastRun'), $lastRunDate, $lastRunTime);
+               $markerArray['lastcheck'] = $message;
+
+                       // Return the table html code as string
+               return t3lib_parsehtml::substituteMarkerArray($brokenLinksItemTemplate, $markerArray, '###|###', TRUE, TRUE);
+       } // end function drawTableRow()
+
+
+       /**
+        * Builds the checkboxes out of the hooks array
+        *
+        * @param       array           array of broken links informations
+        * @return      html            code content
+        */
+       protected function getCheckOptions($brokenLinkOverView) {
+               global $LANG;
+               $content = '';
+               $checkOptionsTemplate = '';
+               $checkOptionsTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###CHECKOPTIONS_SECTION###');
+
+               $hookSectionContent = '';
+               $hookSectionTemplate = t3lib_parsehtml::getSubpart($checkOptionsTemplate, '###HOOK_SECTION###');
+
+               $markerArray['total_count_label'] = $LANG->getLL('overviews.nbtotal');
+               $markerArray['total_count'] = $brokenLinkOverView['brokenlinkCount'];
+
+               $linktypes = t3lib_div::trimExplode(',', $this->modTS['linktypes'], 1);
+               $hookSectionContent = '';
+
+               if (is_array($linktypes)) {
+                       if (!empty($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])
+                               && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])
+                       ) {
+                               foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $key => $value) {
+                                       if (in_array($key, $linktypes)) {
+                                               $hookSectionMarker = array();
+                                               $hookSectionMarker['count'] = $brokenLinkOverView[$key];
+                                               $trans = $GLOBALS['LANG']->getLL('hooks.' . $key);
+                                               $trans = $trans ? $trans : $key;
+                                               $option = t3lib_BEfunc::getFuncCheck(
+                                                       $this->pObj->id, 'SET[' . $key . ']',
+                                                       $this->pObj->MOD_SETTINGS[$key]
+                                               ) . '<label for="' . $key . '">' . $trans . '</label>';
+                                               $hookSectionMarker['option'] = $option;
+                                               $hookSectionContent .= t3lib_parsehtml::substituteMarkerArray($hookSectionTemplate, $hookSectionMarker, '###|###', TRUE, TRUE);
+                                       }
+                               }
+                       }
+               }
+
+               $checkOptionsTemplate = t3lib_parsehtml::substituteSubpart($checkOptionsTemplate, '###HOOK_SECTION###', $hookSectionContent);
+
+               return t3lib_parsehtml::substituteMarkerArray($checkOptionsTemplate, $markerArray, '###|###', TRUE, TRUE);
+       } // end function getCheckOptions()
+
+
+       /**
+        * Loads data in the HTML head section (e.g. JavaScript or stylesheet information).
+        *
+        * @return      void
+        */
+       protected function loadHeaderData() {
+               $this->doc->addStyleSheet('linkvalidator', $this->relativePath . 'res/linkvalidator.css', 'linkvalidator');
+       }
+
+
+       /**
+        * Gets the buttons that shall be rendered in the docHeader.
+        *
+        * @return      array           Available buttons for the docHeader
+        */
+       protected function getDocHeaderButtons() {
+               $buttons = array(
+                       'csh' => t3lib_BEfunc::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH']),
+                       'shortcut' => $this->getShortcutButton(),
+                       'save' => ''
+               );
+               return $buttons;
+       }
+
+
+       /**
+        * Gets the button to set a new shortcut in the backend (if current user is allowed to).
+        *
+        * @return      string          HTML representiation of the shortcut button
+        */
+       protected function getShortcutButton() {
+               $result = '';
+               if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
+                       $result = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']);
+               }
+               return $result;
+       }
+
+
+       /**
+        * Gets the filled markers that are used in the HTML template.
+        *
+        * @return      array           The filled marker array
+        */
+       protected function getTemplateMarkers() {
+               $markers = array(
+                       'FUNC_MENU'                             => $this->getLevelSelector(),
+                       'CONTENT'                               => $this->content,
+                       'TITLE'                                 => $GLOBALS['LANG']->getLL('title'),
+                       'CHECKALLLINK'                  => $this->checkAllHtml,
+                       'CHECKOPTIONS'                  => $this->checkOptHtml,
+                       'ID'                                    => '<input type="hidden" name="id" value="' . $this->pObj->id . '"/>',
+                       'REFRESH'                               => $this->refreshListHtml,
+                   'UPDATE'                =>$this->updateListHtml
+               );
+
+               return $markers;
+       } // end function getTemplateMarkers()
+
+
+       /**
+        * Determines whether the current user is admin.
+        *
+        * @return      boolean         Whether the current user is admin
+        */
+       protected function isCurrentUserAdmin() {
+               return ((bool) $GLOBALS['BE_USER']->user['admin']);
+       }
+} // end class
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/linkvalidator/modfunc1/class.tx_linkvalidator_modfunc1.php']) {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/linkvalidator/modfunc1/class.tx_linkvalidator_modfunc1.php']);
+}
+
+?>
diff --git a/typo3/sysext/linkvalidator/modfunc1/clear.gif b/typo3/sysext/linkvalidator/modfunc1/clear.gif
new file mode 100644 (file)
index 0000000..9ed1269
Binary files /dev/null and b/typo3/sysext/linkvalidator/modfunc1/clear.gif differ
diff --git a/typo3/sysext/linkvalidator/modfunc1/locallang.xml b/typo3/sysext/linkvalidator/modfunc1/locallang.xml
new file mode 100644 (file)
index 0000000..4c2eb21
--- /dev/null
@@ -0,0 +1,50 @@
+<?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>
+</T3locallang>
diff --git a/typo3/sysext/linkvalidator/modfunc1/locallang_mod.xml b/typo3/sysext/linkvalidator/modfunc1/locallang_mod.xml
new file mode 100644 (file)
index 0000000..5d384af
--- /dev/null
@@ -0,0 +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>
+</T3locallang>
diff --git a/typo3/sysext/linkvalidator/modfunc1/mod_template.html b/typo3/sysext/linkvalidator/modfunc1/mod_template.html
new file mode 100644 (file)
index 0000000..dd0a012
--- /dev/null
@@ -0,0 +1,69 @@
+<!-- ###FULLDOC### begin -->
+            <h3>###TITLE###</h3>
+            <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>
+<!-- ###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>
+<!-- ###BROKENLINKS_CONTENT### end -->
diff --git a/typo3/sysext/linkvalidator/res/linkvalidator.css b/typo3/sysext/linkvalidator/res/linkvalidator.css
new file mode 100644 (file)
index 0000000..8b27cc1
--- /dev/null
@@ -0,0 +1,45 @@
+@CHARSET "UTF-8";
+
+#typo3-mod-php .docheader-row2-right a {
+       display: inline;
+}
+.linkvalidator_funcmenu{
+       margin-bottom:10px;
+}
+
+.linkvalidator_funcmenu input{
+    margin-left: 5px;
+}
+
+.linkvalidator_checkoptions {
+       margin-bottom: 10px;
+}
+
+.linkvalidator_checkoptions_send {
+       margin-top: 5px;
+}
+
+.linkvalidator_singleOption {
+       padding: 2px 0;
+}
+
+.linkvalidator_singleOption label {
+       padding-left: 10px;
+       vertical-align: middle;
+}
+
+.linkvalidator_singleOption input {
+       vertical-align: middle;
+}
+
+.linkvalidator_singleOption-showalllinks {
+       padding-bottom: 10px;
+}
+
+.linkvalidator_table td {
+    padding: 0 10px 0 0;
+}
+
+.linkvalidator_table td, .linkvalidator_table span{
+    vertical-align: middle;
+}
diff --git a/typo3/sysext/linkvalidator/res/mailTemplate.html b/typo3/sysext/linkvalidator/res/mailTemplate.html
new file mode 100644 (file)
index 0000000..11b79f2
--- /dev/null
@@ -0,0 +1,21 @@
+<!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
new file mode 100644 (file)
index 0000000..cf1488d
--- /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 = true
+       mail{
+               encoding = utf-8
+               fromname = 
+               fromemail = 
+               replytoname =
+               replytoemail =
+               subject = TYPO3 Linkvalidator report 
+       }
+}
\ No newline at end of file