public function init($searchField, $pid) {
$this->searchFields = $searchField;
$this->pidList = $pid;
-
+
foreach ($searchField as $tableName => $table) {
t3lib_div::loadTCA($tableName);
}
'pages',
'pid=' . $id . ' AND deleted=0 AND ' . $permsClause
);
-
+
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if ($begin <= 0 && ($row['hidden']==0 || $considerHidden == 1)) {
$theList .= $row['uid'] . ',';
public function getRootLineIsHidden($pageInfo){
$hidden = FALSE;
- if($pageInfo['extendToSubpages'] == 1 && $pageInfo['hidden'] == 1){
+ if ($pageInfo['extendToSubpages'] == 1 && $pageInfo['hidden'] == 1){
$hidden = TRUE;
- }
- else{
- if($pageInfo['pid'] > 0) {
+ } else {
+ if ($pageInfo['pid'] > 0) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid,title,hidden,extendToSubpages',
'pages',
- 'uid=' . $pageInfo['pid']
+ 'uid=' . $pageInfo['pid']
);
-
+
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$hidden = $this->getRootLineIsHidden($row);
}
}
}
return $hidden;
-
+
}
}
$url = substr($url, 0, strrpos($url, '#'));
}
- // try to fetch the content of the URL
+ // try to fetch the content of the URL
$content = t3lib_div::getURL($url, 1, $additionalHeaders, $report);
$tries = 0;
|| $report['http_code'] == 303 || $report['http_code'] == 307)
&& ($tries < 5)) {
- // split header into lines and find Location:
+ // split header into lines and find Location:
$responseHeaders = t3lib_div::trimExplode(chr(10), $content, TRUE);
foreach ($responseHeaders as $line) {
// construct new URL
$parsedUrl['user'] . (isset($parsedUrl['pass']) ? ':' . $parsedUrl['pass'] : '')
: '') . $parsedUrl['host'] . (
isset($parsedUrl['port']) ? ':' . $parsedUrl['port'] : '') . $location[1];
- }
- else {
+ } else {
$newUrl = $location[1];
}
- if ($lastUrl === $newUrl) break 2;
- } else break 2;
+ if ($lastUrl === $newUrl) {
+ break 2;
+ }
+ } else {
+ break 2;
+ }
}
}
$lastUrl = $newUrl;
$tries++;
}
-
-
+
+
$response = TRUE;
// analyze the response
$processor = t3lib_div::makeInstance('tx_linkvalidator_Processor');
$pageRow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'pages', 'uid=' . $page);
$rootLineHidden = $processor->getRootLineIsHidden($pageRow);
- if(!$rootLineHidden || $modTS['checkhidden']==1) {
+ if (!$rootLineHidden || $modTS['checkhidden'] == 1) {
$pageIds = $processor->extGetTreeList($page, $this->depth, 0, '1=1', $modTS['checkhidden']);
- if($pageRow['hidden'] == 0 || $modTS['checkhidden']==1){
+ if ($pageRow['hidden'] == 0 || $modTS['checkhidden'] == 1) {
$pageIds .= $page;
}
-
+
$processor->init($searchFields, $pageIds);
if (!empty($this->email)) {
$oldLinkCounts = $processor->getLinkCounts($page);
$this->oldTotalBrokenLink += $oldLinkCounts['brokenlinkCount'];
}
-
- $processor->getLinkStatistics($array, $modTS['checkhidden']);
-
- if (!empty($this->email)) {
- $linkCounts = $processor->getLinkCounts($page);
- $this->totalBrokenLink += $linkCounts['brokenlinkCount'];
- $pageSections = $this->buildMail($page, $pageIds, $linkCounts, $oldLinkCounts);
- }
}
$processor->getLinkStatistics($linkTypes, $modTS['checkhidden']);
items : [
{
autoHeight: true,
- title: TYPO3.lang.Report,
+ title: TYPO3.lang.Report,
html: ' . json_encode($this->flush(TRUE)) . '
},
' . $panelCheck . '
}
}
$rootLineHidden = $this->processor->getRootLineIsHidden($this->pObj->pageinfo);
- if(!$rootLineHidden || $this->modTS['checkhidden']==1) {
+ if (!$rootLineHidden || $this->modTS['checkhidden'] == 1) {
// get children pages
$pageList = $this->processor->extGetTreeList(
$this->pObj->id,
$GLOBALS['BE_USER']->getPagePermsClause(1),
$this->modTS['checkhidden']
);
-
-
- if($this->pObj->pageinfo['hidden'] == 0 || $this->modTS['checkhidden']==1){
+
+
+ if ($this->pObj->pageinfo['hidden'] == 0 || $this->modTS['checkhidden'] == 1){
$pageList .= $this->pObj->id;
}
-
+
$this->processor->init($searchFields, $pageList);
-
+
// check if button press
$update = t3lib_div::_GP('updateLinkList');
-
+
if (!empty($update)) {
$this->processor->getLinkStatistics($this->checkOpt, $this->modTS['checkhidden']);
}
$keyOpt = array_keys($this->checkOpt);
}
$rootLineHidden = $this->processor->getRootLineIsHidden($this->pObj->pageinfo);
- if(!$rootLineHidden || $this->modTS['checkhidden']==1) {
+ if (!$rootLineHidden || $this->modTS['checkhidden'] == 1) {
$pageList = $this->processor->extGetTreeList(
$this->pObj->id,
$this->searchLevel,
$GLOBALS['BE_USER']->getPagePermsClause(1),
$this->modTS['checkhidden']
);
- if($this->pObj->pageinfo['hidden'] == 0 || $this->modTS['checkhidden']==1){
+ if ($this->pObj->pageinfo['hidden'] == 0 || $this->modTS['checkhidden'] == 1){
$pageList .= $this->pObj->id;
}
-
+
if (($res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'*',
'tx_linkvalidator_link',
// Display table with broken links
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) {
$brokenLinksTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###BROKENLINKS_CONTENT###');
-
+
$brokenLinksItemTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###BROKENLINKS_ITEM###');
-
+
// Table header
$brokenLinksMarker = $this->startTable();
-
+
// Table rows containing the broken links
while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
$items[] = $this->renderTableRow($row['table_name'], $row, $brokenLinksItemTemplate);
- }
+ }
$brokenLinkItems = implode(chr(10), $items);
-
+
// Display note that there are no broken links to display
} else {
$brokenLinksMarker = $this->getNoBrokenLinkMessage($brokenLinksMarker);
}
}
- }
- else{
-
+ } else {
+
$brokenLinksMarker = $this->getNoBrokenLinkMessage($brokenLinksMarker);
}
$brokenLinksTemplate = t3lib_parsehtml::substituteMarkerArray($brokenLinksTemplate, $brokenLinksMarker, '###|###', TRUE);
return $content;
}
- protected function getNoBrokenLinkMessage($brokenLinksMarker){
+ protected function getNoBrokenLinkMessage($brokenLinksMarker){
$brokenLinksMarker['LIST_HEADER'] = $this->doc->sectionHeader($GLOBALS['LANG']->getLL('list.header'));
$message = t3lib_div::makeInstance(
't3lib_FlashMessage',
t3lib_FlashMessage::OK
);
$brokenLinksMarker['NO_BROKEN_LINKS'] = $message->render();
-
+
return $brokenLinksMarker;
}