[BUGFIX] Fix several typos in php comments
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Form / Element / InputDateTimeElement.php
index d8ed303..1c4092e 100644 (file)
@@ -160,7 +160,7 @@ class InputDateTimeElement extends AbstractFormElement
                 // (moment.js can only handle UTC or browser's local timezone), we need to offset the value
                 // to eliminate the timezone. JS will receive all dates as if they were UTC, which we undo on save in DataHandler
                 $adjustedValue = $itemValue + date('Z', (int)$itemValue);
-                // output date as a ISO-8601 date
+                // output date as an ISO-8601 date
                 $itemValue = gmdate('c', $adjustedValue);
             }
             if (isset($config['range']['lower'])) {
@@ -198,14 +198,18 @@ class InputDateTimeElement extends AbstractFormElement
         $expansionHtml[] =              '</span>';
         $expansionHtml[] =          '</div>';
         $expansionHtml[] =      '</div>';
-        $expansionHtml[] =      '<div class="form-wizards-items-aside">';
-        $expansionHtml[] =          '<div class="btn-group">';
-        $expansionHtml[] =              $fieldControlHtml;
-        $expansionHtml[] =          '</div>';
-        $expansionHtml[] =      '</div>';
-        $expansionHtml[] =      '<div class="form-wizards-items-bottom">';
-        $expansionHtml[] =          $fieldWizardHtml;
-        $expansionHtml[] =      '</div>';
+        if (!empty($fieldControlHtml)) {
+            $expansionHtml[] =      '<div class="form-wizards-items-aside">';
+            $expansionHtml[] =          '<div class="btn-group">';
+            $expansionHtml[] =              $fieldControlHtml;
+            $expansionHtml[] =          '</div>';
+            $expansionHtml[] =      '</div>';
+        }
+        if (!empty($fieldWizardHtml)) {
+            $expansionHtml[] = '<div class="form-wizards-items-bottom">';
+            $expansionHtml[] = $fieldWizardHtml;
+            $expansionHtml[] = '</div>';
+        }
         $expansionHtml[] =  '</div>';
         $expansionHtml[] = '</div>';
         $expansionHtml = implode(LF, $expansionHtml);
@@ -266,6 +270,7 @@ class InputDateTimeElement extends AbstractFormElement
             $fullElement = implode(LF, $fullElement);
         }
 
+        $resultArray['requireJsModules'][] = 'TYPO3/CMS/Backend/FormEngine/Element/InputDateTimeElement';
         $resultArray['html'] = '<div class="formengine-field-item t3js-formengine-field-item">' . $fieldInformationHtml . $fullElement . '</div>';
         return $resultArray;
     }