36 public function getAdditionalFields(array &$taskInfo, $task, \
TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule) {
37 $additionalFields = array();
38 if (empty($taskInfo[
'configuration'])) {
39 if ($schedulerModule->CMD ==
'add') {
40 $taskInfo[
'configuration'] =
'';
41 } elseif ($schedulerModule->CMD ==
'edit') {
42 $taskInfo[
'configuration'] = $task->getConfiguration();
44 $taskInfo[
'configuration'] = $task->getConfiguration();
47 if (empty($taskInfo[
'depth'])) {
48 if ($schedulerModule->CMD ==
'add') {
49 $taskInfo[
'depth'] = array();
50 } elseif ($schedulerModule->CMD ==
'edit') {
51 $taskInfo[
'depth'] = $task->getDepth();
53 $taskInfo[
'depth'] = $task->getDepth();
56 if (empty($taskInfo[
'page'])) {
57 if ($schedulerModule->CMD ==
'add') {
58 $taskInfo[
'page'] =
'';
59 } elseif ($schedulerModule->CMD ==
'edit') {
60 $taskInfo[
'page'] = $task->getPage();
62 $taskInfo[
'page'] = $task->getPage();
65 if (empty($taskInfo[
'email'])) {
66 if ($schedulerModule->CMD ==
'add') {
67 $taskInfo[
'email'] =
'';
68 } elseif ($schedulerModule->CMD ==
'edit') {
69 $taskInfo[
'email'] = $task->getEmail();
71 $taskInfo[
'email'] = $task->getEmail();
74 if (empty($taskInfo[
'emailOnBrokenLinkOnly'])) {
75 if ($schedulerModule->CMD ==
'add') {
76 $taskInfo[
'emailOnBrokenLinkOnly'] = 1;
77 } elseif ($schedulerModule->CMD ==
'edit') {
78 $taskInfo[
'emailOnBrokenLinkOnly'] = $task->getEmailOnBrokenLinkOnly();
80 $taskInfo[
'emailOnBrokenLinkOnly'] = $task->getEmailOnBrokenLinkOnly();
83 if (empty($taskInfo[
'emailTemplateFile'])) {
84 if ($schedulerModule->CMD ==
'add') {
85 $taskInfo[
'emailTemplateFile'] =
'EXT:linkvalidator/Resources/Private/Templates/mailtemplate.html';
86 } elseif ($schedulerModule->CMD ==
'edit') {
87 $taskInfo[
'emailTemplateFile'] = $task->getEmailTemplateFile();
89 $taskInfo[
'emailTemplateFile'] = $task->getEmailTemplateFile();
92 $fieldId =
'task_page';
93 $fieldCode =
'<input type="text" name="tx_scheduler[linkvalidator][page]" id="' . $fieldId .
'" value="' . htmlspecialchars($taskInfo[
'page']) .
'"/>';
94 $label =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.validate.page');
96 $additionalFields[$fieldId] = array(
101 $fieldId =
'task_depth';
102 $fieldValueArray = array(
103 '0' =>
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_0'),
104 '1' =>
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_1'),
105 '2' =>
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_2'),
106 '3' =>
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_3'),
107 '4' =>
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_4'),
108 '999' =>
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.depth_infi')
110 $fieldCode =
'<select name="tx_scheduler[linkvalidator][depth]" id="' . $fieldId .
'">';
111 foreach ($fieldValueArray as $depth => $label) {
112 $fieldCode .=
"\t" .
'<option value="' . htmlspecialchars($depth) .
'"' .
113 (($depth == $taskInfo[
'depth']) ?
' selected="selected"' :
'') .
114 '>' . $label .
'</option>';
116 $fieldCode .=
'</select>';
117 $label =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.validate.depth');
119 $additionalFields[$fieldId] = array(
120 'code' => $fieldCode,
123 $fieldId =
'task_configuration';
124 $fieldCode =
'<textarea name="tx_scheduler[linkvalidator][configuration]" id="' . $fieldId .
'" >' .
125 htmlspecialchars($taskInfo[
'configuration']) .
'</textarea>';
126 $label =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.validate.conf');
128 $additionalFields[$fieldId] = array(
129 'code' => $fieldCode,
132 $fieldId =
'task_email';
133 $fieldCode =
'<input type="text" name="tx_scheduler[linkvalidator][email]" id="' . $fieldId .
'" value="' .
134 htmlspecialchars($taskInfo[
'email']) .
'" />';
135 $label =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.validate.email');
137 $additionalFields[$fieldId] = array(
138 'code' => $fieldCode,
141 $fieldId =
'task_emailOnBrokenLinkOnly';
142 $fieldCode =
'<input type="checkbox" name="tx_scheduler[linkvalidator][emailOnBrokenLinkOnly]" id="' . $fieldId .
'" ' .
143 (htmlspecialchars($taskInfo[
'emailOnBrokenLinkOnly']) ?
'checked="checked"' :
'') .
' />';
144 $label =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.validate.emailOnBrokenLinkOnly');
146 $additionalFields[$fieldId] = array(
147 'code' => $fieldCode,
150 $fieldId =
'task_emailTemplateFile';
151 $fieldCode =
'<input type="text" name="tx_scheduler[linkvalidator][emailTemplateFile]" id="' . $fieldId .
152 '" value="' . htmlspecialchars($taskInfo[
'emailTemplateFile']) .
'" />';
153 $label =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.validate.emailTemplateFile');
155 $additionalFields[$fieldId] = array(
156 'code' => $fieldCode,
159 return $additionalFields;
171 if (in_array($currentValue, $configurationArray, TRUE)) {
172 $selected =
'selected="selected" ';
188 if (!empty($submittedData[
'linkvalidator'][
'email'])) {
190 foreach ($emailList as $emailAdd) {
193 $schedulerModule->addMessage(
$GLOBALS[
'LANG']->sL(
'LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.validate.invalidEmail'), \
TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
197 if ($res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*',
'pages',
'uid = ' . (
int)$submittedData[
'linkvalidator'][
'page'])) {
198 if (
$GLOBALS[
'TYPO3_DB']->sql_num_rows($res) == 0 && $submittedData[
'linkvalidator'][
'page'] > 0) {
200 $schedulerModule->addMessage(
201 $GLOBALS[
'LANG']->sL(
'LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.validate.invalidPage'),
202 \
TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
205 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
208 $schedulerModule->addMessage(
209 $GLOBALS[
'LANG']->sL(
'LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.validate.invalidPage'),
210 \
TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
213 if ($submittedData[
'linkvalidator'][
'depth'] < 0) {
215 $schedulerModule->addMessage(
216 $GLOBALS[
'LANG']->sL(
'LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.validate.invalidDepth'),
217 \
TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
233 $task->setDepth($submittedData[
'linkvalidator'][
'depth']);
234 $task->setPage($submittedData[
'linkvalidator'][
'page']);
235 $task->setEmail($submittedData[
'linkvalidator'][
'email']);
236 if ($submittedData[
'linkvalidator'][
'emailOnBrokenLinkOnly']) {
237 $task->setEmailOnBrokenLinkOnly(1);
239 $task->setEmailOnBrokenLinkOnly(0);
241 $task->setConfiguration($submittedData[
'linkvalidator'][
'configuration']);
242 $task->setEmailTemplateFile($submittedData[
'linkvalidator'][
'emailTemplateFile']);
validateAdditionalFields(array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule)
static validEmail($email)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task)
static wrapInHelp($table, $field, $text='', array $overloadHelpText=array())
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
getAdditionalFields(array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule)
getSelectedState(array $configurationArray, $currentValue)