$optionals = [
'objectType' => '',
'cssClassName' => '',
- 'showHeader' => 1,
- 'visibleEverywhere' => 1
+ 'showHeader' => 0
];
foreach ($optionals as $field => $defaultValue) {
if (isset($data[$field]) && $data[$field] !== $defaultValue) {
}
if (!empty($data['visibilityExceptions'])) {
+ $box->appendChild($document->createElement('visibleEverywhere', (string)($data['visibleEverywhere'] ?? 0)));
+
$visibilityExceptions = $document->createElement('visibilityExceptions');
+ sort($data['visibilityExceptions']);
foreach ($data['visibilityExceptions'] as $page) {
$visibilityExceptions->appendChild($document->createElement('page', $page));
}
$box->appendChild($visibilityExceptions);
}
+ else if (!empty($data['visibleEverywhere'])) {
+ $box->appendChild($document->createElement('visibleEverywhere', (string)$data['visibleEverywhere']));
+ }
foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
$content = null;