/**
  * Validates the additional fields' values
  *
  * @param array $submittedData
  * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule
  * @return bool
  */
 public function validateAdditionalFields(array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule)
 {
     $isValid = FALSE;
     if (tx_crawler_api::convertToPositiveInteger($submittedData['timeOut']) > 0) {
         $isValid = TRUE;
     } else {
         $schedulerModule->addMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/locallang_db.xml:crawler_im.invalidTimeOut'), t3lib_FlashMessage::ERROR);
     }
     return $isValid;
 }
 /**
  * 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
  * @author Michael Klapper <*****@*****.**>
  */
 public function validateAdditionalFields(array &$submittedData, tx_scheduler_Module $schedulerModule)
 {
     $isValid = false;
     if (tx_crawler_api::convertToPositiveInteger($submittedData['sleepTime']) > 0) {
         $isValid = true;
     } else {
         $schedulerModule->addMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/locallang_db.xml:crawler_im.invalidSleepTime'), t3lib_FlashMessage::ERROR);
     }
     if (tx_crawler_api::convertToPositiveInteger($submittedData['sleepAfterFinish']) === 0) {
         $isValid = false;
         $schedulerModule->addMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/locallang_db.xml:crawler_im.invalidSleepAfterFinish'), t3lib_FlashMessage::ERROR);
     }
     if (tx_crawler_api::convertToPositiveInteger($submittedData['countInARun']) === 0) {
         $isValid = false;
         $schedulerModule->addMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/locallang_db.xml:crawler_im.invalidCountInARun'), t3lib_FlashMessage::ERROR);
     }
     return $isValid;
 }
Exemplo n.º 3
0
 public function __construct()
 {
     $this->db = $GLOBALS['TYPO3_DB'];
     $this->backendUser = $GLOBALS['BE_USER'];
     $this->processFilename = PATH_site . 'typo3temp/tx_crawler.proc';
     $settings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['crawler']);
     $settings = is_array($settings) ? $settings : array();
     // read ext_em_conf_template settings and set
     $this->setExtensionSettings($settings);
     $this->initTSFE((int) $this->extensionSettings['PageUidRootTypoScript']);
     // set defaults:
     if (tx_crawler_api::convertToPositiveInteger($this->extensionSettings['countInARun']) == 0) {
         $this->extensionSettings['countInARun'] = 100;
     }
     $this->extensionSettings['processLimit'] = tx_crawler_api::forceIntegerInRange($this->extensionSettings['processLimit'], 1, 99, 1);
 }
 /**
  * Validates the additional fields' values
  *
  * @param array $submittedData
  * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule
  * @return bool
  */
 public function validateAdditionalFields(array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule)
 {
     $isValid = FALSE;
     if (tx_crawler_api::convertToPositiveInteger($submittedData['sleepTime']) > 0) {
         $isValid = TRUE;
     } else {
         $schedulerModule->addMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/locallang_db.xml:crawler_im.invalidSleepTime'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
     }
     if (tx_crawler_api::convertToPositiveInteger($submittedData['sleepAfterFinish']) === 0) {
         $isValid = FALSE;
         $schedulerModule->addMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/locallang_db.xml:crawler_im.invalidSleepAfterFinish'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
     }
     if (tx_crawler_api::convertToPositiveInteger($submittedData['countInARun']) === 0) {
         $isValid = FALSE;
         $schedulerModule->addMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/locallang_db.xml:crawler_im.invalidCountInARun'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
     }
     return $isValid;
 }