WCF::getTPL()->assign('success', true);
// reset variables
- $this->parentPageID = $this->isDisabled = $this->isLandingPage = 0;
+ $this->parentPageID = $this->isDisabled = $this->isLandingPage = $this->availableDuringOfflineMode = 0;
$this->applicationPackageID = 1;
- $this->name = '';
+ $this->cssClassName = $this->name = '';
- $this->customURL = $this->title = $this->content = $this->metaDescription = $this->metaKeywords = $this->boxIDs = $this->aclValues = [];
+ $this->customURL = $this->title = $this->content = $this->metaDescription = $this->metaKeywords = $this->aclValues = [];
+ $this->boxIDs = $this->getDefaultBoxIDs();
}
/**
// set default values
if (empty($_POST)) {
- foreach ($this->availableBoxes as $box) {
- if ($box->visibleEverywhere) $this->boxIDs[] = $box->boxID;
- }
+ $this->boxIDs = $this->getDefaultBoxIDs();
}
+
+ $this->menuItems = new MenuItemNodeTree(MenuCache::getInstance()->getMainMenuID(), null, false);
}
+ /**
+ * Returns the list of box ids that are enabled by default.
+ *
+ * @return integer[]
+ */
+ protected function getDefaultBoxIDs() {
+ $boxIDs = [];
+ foreach ($this->availableBoxes as $box) {
+ if ($box->visibleEverywhere) $boxIDs[] = $box->boxID;
+ }
+ return $boxIDs;
+ }
+
/**
* @inheritDoc
*/