[TASK] Improve linkvalidator scheduler task usablity 83/32383/2
authorAlexander Stehlik <alexander.stehlik@gmail.com>
Tue, 26 Aug 2014 12:27:03 +0000 (14:27 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 3 Sep 2014 18:30:45 +0000 (20:30 +0200)
The getAdditionalInformation() method is implemented in the
linkvalidator scheduler task to show more information about
the task in the scheduler Backend module.

Resolves: #61198
Releases: 6.3
Change-Id: Iebb43923b73ff4ecebab4a6747655596be859604
Reviewed-on: http://review.typo3.org/32383
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/linkvalidator/Classes/Task/ValidatorTask.php

index 479f24e..1f7337f 100644 (file)
@@ -505,6 +505,34 @@ class ValidatorTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
        }
 
        /**
+        * Returns the most important properties of the link validator task as a
+        * comma seperated string that will be displayed in the scheduler module.
+        *
+        * @return string
+        */
+       public function getAdditionalInformation() {
+               $additionalInformation = array();
+
+               $page = (int)$this->getPage();
+               $pageLabel = $page;
+               if ($page !== 0) {
+                       $pageData = BackendUtility::getRecord('pages', $page);
+                       if (!empty($pageData)) {
+                               $pageTitle = BackendUtility::getRecordTitle('pages', $pageData);
+                               $pageLabel = $pageTitle . ' (' . $page . ')';
+                       }
+               }
+               $additionalInformation[] = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.validate.page') . ': ' . $pageLabel;
+
+               $depth = (int)$this->getDepth();
+               $additionalInformation[] = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.validate.depth') . ': ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_' . ($depth === 999 ? 'infi' : $depth));
+
+               $additionalInformation[] = $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.validate.email') . ': ' . $this->getEmail();
+
+               return implode(', ', $additionalInformation);
+       }
+
+       /**
         * Simulate cli call with setting the required options to the $_SERVER['argv']
         *
         * @return void