* A fix whitespace issues.
* Add some missing $GLOBALS['TYPO3_DB']->sql_free_result($res);
* Remove some unused variables
* Add double (()) for assignment in condition
* Check for FALSE after assigning sql_fetch_assoc($res)
Change-Id: I3007024ef004fc28aee6bc91ae888305f227b9ce
Resolves: #29341
Releases: 4.6
-2011-08-30 Philipp Gampe <forge.typo3.org@philippgampe.info>
+2011-10-05 Philipp Gampe <forge.typo3.org@philippgampe.info>
+
+ * [TASK] Fix CGL issues
+
+2011-08-30 Philipp Gampe <forge.typo3.org@philippgampe.info>
* [TASK] Release linkvalidator 1.0.4
-2011-08-26 Philipp Gampe <forge.typo3.org@philippgampe.info>
+2011-08-26 Philipp Gampe <forge.typo3.org@philippgampe.info>
* [BUGFIX] Fatal error with E_STRICT: Declaration of fetchType must be compatible with interface
* [TASK] Fix phpdoc and method signatures
* Fixed bug #26731: The info module does not show up in IE 7 and 8 (Michael Miousse)
* Fixed bug #13368: Content of Tab is not scrollable (Michael Miousse)
-2011-04-26 Michael Miousse <michael.miousse@infoglobe.ca>
+2011-04-26 Michael Miousse <michael.miousse@infoglobe.ca>
* Fixed bug #13757: Scheduler task does not work at all
-2011-04-21 Michael Miousse <michael.miousse@infoglobe.ca>
+2011-04-21 Michael Miousse <michael.miousse@infoglobe.ca>
* Fixed bug #13953: Third-party classes cannot be checked due to dynamicConfigFile in TCA (thanks to Jan Philipp Timme)
-
+
2011-02-24 Michael Miousse <michael.miousse@infoglobe.ca>
* Fixed bug #13340: Regression in TYPO3 4.5.1: pid and uid database fields are always 0
* Fixed bug #12649: Split up analyzeRecord()
* Cleaned emconf for the release of TYPO3 4.5.1
* Release linkvalidator 1.0.1
-
-2011-02-15 Michael Miousse <michael.miousse@infoglobe.ca>
- * Fixed bug #12652: If none of the link types are marked to be checked, all of them are checked
- * Fixed bug #12650: tx_linkvalidator_tasks_validator: exec() is too long
+2011-02-15 Michael Miousse <michael.miousse@infoglobe.ca>
+
+ * Fixed bug #12652: If none of the link types are marked to be checked, all of them are checked
+ * Fixed bug #12650: tx_linkvalidator_tasks_validator: exec() is too long
* Fixed bug #12454: Use setting "defaultMailFromName" and "defaultMailFromAddress"
-
+
2011-02-06 Christopher Stelmaszyk <chrissitopher@gmx.de>
* Fixed bug #12517: Replace exec_SELECTgetRows with exec_SELECTgetSingleRow whenever a single record is expected (thanks to Jo Hasenau)
*/
public function getLinkStatistics($checkOptions = array(), $considerHidden = FALSE) {
$results = array();
- if(count($checkOptions) > 0) {
+ if (count($checkOptions) > 0) {
$checkKeys = array_keys($checkOptions);
- $checkLinkTypeCondition = ' and link_type in (\'' . implode('\',\'',$checkKeys) . '\')';
+ $checkLinkTypeCondition = ' and link_type in (\'' . implode('\',\'', $checkKeys) . '\')';
$GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_linkvalidator_link',
- '(record_pid in (' . $this->pidList . ') or ( record_uid IN (' . $this->pidList . ') and table_name like \'pages\')) '
- . $checkLinkTypeCondition);
+ '(record_pid in (' . $this->pidList . ')'
+ . ' or ( record_uid IN (' . $this->pidList . ') and table_name like \'pages\')) '
+ . $checkLinkTypeCondition);
// Traverse all configured tables
foreach ($this->searchFields as $table => $fields) {
- if($table == 'pages'){
+ if ($table === 'pages') {
$where = 'deleted = 0 AND uid IN (' . $this->pidList . ')';
- }
- else{
+ } else {
$where = 'deleted = 0 AND pid IN (' . $this->pidList . ')';
}
if (!$considerHidden) {
// TODO: only select rows that have content in at least one of the relevant fields (via OR)
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($selectFields, $table, $where);
// Get record rows of table
- while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
- // Analyse each record
+ while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) !== FALSE) {
+ // Analyse each record
$this->analyzeRecord($results, $table, $fields, $row);
}
+ $GLOBALS['TYPO3_DB']->sql_free_result($res);
}
foreach ($this->hookObjectsArr as $key => $hookObj) {
private function analyseLinks(array $resultArray, array &$results, array $record, $field, $table) {
foreach ($resultArray['elements'] as $element) {
$r = $element['subst'];
- $title = '';
$type = '';
- $idRecord = $record['uid'];
+ $idRecord = $record['uid'];
if (!empty($r)) {
// Parse string for special TYPO3 <link> tag:
foreach ($this->hookObjectsArr as $keyArr => $hookObj) {
$idRecord = $record['uid'];
for ($i = 1; $i < count($linkTags); $i += 2) {
$referencedRecordType = '';
- foreach($resultArray['elements'] as $element) {
- $type = '';
- $r = $element['subst'];
-
- if (!empty($r['tokenID'])) {
- if (substr_count($linkTags[$i], $r['tokenID'])) {
- // Type of referenced record
- if (strpos($r['recordRef'], 'pages') !== FALSE) {
- $currentR = $r;
- // Contains number of the page
- $referencedRecordType = $r['tokenValue'];
- $wasPage = TRUE;
- }
- // Append number of content element to the page saved in the last loop
- elseif ((strpos($r['recordRef'], 'tt_content') !== FALSE) && ($wasPage === TRUE)) {
- $referencedRecordType = $referencedRecordType . '#c' . $r['tokenValue'];
- $wasPage = FALSE;
- } else {
- $currentR = $r;
- }
- $title = strip_tags($linkTags[$i]);
+ foreach ($resultArray['elements'] as $element) {
+ $type = '';
+ $r = $element['subst'];
+
+ if (!empty($r['tokenID'])) {
+ if (substr_count($linkTags[$i], $r['tokenID'])) {
+ // Type of referenced record
+ if (strpos($r['recordRef'], 'pages') !== FALSE) {
+ $currentR = $r;
+ // Contains number of the page
+ $referencedRecordType = $r['tokenValue'];
+ $wasPage = TRUE;
+
+ // Append number of content element to the page saved in the last loop
+ } elseif ((strpos($r['recordRef'], 'tt_content') !== FALSE) && (isset($wasPage) && $wasPage === TRUE)) {
+ $referencedRecordType = $referencedRecordType . '#c' . $r['tokenValue'];
+ $wasPage = FALSE;
+ } else {
+ $currentR = $r;
}
+ $title = strip_tags($linkTags[$i]);
}
+ }
}
foreach ($this->hookObjectsArr as $keyArr => $hookObj) {
$type = $hookObj->fetchType($currentR, $type, $keyArr);
public function getLinkCounts($curPage) {
$markerArray = array();
if (($res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
- 'count(uid) as nbBrokenLinks,link_type',
- 'tx_linkvalidator_link',
- 'record_pid in (' . $this->pidList . ')',
- 'link_type'
- ))) {
- while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
+ 'count(uid) as nbBrokenLinks,link_type',
+ 'tx_linkvalidator_link',
+ 'record_pid in (' . $this->pidList . ')',
+ 'link_type'
+ ))
+ ) {
+ while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) !== FALSE) {
$markerArray[$row['link_type']] = $row['nbBrokenLinks'];
$markerArray['brokenlinkCount'] += $row['nbBrokenLinks'];
}
}
+ $GLOBALS['TYPO3_DB']->sql_free_result($res);
return $markerArray;
}
* @param boolean $considerHidden Whether to consider hidden pages or not
* @return string Returns the list with a comma in the end (if any pages selected!)
*/
- public function extGetTreeList($id, $depth, $begin = 0, $permsClause, $considerHidden = FALSE) {
+ public function extGetTreeList($id, $depth, $begin = 0, $permsClause, $considerHidden = FALSE) {
$depth = intval($depth);
$begin = intval($begin);
$id = intval($id);
'pid=' . $id . ' AND deleted=0 AND ' . $permsClause
);
- while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
- if ($begin <= 0 && ($row['hidden']==0 || $considerHidden == 1)) {
+ while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) !== FALSE) {
+ if ($begin <= 0 && ($row['hidden'] == 0 || $considerHidden == 1)) {
$theList .= $row['uid'] . ',';
$this->extPageInTreeInfo[] = array($row['uid'], htmlspecialchars($row['title'], $depth));
}
- if ($depth > 1 && (!($row['hidden']==1 && $row['extendToSubpages']==1) || $considerHidden == 1)) {
+ if ($depth > 1 && (!($row['hidden'] == 1 && $row['extendToSubpages'] == 1) || $considerHidden == 1)) {
$theList .= $this->extGetTreeList($row['uid'], $depth - 1, $begin - 1, $permsClause, $considerHidden);
}
}
}
+ $GLOBALS['TYPO3_DB']->sql_free_result($res);
return $theList;
}
* @param array $pageInfo Array with uid, title, hidden, extendToSubpages from pages table
* @return boolean TRUE if rootline contains a hidden page, FALSE if not
*/
- public function getRootLineIsHidden(array $pageInfo){
+ public function getRootLineIsHidden(array $pageInfo) {
$hidden = FALSE;
- if ($pageInfo['extendToSubpages'] == 1 && $pageInfo['hidden'] == 1){
+ if ($pageInfo['extendToSubpages'] == 1 && $pageInfo['hidden'] == 1) {
$hidden = TRUE;
} else {
if ($pageInfo['pid'] > 0) {
'uid=' . $pageInfo['pid']
);
- while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+ while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) !== FALSE) {
$hidden = $this->getRootLineIsHidden($row);
}
- }
- else {
+ $GLOBALS['TYPO3_DB']->sql_free_result($res);
+ } else {
$hidden = FALSE;
}
}
if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/class.tx_linkvalidator_processor.php'])) {
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/linkvalidator/classes/class.tx_linkvalidator_processor.php']);
}
-?>
+?>
\ No newline at end of file
$isValidUrl = TRUE;
if (isset($this->urlReports[$url])) {
- if(!$this->urlReports[$url]) {
+ if (!$this->urlReports[$url]) {
if(is_array($this->urlErrorParams[$url])) {
$this->setErrorParams($this->urlErrorParams[$url]);
}
$errorParams['message'] = $response->getReasonPhrase();
}
- if(!$isValidUrl) {
+ if (!$isValidUrl) {
$this->setErrorParams($errorParams);
}
* @return boolean TRUE on success or FALSE on error
*/
public function checkLink($url, array $softRefEntry, tx_linkvalidator_Processor $reference) {
- $page = '';
$anchor = '';
- $response = TRUE;
$this->responseContent = TRUE;
// Might already contain values - empty it
* @return void
*/
public function setEmail($email) {
- $this->email=$email;
+ $this->email = $email;
}
/**
* @return void
*/
public function setPage($page) {
- $this->page =$page;
+ $this->page = $page;
}
/**
$modTS = t3lib_BEfunc::getModTSconfig($page, 'mod.linkvalidator');
$parseObj = t3lib_div::makeInstance('t3lib_TSparser');
$parseObj->parse($this->configuration);
- if(count($parseObj->errors) > 0){
+ if (count($parseObj->errors) > 0) {
$parseErrorMessage = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.error.invalidTSconfig') . '<br />';
- foreach($parseObj->errors as $errorInfo){
+ foreach ($parseObj->errors as $errorInfo) {
$parseErrorMessage .= $errorInfo[0] . '<br />';
}
throw new Exception(
* @return array $searchFields List of fields
*/
protected function getSearchField(array $modTS) {
- // Get the searchFields from TypoScript
+ // Get the searchFields from TypoScript
foreach ($modTS['searchFields.'] as $table => $fieldList) {
$fields = t3lib_div::trimExplode(',', $fieldList);
foreach ($fields as $field) {
$typesTmp = t3lib_div::trimExplode(',', $modTS['linktypes'], 1);
if (is_array($typesTmp)) {
if (!empty($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])
- && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
+ && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $type => $value) {
if (in_array($type, $typesTmp)) {
$linkTypes[$type] = 1;
*/
protected function reportEmail($pageSections, array $modTS) {
$content = t3lib_parsehtml::substituteSubpart($this->templateMail, '###PAGE_SECTION###', $pageSections);
- /** @var array $markerArray */
+ /** @var array $markerArray */
$markerArray = array();
- /** @var array $validEmailList */
+ /** @var array $validEmailList */
$validEmailList = array();
- /** @var boolean $sendEmail */
+ /** @var boolean $sendEmail */
$sendEmail = TRUE;
$markerArray['totalBrokenLink'] = $this->totalBrokenLink;
$markerArray['totalBrokenLink_old'] = $this->oldTotalBrokenLink;
$content = t3lib_parsehtml::substituteMarkerArray($content, $markerArray, '###|###', TRUE, TRUE);
- /** @var t3lib_mail_Message $mail */
+ /** @var t3lib_mail_Message $mail */
$mail = t3lib_div::makeInstance('t3lib_mail_Message');
- if(empty($modTS['mail.']['fromemail'])) {
+ if (empty($modTS['mail.']['fromemail'])) {
$modTS['mail.']['fromemail'] = t3lib_utility_Mail::getSystemFromAddress();
}
- if(empty($modTS['mail.']['fromname'])) {
+ if (empty($modTS['mail.']['fromname'])) {
$modTS['mail.']['fromname'] = t3lib_utility_Mail::getSystemFromName();
}
if (t3lib_div::validEmail($modTS['mail.']['fromemail'])) {
$mail->setFrom(array($modTS['mail.']['fromemail'] => $modTS['mail.']['fromname']));
- } else {
+ } else {
throw new Exception(
$GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.error.invalidFromEmail'),
'1295476760'
);
}
- if(t3lib_div::validEmail($modTS['mail.']['replytoemail'])) {
+ if (t3lib_div::validEmail($modTS['mail.']['replytoemail'])) {
$mail->setReplyTo(array($modTS['mail.']['replytoemail'] => $modTS['mail.']['replytoname']));
}
- if(!empty($modTS['mail.']['subject'])) {
+ if (!empty($modTS['mail.']['subject'])) {
$mail->setSubject($modTS['mail.']['subject']);
} else {
throw new Exception(
$sendEmail = FALSE;
}
- if($sendEmail) {
- $mail->setBody($content,'text/html');
+ if ($sendEmail) {
+ $mail->setBody($content, 'text/html');
$mail->send();
}
$fieldID = 'task_page';
- $fieldCode = '<input type="text" name="tx_scheduler[linkvalidator][page]" id="' . $fieldID . '" value="' . htmlspecialchars($taskInfo['page']) . '"/>';
+ $fieldCode = '<input type="text" name="tx_scheduler[linkvalidator][page]" id="' . $fieldID . '" value="'
+ . htmlspecialchars($taskInfo['page']) . '"/>';
$label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.page');
$label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
$additionalFields[$fieldID] = array(
$fieldCode = '<select name="tx_scheduler[linkvalidator][depth]" id="' . $fieldID . '">';
foreach ($fieldValueArray as $depth => $label) {
- $fieldCode .= "\t" . '<option value="' . htmlspecialchars($depth) . '"' . (($depth ==$taskInfo['depth']) ? ' selected="selected"' : '') . '>' . $label . '</option>';
+ $fieldCode .= "\t" . '<option value="' . htmlspecialchars($depth) . '"'
+ . (($depth == $taskInfo['depth']) ? ' selected="selected"' : '')
+ . '>' . $label . '</option>';
}
$fieldCode .= '</select>';
);
$fieldID = 'task_configuration';
- $fieldCode = '<textarea name="tx_scheduler[linkvalidator][configuration]" id="' . $fieldID . '" >' . htmlspecialchars($taskInfo['configuration']) . '</textarea>';
+ $fieldCode = '<textarea name="tx_scheduler[linkvalidator][configuration]" id="' . $fieldID . '" >'
+ . htmlspecialchars($taskInfo['configuration']) . '</textarea>';
$label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.conf');
$label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
$additionalFields[$fieldID] = array(
);
$fieldID = 'task_email';
- $fieldCode = '<input type="text" name="tx_scheduler[linkvalidator][email]" id="' . $fieldID . '" value="' . htmlspecialchars($taskInfo['email']) . '" />';
+ $fieldCode = '<input type="text" name="tx_scheduler[linkvalidator][email]" id="' . $fieldID . '" value="'
+ . htmlspecialchars($taskInfo['email']) . '" />';
$label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.email');
$label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
$additionalFields[$fieldID] = array(
'label' => $label
);
$fieldID = 'task_emailOnBrokenLinkOnly';
- $fieldCode = '<input type="checkbox" name="tx_scheduler[linkvalidator][emailOnBrokenLinkOnly]" id="' . $fieldID . '" ' . (htmlspecialchars($taskInfo['emailOnBrokenLinkOnly']) ? 'checked="checked"' : '') . ' />';
+ $fieldCode = '<input type="checkbox" name="tx_scheduler[linkvalidator][emailOnBrokenLinkOnly]" id="' . $fieldID . '" '
+ . (htmlspecialchars($taskInfo['emailOnBrokenLinkOnly']) ? 'checked="checked"' : '') . ' />';
$label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.emailOnBrokenLinkOnly');
$label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
$additionalFields[$fieldID] = array(
);
$fieldID = 'task_emailTemplateFile';
- $fieldCode = '<input type="text" name="tx_scheduler[linkvalidator][emailTemplateFile]" id="' . $fieldID . '" value="' . htmlspecialchars($taskInfo['emailTemplateFile']) . '" />';
+ $fieldCode = '<input type="text" name="tx_scheduler[linkvalidator][emailTemplateFile]" id="' . $fieldID
+ . '" value="' . htmlspecialchars($taskInfo['emailTemplateFile']) . '" />';
$label = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.validate.emailTemplateFile');
$label = t3lib_BEfunc::wrapInHelp('linkvalidator', $fieldID, $label);
$additionalFields[$fieldID] = array(
public function validateAdditionalFields(array &$submittedData, tx_scheduler_Module $schedulerModule) {
$isValid = TRUE;
- //TODO add validation to validate the $submittedData['configuration'] which is normally a comma separated string
+ //TODO add validation to validate the $submittedData['configuration'] which is normally a comma separated string
if (!empty($submittedData['linkvalidator']['email'])) {
$emailList = t3lib_div::trimExplode(',', $submittedData['linkvalidator']['email']);
foreach ($emailList as $emailAdd) {
t3lib_FlashMessage::ERROR
);
}
+ $GLOBALS['TYPO3_DB']->sql_free_result($res);
} else {
$isValid = FALSE;
$schedulerModule->addMessage(
$task->setDepth($submittedData['linkvalidator']['depth']);
$task->setPage($submittedData['linkvalidator']['page']);
$task->setEmail($submittedData['linkvalidator']['email']);
- if($submittedData['linkvalidator']['emailOnBrokenLinkOnly']){
+ if ($submittedData['linkvalidator']['emailOnBrokenLinkOnly']) {
$task->setEmailOnBrokenLinkOnly(1);
- }
- else{
+ } else {
$task->setEmailOnBrokenLinkOnly(0);
}
$task->setConfiguration($submittedData['linkvalidator']['configuration']);
protected $refreshListHtml;
/**
- * Html for the statistics table with the checkboxes of the link types and the numbers of broken links for report tab
+ * Html for the statistics table with the checkboxes of the link types
+ * and the numbers of broken links for report tab
*
* @var string
*/
/**
- * Html for the statistics table with the checkboxes of the link types and the numbers of broken links for check links tab
+ * Html for the statistics table with the checkboxes of the link types
+ * and the numbers of broken links for check links tab
*
* @var string
*/
*/
protected $content;
+ /** @var t3lib_pageRenderer $pageRenderer */
+ protected $pageRenderer;
+
/**
* Main method of modfuncreport
*
$set = t3lib_div::_GP($prefix . 'SET');
$this->pObj->handleExternalFunctionValue();
- if(isset($this->searchLevel)) {
+ if (isset($this->searchLevel)) {
$this->pObj->MOD_SETTINGS['searchlevel'] = $this->searchLevel;
} else {
$this->searchLevel = $this->pObj->MOD_SETTINGS['searchlevel'];
$this->initialize();
// Setting up the context sensitive menu
$this->resPath = $this->doc->backPath . t3lib_extMgm::extRelPath('linkvalidator') . 'res/';
- /** @var t3lib_pageRenderer $pageRenderer */
$this->pageRenderer = $this->doc->getPageRenderer();
// Localization
$this->pageRenderer->addInlineLanguageLabelFile(t3lib_extMgm::extPath('linkvalidator', 'modfuncreport/locallang.xml'));
- $this->pageRenderer->addJsInlineCode('linkvalidator','function toggleActionButton(prefix) {
+ $this->pageRenderer->addJsInlineCode('linkvalidator', 'function toggleActionButton(prefix) {
var buttonDisable = true;
Ext.select(\'.\' + prefix ,false).each(function(checkBox,i){
checkDom = checkBox.dom;
- if(checkDom.checked){
+ if (checkDom.checked){
buttonDisable = false;
}
});
- if(prefix == \'check\'){
+ if (prefix == \'check\'){
checkSub = document.getElementById(\'updateLinkList\');
- }
- else{
+ } else {
checkSub = document.getElementById(\'refreshLinkList\');
}
checkSub.disabled = buttonDisable;
-
-
}');
+
// Add JS
$this->pageRenderer->addJsFile($this->doc->backPath . '../t3lib/js/extjs/ux/Ext.ux.FitToParent.js');
$this->pageRenderer->addJsFile($this->doc->backPath . '../t3lib/js/extjs/ux/flashmessages.js');
$this->pageRenderer->addJsFile($this->doc->backPath . 'js/extjs/iframepanel.js');
if ($this->modTS['showCheckLinkTab'] == 1) {
- $this->updateListHtml = '<input type="submit" name="updateLinkList" id="updateLinkList" value="' . $GLOBALS['LANG']->getLL('label_update') . '"/>';
+ $this->updateListHtml = '<input type="submit" name="updateLinkList" id="updateLinkList" value="'
+ . $GLOBALS['LANG']->getLL('label_update') . '"/>';
}
- $this->refreshListHtml = '<input type="submit" name="refreshLinkList" id="refreshLinkList" value="' . $GLOBALS['LANG']->getLL('label_refresh') . '"/>';
+ $this->refreshListHtml = '<input type="submit" name="refreshLinkList" id="refreshLinkList" value="'
+ . $GLOBALS['LANG']->getLL('label_refresh') . '"/>';
$this->processor = t3lib_div::makeInstance('tx_linkvalidator_Processor');
$this->updateBrokenLinks();
$panelCheck = '';
if ($this->modTS['showCheckLinkTab'] == 1) {
$panelCheck = "{
- title: TYPO3.l10n.localize('CheckLink'),
- html: " . json_encode($this->flush()) . ",
+ title: TYPO3.l10n.localize('CheckLink'),
+ html: " . json_encode($this->flush()) . ",
}";
}
* @return array Module menu
*/
public function modMenu() {
- $modMenu = array (
+ $modMenu = array(
'checkAllLink' => 0,
);
);
- if ($this->pObj->pageinfo['hidden'] == 0 || $this->modTS['checkhidden'] == 1){
+ if ($this->pObj->pageinfo['hidden'] == 0 || $this->modTS['checkhidden'] == 1) {
$pageList .= $this->pObj->id;
}
$content = $this->doc->moduleBody(
$this->pageRecord,
$this->getDocHeaderButtons(),
- ($form) ? $this->getTemplateMarkers(): $this->getTemplateMarkersCheck()
+ ($form) ? $this->getTemplateMarkers() : $this->getTemplateMarkersCheck()
);
return $content;
);
foreach ($parts as $kv => $label) {
- $opt[] = '<option value="' . $kv . '"' . ($kv == intval($this->searchLevel) ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>';
+ $opt[] = '<option value="' . $kv . '"'
+ . ($kv == intval($this->searchLevel)
+ ? ' selected="selected"'
+ : '') . '>' . htmlspecialchars($label)
+ . '</option>';
}
$lMenu = '<select name="search_levels">' . implode('', $opt) . '</select>';
return $lMenu;
$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;
}
$brokenLinksMarker = $this->startTable();
// Table rows containing the broken links
- while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
+ while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) !== FALSE) {
$items[] = $this->renderTableRow($row['table_name'], $row, $brokenLinksItemTemplate);
}
$brokenLinkItems = implode(chr(10), $items);
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',
$makerTableHead['tablehead_lastcheck'] = $GLOBALS['LANG']->getLL('list.tableHead.lastCheck');
// Add CSH to the header of each column
- foreach($makerTableHead as $column => $label) {
+ foreach ($makerTableHead as $column => $label) {
$label = t3lib_BEfunc::wrapInHelp('linkvalidator', $column, $label);
$makerTableHead[$column] = $label;
}
$params = '&edit[' . $table . '][' . $row['record_uid'] . ']=edit';
$actionLinks = '<a href="#" onclick="' .
- t3lib_BEfunc::editOnClick(
- $params,
- $GLOBALS['BACK_PATH'],
- t3lib_div::getIndpEnv('REQUEST_URI') . '?id=' . $this->pObj->id . '&search_levels=' . $this->searchLevel
- ) . '"' .
- ' title="' . $GLOBALS['LANG']->getLL('list.edit') . '">' .
- t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
+ t3lib_BEfunc::editOnClick(
+ $params,
+ $GLOBALS['BACK_PATH'],
+ t3lib_div::getIndpEnv('REQUEST_URI') . '?id=' . $this->pObj->id . '&search_levels=' . $this->searchLevel
+ ) . '"' .
+ ' title="' . $GLOBALS['LANG']->getLL('list.edit') . '">' .
+ t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
$elementHeadline = $row['headline'];
if (empty($elementHeadline)) {
$fieldName = $GLOBALS['LANG']->sL($fieldName);
// Crop colon from end if present
if (substr($fieldName, '-1', '1') === ':') {
- $fieldName = substr($fieldName, '0', strlen($fieldName)-1);
+ $fieldName = substr($fieldName, '0', strlen($fieldName) - 1);
}
}
// Fallback, if there is no label
protected function getCheckOptions(array $brokenLinkOverView, $prefix = '') {
$markerArray = array();
$additionalAttr = '';
- if(!empty($prefix)) {
+ if (!empty($prefix)) {
$additionalAttr = ' onclick="toggleActionButton(\'' . $prefix . '\');" class="' . $prefix . '" ';
}
else {
}
$checkOptionsTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###CHECKOPTIONS_SECTION###');
- $hookSectionContent = '';
$hookSectionTemplate = t3lib_parsehtml::getSubpart($checkOptionsTemplate, '###HOOK_SECTION###');
$markerArray['statistics_header'] = $this->doc->sectionHeader($GLOBALS['LANG']->getLL('report.statistics.header'));
}
$translation = $GLOBALS['LANG']->getLL('hooks.' . $type);
$translation = $translation ? $translation : $type;
- $option = '<input type="checkbox" ' . $additionalAttr . ' id="' . $prefix . 'SET_' . $type . '" name="' . $prefix . 'SET[' . $type . ']" value="1"' . ($this->pObj->MOD_SETTINGS[$type] ? ' checked="checked"' : '') .
- '/>'.'<label for="' . $prefix . 'SET[' . $type . ']">' . htmlspecialchars( $translation ) . '</label>';
+ $option = '<input type="checkbox" ' . $additionalAttr . ' id="' . $prefix . 'SET_' . $type
+ . '" name="' . $prefix . 'SET[' . $type . ']" value="1"' . ($this->pObj->MOD_SETTINGS[$type]
+ ? ' checked="checked"' : '') . '/>' . '<label for="' . $prefix . 'SET[' . $type . ']">'
+ . htmlspecialchars($translation) . '</label>';
$hookSectionMarker['option'] = $option;
$hookSectionContent .= t3lib_parsehtml::substituteMarkerArray($hookSectionTemplate, $hookSectionMarker, '###|###', TRUE, TRUE);
}
*/
protected function getTemplateMarkers() {
$markers = array(
- 'FUNC_TITLE' => $GLOBALS['LANG']->getLL('report.func.title'),
- 'CHECKOPTIONS_TITLE' => $GLOBALS['LANG']->getLL('report.statistics.header'),
- 'FUNC_MENU' => $this->getLevelSelector(),
- 'CONTENT' => $this->content,
- 'CHECKALLLINK' => $this->checkAllHtml,
- 'CHECKOPTIONS' => $this->checkOptHtml,
- 'ID' => '<input type="hidden" name="id" value="' . $this->pObj->id . '" />',
- 'REFRESH' => $this->refreshListHtml,
- 'UPDATE' => ''
+ 'FUNC_TITLE' => $GLOBALS['LANG']->getLL('report.func.title'),
+ 'CHECKOPTIONS_TITLE' => $GLOBALS['LANG']->getLL('report.statistics.header'),
+ 'FUNC_MENU' => $this->getLevelSelector(),
+ 'CONTENT' => $this->content,
+ 'CHECKALLLINK' => $this->checkAllHtml,
+ 'CHECKOPTIONS' => $this->checkOptHtml,
+ 'ID' => '<input type="hidden" name="id" value="' . $this->pObj->id . '" />',
+ 'REFRESH' => $this->refreshListHtml,
+ 'UPDATE' => ''
);
return $markers;
*/
protected function getTemplateMarkersCheck() {
$markers = array(
- 'FUNC_TITLE' =>$GLOBALS['LANG']->getLL('checklinks.func.title'),
- 'CHECKOPTIONS_TITLE' =>$GLOBALS['LANG']->getLL('checklinks.statistics.header'),
- 'FUNC_MENU' => $this->getLevelSelector(),
- 'CONTENT' => '',
- 'CHECKALLLINK' => $this->checkAllHtml,
- 'CHECKOPTIONS' => $this->checkOptHtmlCheck,
- 'ID' => '<input type="hidden" name="id" value="' . $this->pObj->id . '" />',
- 'REFRESH' => '',
- 'UPDATE' => $this->updateListHtml
+ 'FUNC_TITLE' => $GLOBALS['LANG']->getLL('checklinks.func.title'),
+ 'CHECKOPTIONS_TITLE' => $GLOBALS['LANG']->getLL('checklinks.statistics.header'),
+ 'FUNC_MENU' => $this->getLevelSelector(),
+ 'CONTENT' => '',
+ 'CHECKALLLINK' => $this->checkAllHtml,
+ 'CHECKOPTIONS' => $this->checkOptHtmlCheck,
+ 'ID' => '<input type="hidden" name="id" value="' . $this->pObj->id . '" />',
+ 'REFRESH' => '',
+ 'UPDATE' => $this->updateListHtml
);
return $markers;
* @return boolean Whether the current user is admin
*/
protected function isCurrentUserAdmin() {
- return ((bool) $GLOBALS['BE_USER']->user['admin']);
+ return ((bool)$GLOBALS['BE_USER']->user['admin']);
}
}