Commit 9056f94d authored by speedprogs_de's avatar speedprogs_de

fixed some warnings in abstract additional field provider

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/terfe/branches/ter_fe2@51851 735d13b6-9817-0410-8766-e36946ffe9aa
parent 04327534
...@@ -58,8 +58,12 @@ ...@@ -58,8 +58,12 @@
* @return array Array containing all the information pertaining to the additional fields * @return array Array containing all the information pertaining to the additional fields
*/ */
public function getAdditionalFields(array &$taskInfo, $task, tx_scheduler_Module $parentObject) { public function getAdditionalFields(array &$taskInfo, $task, tx_scheduler_Module $parentObject) {
$this->values = get_object_vars($task); if (!empty($task) {
$this->editMode = ($parentObject->CMD === 'edit'); $this->values = get_object_vars($task);
}
if (!empty($parentObject->CMD)) {
$this->editMode = ($parentObject->CMD === 'edit');
}
$this->addInputField('elementsPerRun', 10); $this->addInputField('elementsPerRun', 10);
$this->addInputField('clearCachePages', 0); $this->addInputField('clearCachePages', 0);
...@@ -87,10 +91,12 @@ ...@@ -87,10 +91,12 @@
* @return void * @return void
*/ */
public function saveAdditionalFields(array $submittedData, tx_scheduler_Task $task) { public function saveAdditionalFields(array $submittedData, tx_scheduler_Task $task) {
$attributes = get_object_vars($task); if (!empty($task)) {
foreach ($attributes as $key => $value) { $attributes = get_object_vars($task);
if (isset($submittedData[$key])) { foreach ($attributes as $key => $value) {
$task->$key = $submittedData[$key]; if (isset($submittedData[$key])) {
$task->$key = $submittedData[$key];
}
} }
} }
} }
...@@ -167,7 +173,7 @@ ...@@ -167,7 +173,7 @@
foreach ($options as $key => $option) { foreach ($options as $key => $option) {
$selected = ($key === $defaultValue ? ' selected="selected"' : ''); $selected = ($key === $defaultValue ? ' selected="selected"' : '');
if ($key !== $option) { if ($key !== $option) {
$option = Tx_Extbase_Utility_Localization::translate($option); $option = Tx_Extbase_Utility_Localization::translate($option, '');
} }
$html[] = '<option value="' . htmlspecialchars($key) . '"' . $selected . '>' . htmlspecialchars($option) . '</option>'; $html[] = '<option value="' . htmlspecialchars($key) . '"' . $selected . '>' . htmlspecialchars($option) . '</option>';
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment