It's no longer possible to disable the main menu
authorMarcel Werk <burntime@woltlab.com>
Fri, 24 Jun 2016 13:38:59 +0000 (15:38 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 24 Jun 2016 13:41:12 +0000 (15:41 +0200)
wcfsetup/install/files/acp/templates/pageAdd.tpl
wcfsetup/install/files/lib/acp/form/PageAddForm.class.php

index 6d2f12725a12b2a329d39626931591ecc4b39e92..4478060b4dc4d819f30e7ba6777bdb13ddb16b37 100644 (file)
                                                <ul class="scrollableCheckboxList">
                                                        {foreach from=$availableBoxes item=availableBox}
                                                                <li>
-                                                                       <label><input type="checkbox" name="boxIDs[]" value="{@$availableBox->boxID}"{if $availableBox->boxID|in_array:$boxIDs} checked="checked"{/if}> {$availableBox->name}</label>
+                                                                       <label><input type="checkbox" name="boxIDs[]" value="{@$availableBox->boxID}"{if $availableBox->boxID|in_array:$boxIDs} checked="checked"{/if}{if $availableBox->identifier == 'com.woltlab.wcf.MainMenu'} disabled{/if}> {$availableBox->name}</label>
                                                                </li>
                                                        {/foreach}
                                                </ul>
index 1e2f3ff205dbf568469eea742517fcf8d8738476..0f60f33e2681ec34f2d5042c4064746a4eed2d95 100644 (file)
@@ -160,7 +160,7 @@ class PageAddForm extends AbstractForm {
                // get available languages
                $this->availableLanguages = LanguageFactory::getInstance()->getLanguages();
                
-               // get boxes
+               // get available boxes
                $boxList = new BoxList();
                $boxList->sqlOrderBy = 'box.name';
                $boxList->readObjects();
@@ -208,6 +208,8 @@ class PageAddForm extends AbstractForm {
                if (isset($_POST['metaDescription']) && is_array($_POST['metaDescription'])) $this->metaDescription = ArrayUtil::trim($_POST['metaDescription']);
                if (isset($_POST['metaKeywords']) && is_array($_POST['metaKeywords'])) $this->metaKeywords = ArrayUtil::trim($_POST['metaKeywords']);
                if (isset($_POST['boxIDs']) && is_array($_POST['boxIDs'])) $this->boxIDs = ArrayUtil::toIntegerArray($_POST['boxIDs']);
+               $box = Box::getBoxByIdentifier('com.woltlab.wcf.MainMenu');
+               if (!in_array($box->boxID, $this->boxIDs)) $this->boxIDs[] = $box->boxID;
                
                if (isset($_POST['aclValues']) && is_array($_POST['aclValues'])) $this->aclValues = $_POST['aclValues'];
        }
@@ -448,6 +450,9 @@ class PageAddForm extends AbstractForm {
                // call saved event
                $this->saved();
                
+               // show success
+               WCF::getTPL()->assign('success', true);
+               
                // reset variables
                $this->parentPageID = $this->isDisabled = $this->isLandingPage = 0;
                $this->applicationPackageID = 1;