46fd0b86128b92d626921d5ed908331fe9e56b6d
[Packages/TYPO3.CMS.git] / typo3 / sysext / scheduler / Classes / AdditionalFieldProviderInterface.php
1 <?php
2 namespace TYPO3\CMS\Scheduler;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2009-2013 Ingo Renner <ingo@typo3.org>
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 *
19 * This script is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * This copyright notice MUST APPEAR in all copies of the script!
25 ***************************************************************/
26 /**
27 * Interface for classes who want to provide additional fields when adding a task
28 *
29 * @author Ingo Renner <ingo@typo3.org>
30 */
31 interface AdditionalFieldProviderInterface
32 {
33 /**
34 * Gets additional fields to render in the form to add/edit a task
35 *
36 * @param array $taskInfo Values of the fields from the add/edit task form
37 * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task The task object being edited. Null when adding a task!
38 * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule Reference to the scheduler backend module
39 * @return array A two dimensional array, array('Identifier' => array('fieldId' => array('code' => '', 'label' => '', 'cshKey' => '', 'cshLabel' => ''))
40 */
41 public function getAdditionalFields(array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule);
42
43 /**
44 * Validates the additional fields' values
45 *
46 * @param array $submittedData An array containing the data submitted by the add/edit task form
47 * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule Reference to the scheduler backend module
48 * @return boolean TRUE if validation was ok (or selected class is not relevant), FALSE otherwise
49 */
50 public function validateAdditionalFields(array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule);
51
52 /**
53 * Takes care of saving the additional fields' values in the task's object
54 *
55 * @param array $submittedData An array containing the data submitted by the add/edit task form
56 * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task Reference to the scheduler backend module
57 * @return void
58 */
59 public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task);
60
61 }