Merge remote-tracking branch 'refs/remotes/origin/3.0'
authorAlexander Ebert <ebert@woltlab.com>
Mon, 26 Feb 2018 11:34:18 +0000 (12:34 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 26 Feb 2018 11:34:18 +0000 (12:34 +0100)
# Conflicts:
# wcfsetup/install/files/lib/acp/form/PageAddForm.class.php

1  2 
wcfsetup/install/files/lib/acp/form/PageAddForm.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 0cc595249eb6fbdfd7aa6198f1920c995c28cb60,e7c63558a98556385b84bc57b8b1c152f900ad25..d6fecdf318b4292ea6ddcba0cde546eb96466c50
@@@ -586,10 -468,11 +586,11 @@@ class PageAddForm extends AbstractForm 
                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
         */
Simple merge
Simple merge