@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | * |
96 | 96 | * @return array Menu array |
97 | 97 | */ |
98 | - function modMenu() { |
|
98 | + function modMenu() { |
|
99 | 99 | global $LANG; |
100 | 100 | |
101 | - return array ( |
|
101 | + return array( |
|
102 | 102 | 'depth' => array( |
103 | 103 | 0 => $LANG->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_0'), |
104 | 104 | 1 => $LANG->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_1'), |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | } |
156 | 156 | |
157 | 157 | // Set CSS styles specific for this document: |
158 | - $this->pObj->content = str_replace('/*###POSTCSSMARKER###*/',' |
|
158 | + $this->pObj->content = str_replace('/*###POSTCSSMARKER###*/', ' |
|
159 | 159 | TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; } |
160 | 160 | ',$this->pObj->content); |
161 | 161 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | |
202 | 202 | // Additional menus for the log type: |
203 | - if ($this->pObj->MOD_SETTINGS['crawlaction']==='log') { |
|
203 | + if ($this->pObj->MOD_SETTINGS['crawlaction'] === 'log') { |
|
204 | 204 | $h_func .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu( |
205 | 205 | $this->pObj->id, |
206 | 206 | 'SET[depth]', |
@@ -209,15 +209,15 @@ discard block |
||
209 | 209 | 'index.php' |
210 | 210 | ); |
211 | 211 | |
212 | - $quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details=' . intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : ''; |
|
212 | + $quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : ''; |
|
213 | 213 | |
214 | 214 | $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID')); |
215 | 215 | |
216 | - $h_func.= '<hr/>'. |
|
217 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.display').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id,'SET[log_display]',$this->pObj->MOD_SETTINGS['log_display'],$this->pObj->MOD_MENU['log_display'],'index.php','&setID='.$setId) . ' - ' . |
|
218 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showresultlog').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id,'SET[log_resultLog]',$this->pObj->MOD_SETTINGS['log_resultLog'],'index.php','&setID='.$setId . $quiPart) . ' - ' . |
|
219 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showfevars').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id,'SET[log_feVars]',$this->pObj->MOD_SETTINGS['log_feVars'],'index.php','&setID='.$setId . $quiPart) . ' - ' . |
|
220 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage').': ' . |
|
216 | + $h_func .= '<hr/>'. |
|
217 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.display').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, 'SET[log_display]', $this->pObj->MOD_SETTINGS['log_display'], $this->pObj->MOD_MENU['log_display'], 'index.php', '&setID='.$setId).' - '. |
|
218 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showresultlog').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, 'SET[log_resultLog]', $this->pObj->MOD_SETTINGS['log_resultLog'], 'index.php', '&setID='.$setId.$quiPart).' - '. |
|
219 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showfevars').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, 'SET[log_feVars]', $this->pObj->MOD_SETTINGS['log_feVars'], 'index.php', '&setID='.$setId.$quiPart).' - '. |
|
220 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage').': '. |
|
221 | 221 | \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu( |
222 | 222 | $this->pObj->id, |
223 | 223 | 'SET[itemsPerPage]', |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $theOutput = $this->pObj->doc->section($LANG->getLL('title'), $h_func, 0, 1); |
231 | 231 | |
232 | 232 | // Branch based on type: |
233 | - switch ((string)$this->pObj->MOD_SETTINGS['crawlaction']) { |
|
233 | + switch ((string) $this->pObj->MOD_SETTINGS['crawlaction']) { |
|
234 | 234 | case 'start': |
235 | 235 | if (empty($this->pObj->id)) { |
236 | 236 | $this->addErrorMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected')); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | * |
279 | 279 | * @return string HTML output |
280 | 280 | */ |
281 | - function drawURLs() { |
|
281 | + function drawURLs() { |
|
282 | 282 | global $BACK_PATH, $BE_USER; |
283 | 283 | |
284 | 284 | // Init: |
@@ -287,12 +287,12 @@ discard block |
||
287 | 287 | $this->downloadCrawlUrls = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_download'); |
288 | 288 | $this->makeCrawlerProcessableChecks(); |
289 | 289 | |
290 | - switch((string)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp')) { |
|
290 | + switch ((string) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp')) { |
|
291 | 291 | case 'midnight': |
292 | - $this->scheduledTime = mktime(0,0,0); |
|
292 | + $this->scheduledTime = mktime(0, 0, 0); |
|
293 | 293 | break; |
294 | 294 | case '04:00': |
295 | - $this->scheduledTime = mktime(0,0,0)+4*3600; |
|
295 | + $this->scheduledTime = mktime(0, 0, 0) + 4 * 3600; |
|
296 | 296 | break; |
297 | 297 | case 'now': |
298 | 298 | default: |
@@ -312,23 +312,23 @@ discard block |
||
312 | 312 | $this->crawlerObj->setID = \TYPO3\CMS\Core\Utility\GeneralUtility::md5int(microtime()); |
313 | 313 | |
314 | 314 | if (empty($this->incomingConfigurationSelection) |
315 | - || (count($this->incomingConfigurationSelection)==1 && empty($this->incomingConfigurationSelection[0])) |
|
315 | + || (count($this->incomingConfigurationSelection) == 1 && empty($this->incomingConfigurationSelection[0])) |
|
316 | 316 | ) { |
317 | - $code= ' |
|
317 | + $code = ' |
|
318 | 318 | <tr> |
319 | 319 | <td colspan="7"><b>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noConfigSelected').'</b></td> |
320 | 320 | </tr>'; |
321 | 321 | } else { |
322 | - if($this->submitCrawlUrls){ |
|
322 | + if ($this->submitCrawlUrls) { |
|
323 | 323 | $reason = new tx_crawler_domain_reason(); |
324 | 324 | $reason->setReason(tx_crawler_domain_reason::REASON_GUI_SUBMIT); |
325 | 325 | |
326 | - if($BE_USER instanceof \TYPO3\CMS\Core\Authentication\BackendUserAuthentication){ $username = $BE_USER->user['username']; } |
|
326 | + if ($BE_USER instanceof \TYPO3\CMS\Core\Authentication\BackendUserAuthentication) { $username = $BE_USER->user['username']; } |
|
327 | 327 | $reason->setDetailText('The user '.$username.' added pages to the crawler queue manually '); |
328 | 328 | |
329 | - tx_crawler_domain_events_dispatcher::getInstance()->post( 'invokeQueueChange', |
|
329 | + tx_crawler_domain_events_dispatcher::getInstance()->post('invokeQueueChange', |
|
330 | 330 | $this->findCrawler()->setID, |
331 | - array( 'reason' => $reason )); |
|
331 | + array('reason' => $reason)); |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | $code = $this->crawlerObj->getPageTreeAndUrls( |
@@ -349,18 +349,18 @@ discard block |
||
349 | 349 | $this->duplicateTrack = $this->crawlerObj->duplicateTrack; |
350 | 350 | |
351 | 351 | $output = ''; |
352 | - if ($code) { |
|
352 | + if ($code) { |
|
353 | 353 | |
354 | 354 | $output .= '<h3>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configuration').':</h3>'; |
355 | 355 | $output .= '<input type="hidden" name="id" value="'.intval($this->pObj->id).'" />'; |
356 | 356 | |
357 | - if (!$this->submitCrawlUrls) { |
|
357 | + if (!$this->submitCrawlUrls) { |
|
358 | 358 | $output .= $this->drawURLs_cfgSelectors().'<br />'; |
359 | 359 | $output .= '<input type="submit" name="_update" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerUpdate').'" /> '; |
360 | 360 | $output .= '<input type="submit" name="_crawl" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerCrawl').'" /> '; |
361 | 361 | $output .= '<input type="submit" name="_download" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerDownload').'" /><br /><br />'; |
362 | 362 | $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count').': '.count(array_keys($this->duplicateTrack)).'<br />'; |
363 | - $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s',time()).'<br />'; |
|
363 | + $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s', time()).'<br />'; |
|
364 | 364 | $output .= '<br /> |
365 | 365 | <table class="lrPadding c-list url-table">'. |
366 | 366 | $this->drawURLs_printTableHeader(). |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | } |
375 | 375 | |
376 | 376 | // Download Urls to crawl: |
377 | - if ($this->downloadCrawlUrls) { |
|
377 | + if ($this->downloadCrawlUrls) { |
|
378 | 378 | |
379 | 379 | // Creating output header: |
380 | 380 | $mimeType = 'application/octet-stream'; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | Header('Content-Disposition: attachment; filename=CrawlerUrls.txt'); |
383 | 383 | |
384 | 384 | // Printing the content of the CSV lines: |
385 | - echo implode(chr(13).chr(10),$this->downloadUrls); |
|
385 | + echo implode(chr(13).chr(10), $this->downloadUrls); |
|
386 | 386 | |
387 | 387 | // Exits: |
388 | 388 | exit; |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | * |
398 | 398 | * @return string HTML table |
399 | 399 | */ |
400 | - function drawURLs_cfgSelectors() { |
|
400 | + function drawURLs_cfgSelectors() { |
|
401 | 401 | |
402 | 402 | // depth |
403 | 403 | $cell[] = $this->selectorBox( |
@@ -413,11 +413,11 @@ discard block |
||
413 | 413 | $this->pObj->MOD_SETTINGS['depth'], |
414 | 414 | 0 |
415 | 415 | ); |
416 | - $availableConfigurations = $this->crawlerObj->getConfigurationsForBranch($this->pObj->id, $this->pObj->MOD_SETTINGS['depth']?$this->pObj->MOD_SETTINGS['depth']:0 ); |
|
416 | + $availableConfigurations = $this->crawlerObj->getConfigurationsForBranch($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'] ? $this->pObj->MOD_SETTINGS['depth'] : 0); |
|
417 | 417 | |
418 | 418 | // Configurations |
419 | 419 | $cell[] = $this->selectorBox( |
420 | - empty($availableConfigurations)?array():array_combine($availableConfigurations, $availableConfigurations), |
|
420 | + empty($availableConfigurations) ? array() : array_combine($availableConfigurations, $availableConfigurations), |
|
421 | 421 | 'configurationSelection', |
422 | 422 | $this->incomingConfigurationSelection, |
423 | 423 | 1 |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | * |
479 | 479 | * @return string Table header |
480 | 480 | */ |
481 | - function drawURLs_printTableHeader() { |
|
481 | + function drawURLs_printTableHeader() { |
|
482 | 482 | |
483 | 483 | $content = ' |
484 | 484 | <tr class="bgColor5 tableheader"> |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | * |
517 | 517 | * @return string HTML output |
518 | 518 | */ |
519 | - function drawLog() { |
|
519 | + function drawLog() { |
|
520 | 520 | global $BACK_PATH; |
521 | 521 | $output = ''; |
522 | 522 | |
@@ -529,45 +529,45 @@ discard block |
||
529 | 529 | |
530 | 530 | // Read URL: |
531 | 531 | if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')) { |
532 | - $this->crawlerObj->readUrl(intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')),TRUE); |
|
532 | + $this->crawlerObj->readUrl(intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')), TRUE); |
|
533 | 533 | } |
534 | 534 | |
535 | 535 | // Look for set ID sent - if it is, we will display contents of that set: |
536 | 536 | $showSetId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID')); |
537 | 537 | |
538 | 538 | // Show details: |
539 | - if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) { |
|
539 | + if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) { |
|
540 | 540 | |
541 | 541 | // Get entry record: |
542 | - list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*','tx_crawler_queue','qid='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details'))); |
|
542 | + list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_crawler_queue', 'qid='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details'))); |
|
543 | 543 | |
544 | 544 | // Explode values: |
545 | 545 | $resStatus = $this->getResStatus($q_entry); |
546 | 546 | $q_entry['parameters'] = unserialize($q_entry['parameters']); |
547 | 547 | $q_entry['result_data'] = unserialize($q_entry['result_data']); |
548 | - if (is_array($q_entry['result_data'])) { |
|
548 | + if (is_array($q_entry['result_data'])) { |
|
549 | 549 | $q_entry['result_data']['content'] = unserialize($q_entry['result_data']['content']); |
550 | 550 | } |
551 | 551 | |
552 | - if(!$this->pObj->MOD_SETTINGS['log_resultLog']) { |
|
552 | + if (!$this->pObj->MOD_SETTINGS['log_resultLog']) { |
|
553 | 553 | unset($q_entry['result_data']['content']['log']); |
554 | 554 | } |
555 | 555 | |
556 | 556 | // Print rudimentary details: |
557 | 557 | $output .= ' |
558 | 558 | <br /><br /> |
559 | - <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back') . '" name="_back" /> |
|
560 | - <input type="hidden" value="' . $this->pObj->id . '" name="id" /> |
|
561 | - <input type="hidden" value="' . $showSetId . '" name="setID" /> |
|
559 | + <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back').'" name="_back" /> |
|
560 | + <input type="hidden" value="' . $this->pObj->id.'" name="id" /> |
|
561 | + <input type="hidden" value="' . $showSetId.'" name="setID" /> |
|
562 | 562 | <br /> |
563 | - Current server time: ' . date('H:i:s', time()) . '<br />' . |
|
564 | - 'Status: ' . $resStatus . '<br />' . |
|
563 | + Current server time: ' . date('H:i:s', time()).'<br />'. |
|
564 | + 'Status: '.$resStatus.'<br />'. |
|
565 | 565 | \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($q_entry); |
566 | 566 | } else { // Show list: |
567 | 567 | |
568 | 568 | // If either id or set id, show list: |
569 | - if ($this->pObj->id || $showSetId) { |
|
570 | - if ($this->pObj->id) { |
|
569 | + if ($this->pObj->id || $showSetId) { |
|
570 | + if ($this->pObj->id) { |
|
571 | 571 | // Drawing tree: |
572 | 572 | $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView'); |
573 | 573 | $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); |
@@ -589,16 +589,16 @@ discard block |
||
589 | 589 | ); |
590 | 590 | |
591 | 591 | // Get branch beneath: |
592 | - if ($this->pObj->MOD_SETTINGS['depth']) { |
|
592 | + if ($this->pObj->MOD_SETTINGS['depth']) { |
|
593 | 593 | $tree->getTree($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'], ''); |
594 | 594 | } |
595 | 595 | |
596 | 596 | // Traverse page tree: |
597 | 597 | $code = ''; $count = 0; |
598 | - foreach($tree->tree as $data) { |
|
598 | + foreach ($tree->tree as $data) { |
|
599 | 599 | $code .= $this->drawLog_addRows( |
600 | 600 | $data['row'], |
601 | - $data['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages',$data['row'],TRUE), |
|
601 | + $data['HTML'].\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $data['row'], TRUE), |
|
602 | 602 | intval($this->pObj->MOD_SETTINGS['itemsPerPage']) |
603 | 603 | ); |
604 | 604 | if (++$count == 1000) { |
@@ -607,13 +607,13 @@ discard block |
||
607 | 607 | } |
608 | 608 | } else { |
609 | 609 | $code = ''; |
610 | - $code.= $this->drawLog_addRows( |
|
610 | + $code .= $this->drawLog_addRows( |
|
611 | 611 | $showSetId, |
612 | 612 | 'Set ID: '.$showSetId |
613 | 613 | ); |
614 | 614 | } |
615 | 615 | |
616 | - if ($code) { |
|
616 | + if ($code) { |
|
617 | 617 | |
618 | 618 | $output .= ' |
619 | 619 | <br /><br /> |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | <input type="hidden" value="'.$this->pObj->id.'" name="id" /> |
625 | 625 | <input type="hidden" value="'.$showSetId.'" name="setID" /> |
626 | 626 | <br /> |
627 | - '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s',time()).' |
|
627 | + '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s', time()).' |
|
628 | 628 | <br /><br /> |
629 | 629 | |
630 | 630 | |
@@ -650,10 +650,10 @@ discard block |
||
650 | 650 | </tr> |
651 | 651 | '; |
652 | 652 | |
653 | - $cc=0; |
|
654 | - foreach($setList as $set) { |
|
655 | - $code.= ' |
|
656 | - <tr class="bgColor'.($cc%2 ? '-20':'-10').'"> |
|
653 | + $cc = 0; |
|
654 | + foreach ($setList as $set) { |
|
655 | + $code .= ' |
|
656 | + <tr class="bgColor'.($cc % 2 ? '-20' : '-10').'"> |
|
657 | 657 | <td><a href="'.htmlspecialchars('index.php?setID='.$set['set_id']).'">'.$set['set_id'].'</a></td> |
658 | 658 | <td>'.$set['count_value'].'</td> |
659 | 659 | <td>'.\TYPO3\CMS\Backend\Utility\BackendUtility::dateTimeAge($set['scheduled']).'</td> |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | } |
672 | 672 | } |
673 | 673 | |
674 | - if($this->CSVExport) { |
|
674 | + if ($this->CSVExport) { |
|
675 | 675 | $this->outputCsvFile(); |
676 | 676 | } |
677 | 677 | |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | $csvLines[] = \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($fieldNames); |
698 | 698 | |
699 | 699 | // Data: |
700 | - foreach($this->CSVaccu as $row) { |
|
700 | + foreach ($this->CSVaccu as $row) { |
|
701 | 701 | $csvLines[] = \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($row); |
702 | 702 | } |
703 | 703 | |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | Header('Content-Disposition: attachment; filename=CrawlerLog.csv'); |
708 | 708 | |
709 | 709 | // Printing the content of the CSV lines: |
710 | - echo implode(chr(13).chr(10),$csvLines); |
|
710 | + echo implode(chr(13).chr(10), $csvLines); |
|
711 | 711 | |
712 | 712 | // Exits: |
713 | 713 | exit; |
@@ -723,14 +723,14 @@ discard block |
||
723 | 723 | * |
724 | 724 | * @return string HTML <tr> content (one or more) |
725 | 725 | */ |
726 | - function drawLog_addRows($pageRow_setId, $titleString, $itemsPerPage=10) { |
|
726 | + function drawLog_addRows($pageRow_setId, $titleString, $itemsPerPage = 10) { |
|
727 | 727 | |
728 | 728 | // If Flush button is pressed, flush tables instead of selecting entries: |
729 | 729 | |
730 | - if(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush')) { |
|
730 | + if (\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush')) { |
|
731 | 731 | $doFlush = true; |
732 | 732 | $doFullFlush = false; |
733 | - } elseif(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush_all')) { |
|
733 | + } elseif (\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush_all')) { |
|
734 | 734 | $doFlush = true; |
735 | 735 | $doFullFlush = true; |
736 | 736 | } else { |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | } |
740 | 740 | |
741 | 741 | // Get result: |
742 | - if (is_array($pageRow_setId)) { |
|
742 | + if (is_array($pageRow_setId)) { |
|
743 | 743 | $res = $this->crawlerObj->getLogEntriesForPageId($pageRow_setId['uid'], $this->pObj->MOD_SETTINGS['log_display'], $doFlush, $doFullFlush, intval($itemsPerPage)); |
744 | 744 | } else { |
745 | 745 | $res = $this->crawlerObj->getLogEntriesForSetId($pageRow_setId, $this->pObj->MOD_SETTINGS['log_display'], $doFlush, $doFullFlush, intval($itemsPerPage)); |
@@ -750,14 +750,14 @@ discard block |
||
750 | 750 | + ($this->pObj->MOD_SETTINGS['log_resultLog'] ? -1 : 0) |
751 | 751 | + ($this->pObj->MOD_SETTINGS['log_feVars'] ? 3 : 0); |
752 | 752 | |
753 | - if (count($res)) { |
|
753 | + if (count($res)) { |
|
754 | 754 | // Traverse parameter combinations: |
755 | 755 | $c = 0; |
756 | - $content=''; |
|
757 | - foreach($res as $kk => $vv) { |
|
756 | + $content = ''; |
|
757 | + foreach ($res as $kk => $vv) { |
|
758 | 758 | |
759 | 759 | // Title column: |
760 | - if (!$c) { |
|
760 | + if (!$c) { |
|
761 | 761 | $titleClm = '<td rowspan="'.count($res).'">'.$titleString.'</td>'; |
762 | 762 | } else { |
763 | 763 | $titleClm = ''; |
@@ -774,16 +774,16 @@ discard block |
||
774 | 774 | |
775 | 775 | // Put data into array: |
776 | 776 | $rowData = array(); |
777 | - if ($this->pObj->MOD_SETTINGS['log_resultLog']) { |
|
777 | + if ($this->pObj->MOD_SETTINGS['log_resultLog']) { |
|
778 | 778 | $rowData['result_log'] = $resLog; |
779 | 779 | } else { |
780 | - $rowData['scheduled'] = ($vv['scheduled']> 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate'); |
|
780 | + $rowData['scheduled'] = ($vv['scheduled'] > 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate'); |
|
781 | 781 | $rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-'; |
782 | 782 | } |
783 | - $rowData['result_status'] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($resStatus,50); |
|
783 | + $rowData['result_status'] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($resStatus, 50); |
|
784 | 784 | $rowData['url'] = '<a href="'.htmlspecialchars($parameters['url']).'" target="_newWIndow">'.htmlspecialchars($parameters['url']).'</a>'; |
785 | 785 | $rowData['feUserGroupList'] = $parameters['feUserGroupList']; |
786 | - $rowData['procInstructions'] = is_array($parameters['procInstructions']) ? implode('; ',$parameters['procInstructions']) : ''; |
|
786 | + $rowData['procInstructions'] = is_array($parameters['procInstructions']) ? implode('; ', $parameters['procInstructions']) : ''; |
|
787 | 787 | $rowData['set_id'] = $vv['set_id']; |
788 | 788 | |
789 | 789 | if ($this->pObj->MOD_SETTINGS['log_feVars']) { |
@@ -794,34 +794,34 @@ discard block |
||
794 | 794 | |
795 | 795 | $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID')); |
796 | 796 | |
797 | - $refreshIcon = $GLOBALS['BACK_PATH'] . 'gfx/refresh_n.gif'; |
|
798 | - if (version_compare(TYPO3_version,'7.0','>=')) { |
|
799 | - $refreshIcon = $GLOBALS['BACK_PATH'] . 'sysext/t3skin/extjs/images/grid/refresh.gif'; |
|
797 | + $refreshIcon = $GLOBALS['BACK_PATH'].'gfx/refresh_n.gif'; |
|
798 | + if (version_compare(TYPO3_version, '7.0', '>=')) { |
|
799 | + $refreshIcon = $GLOBALS['BACK_PATH'].'sysext/t3skin/extjs/images/grid/refresh.gif'; |
|
800 | 800 | } |
801 | 801 | |
802 | 802 | // Put rows together: |
803 | - $content.= ' |
|
804 | - <tr class="bgColor'.($c%2 ? '-20':'-10').'"> |
|
803 | + $content .= ' |
|
804 | + <tr class="bgColor'.($c % 2 ? '-20' : '-10').'"> |
|
805 | 805 | '.$titleClm.' |
806 | - <td><a href="' . $this->getModuleUrl(array('qid_details' => $vv['qid'], 'setID' => $setId)) . '">'.htmlspecialchars($vv['qid']).'</a></td> |
|
807 | - <td><a href="' . $this->getModuleUrl(array('qid_read' => $vv['qid'], 'setID' => $setId)) . '"><img src="' . $refreshIcon . '" width="14" hspace="1" vspace="2" height="14" border="0" title="'.htmlspecialchars('Read').'" alt="" /></a></td>'; |
|
808 | - foreach($rowData as $fKey => $value) { |
|
806 | + <td><a href="' . $this->getModuleUrl(array('qid_details' => $vv['qid'], 'setID' => $setId)).'">'.htmlspecialchars($vv['qid']).'</a></td> |
|
807 | + <td><a href="' . $this->getModuleUrl(array('qid_read' => $vv['qid'], 'setID' => $setId)).'"><img src="'.$refreshIcon.'" width="14" hspace="1" vspace="2" height="14" border="0" title="'.htmlspecialchars('Read').'" alt="" /></a></td>'; |
|
808 | + foreach ($rowData as $fKey => $value) { |
|
809 | 809 | |
810 | - if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('url',$fKey)) { |
|
811 | - $content.= ' |
|
810 | + if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('url', $fKey)) { |
|
811 | + $content .= ' |
|
812 | 812 | <td>'.$value.'</td>'; |
813 | 813 | } else { |
814 | - $content.= ' |
|
814 | + $content .= ' |
|
815 | 815 | <td>'.nl2br(htmlspecialchars($value)).'</td>'; |
816 | 816 | } |
817 | 817 | } |
818 | - $content.= ' |
|
818 | + $content .= ' |
|
819 | 819 | </tr>'; |
820 | 820 | $c++; |
821 | 821 | |
822 | - if ($this->CSVExport) { |
|
822 | + if ($this->CSVExport) { |
|
823 | 823 | // Only for CSV (adding qid and scheduled/exec_time if needed): |
824 | - $rowData['result_log'] = implode('// ',explode(chr(10),$resLog)); |
|
824 | + $rowData['result_log'] = implode('// ', explode(chr(10), $resLog)); |
|
825 | 825 | $rowData['qid'] = $vv['qid']; |
826 | 826 | $rowData['scheduled'] = \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']); |
827 | 827 | $rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-'; |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | * |
865 | 865 | * @return string Table header |
866 | 866 | */ |
867 | - function drawLog_printTableHeader() { |
|
867 | + function drawLog_printTableHeader() { |
|
868 | 868 | |
869 | 869 | $content = ' |
870 | 870 | <tr class="bgColor5 tableheader"> |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | } |
916 | 916 | |
917 | 917 | function getResStatus($vv) { |
918 | - if ($vv['result_data']) { |
|
918 | + if ($vv['result_data']) { |
|
919 | 919 | $requestContent = unserialize($vv['result_data']); |
920 | 920 | $requestResult = unserialize($requestContent['content']); |
921 | 921 | if (is_array($requestResult)) { |
@@ -924,9 +924,9 @@ discard block |
||
924 | 924 | } else { |
925 | 925 | $resStatus = implode("\n", $requestResult['errorlog']); |
926 | 926 | } |
927 | - $resLog = is_array($requestResult['log']) ? implode(chr(10),$requestResult['log']) : ''; |
|
927 | + $resLog = is_array($requestResult['log']) ? implode(chr(10), $requestResult['log']) : ''; |
|
928 | 928 | } else { |
929 | - $resStatus = 'Error: '.substr(preg_replace('/\s+/',' ',strip_tags($requestContent['content'])),0,10000).'...'; |
|
929 | + $resStatus = 'Error: '.substr(preg_replace('/\s+/', ' ', strip_tags($requestContent['content'])), 0, 10000).'...'; |
|
930 | 930 | } |
931 | 931 | } else { |
932 | 932 | $resStatus = '-'; |
@@ -954,7 +954,7 @@ discard block |
||
954 | 954 | * @param void |
955 | 955 | * @return string |
956 | 956 | */ |
957 | - protected function drawProcessOverviewAction(){ |
|
957 | + protected function drawProcessOverviewAction() { |
|
958 | 958 | |
959 | 959 | $this->runRefreshHooks(); |
960 | 960 | |
@@ -968,20 +968,20 @@ discard block |
||
968 | 968 | $this->addErrorMessage($e->getMessage()); |
969 | 969 | } |
970 | 970 | |
971 | - $offset = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('offset')); |
|
972 | - $perpage = 20; |
|
971 | + $offset = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('offset')); |
|
972 | + $perpage = 20; |
|
973 | 973 | |
974 | - $processRepository = new tx_crawler_domain_process_repository(); |
|
975 | - $queueRepository = new tx_crawler_domain_queue_repository(); |
|
974 | + $processRepository = new tx_crawler_domain_process_repository(); |
|
975 | + $queueRepository = new tx_crawler_domain_queue_repository(); |
|
976 | 976 | |
977 | 977 | $mode = $this->pObj->MOD_SETTINGS['processListMode']; |
978 | 978 | if ($mode == 'detail') { |
979 | 979 | $where = ''; |
980 | - } elseif($mode == 'simple') { |
|
980 | + } elseif ($mode == 'simple') { |
|
981 | 981 | $where = 'active = 1'; |
982 | 982 | } |
983 | 983 | |
984 | - $allProcesses = $processRepository->findAll('ttl','DESC', $perpage, $offset,$where); |
|
984 | + $allProcesses = $processRepository->findAll('ttl', 'DESC', $perpage, $offset, $where); |
|
985 | 985 | $allCount = $processRepository->countAll($where); |
986 | 986 | |
987 | 987 | $listView = new tx_crawler_view_process_list(); |
@@ -993,10 +993,10 @@ discard block |
||
993 | 993 | $listView->setTotalUnprocessedItemCount($queueRepository->countAllPendingItems()); |
994 | 994 | $listView->setAssignedUnprocessedItemCount($queueRepository->countAllAssignedPendingItems()); |
995 | 995 | $listView->setActiveProcessCount($processRepository->countActive()); |
996 | - $listView->setMaxActiveProcessCount(\TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->extensionSettings['processLimit'],1,99,1)); |
|
996 | + $listView->setMaxActiveProcessCount(\TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->extensionSettings['processLimit'], 1, 99, 1)); |
|
997 | 997 | $listView->setMode($mode); |
998 | 998 | |
999 | - $paginationView = new tx_crawler_view_pagination(); |
|
999 | + $paginationView = new tx_crawler_view_pagination(); |
|
1000 | 1000 | $paginationView->setCurrentOffset($offset); |
1001 | 1001 | $paginationView->setPerPage($perpage); |
1002 | 1002 | $paginationView->setTotalItemCount($allCount); |
@@ -1033,7 +1033,7 @@ discard block |
||
1033 | 1033 | |
1034 | 1034 | $exitCode = 0; |
1035 | 1035 | $out = array(); |
1036 | - exec(escapeshellcmd($this->extensionSettings['phpPath'] . ' -v'), $out, $exitCode); |
|
1036 | + exec(escapeshellcmd($this->extensionSettings['phpPath'].' -v'), $out, $exitCode); |
|
1037 | 1037 | if ($exitCode > 0) { |
1038 | 1038 | $this->addErrorMessage(sprintf($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.phpBinaryNotFound'), htmlspecialchars($this->extensionSettings['phpPath']))); |
1039 | 1039 | } |
@@ -1096,7 +1096,7 @@ discard block |
||
1096 | 1096 | * @param void |
1097 | 1097 | * @return void |
1098 | 1098 | */ |
1099 | - protected function handleProcessOverviewActions(){ |
|
1099 | + protected function handleProcessOverviewActions() { |
|
1100 | 1100 | |
1101 | 1101 | $crawler = $this->findCrawler(); |
1102 | 1102 | |
@@ -1129,8 +1129,8 @@ discard block |
||
1129 | 1129 | * @return tx_crawler_lib crawler object |
1130 | 1130 | * @author Timo Schmidt <[email protected]> |
1131 | 1131 | */ |
1132 | - protected function findCrawler(){ |
|
1133 | - if(!$this->crawlerObj instanceof tx_crawler_lib){ |
|
1132 | + protected function findCrawler() { |
|
1133 | + if (!$this->crawlerObj instanceof tx_crawler_lib) { |
|
1134 | 1134 | $this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib'); |
1135 | 1135 | } |
1136 | 1136 | return $this->crawlerObj; |
@@ -1232,15 +1232,15 @@ discard block |
||
1232 | 1232 | * |
1233 | 1233 | * @return string HTML select element |
1234 | 1234 | */ |
1235 | - function selectorBox($optArray, $name, $value, $multiple) { |
|
1235 | + function selectorBox($optArray, $name, $value, $multiple) { |
|
1236 | 1236 | |
1237 | 1237 | $options = array(); |
1238 | - foreach($optArray as $key => $val) { |
|
1238 | + foreach ($optArray as $key => $val) { |
|
1239 | 1239 | $options[] = ' |
1240 | - <option value="'.htmlspecialchars($key).'"'.((!$multiple && !strcmp($value,$key)) || ($multiple && in_array($key,(array)$value))?' selected="selected"':'').'>'.htmlspecialchars($val).'</option>'; |
|
1240 | + <option value="'.htmlspecialchars($key).'"'.((!$multiple && !strcmp($value, $key)) || ($multiple && in_array($key, (array) $value)) ? ' selected="selected"' : '').'>'.htmlspecialchars($val).'</option>'; |
|
1241 | 1241 | } |
1242 | 1242 | |
1243 | - $output = '<select name="'.htmlspecialchars($name.($multiple?'[]':'')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('',$options).'</select>'; |
|
1243 | + $output = '<select name="'.htmlspecialchars($name.($multiple ? '[]' : '')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('', $options).'</select>'; |
|
1244 | 1244 | |
1245 | 1245 | return $output; |
1246 | 1246 | } |
@@ -1279,6 +1279,6 @@ discard block |
||
1279 | 1279 | } |
1280 | 1280 | } |
1281 | 1281 | |
1282 | -if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php']) { |
|
1282 | +if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php']) { |
|
1283 | 1283 | include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php']); |
1284 | 1284 | } |