'isLandingPage' is no more handled by ACP forms
authorAlexander Ebert <ebert@woltlab.com>
Tue, 25 Dec 2012 20:54:15 +0000 (21:54 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 25 Dec 2012 20:54:15 +0000 (21:54 +0100)
Instead the option will be available as button both in page menu item list and editing.

wcfsetup/install/files/acp/templates/pageMenuItemAdd.tpl
wcfsetup/install/files/lib/acp/form/PageMenuItemAddForm.class.php
wcfsetup/install/files/lib/acp/form/PageMenuItemEditForm.class.php

index ac029cf24941a7f089ded639d9973dc1e26aff73..86f6cbf9d203d7857f8a30186242153b09658501 100644 (file)
@@ -3,8 +3,6 @@
 <script type="text/javascript">
        //<![CDATA[
        $(function() {
-               var $isDisabled = $('#isDisabled');
-               var $isLandingPageContainer = $('#isLandingPageContainer');
                var $menuPosition = $('#menuPosition');
                var $parentMenuItemContainer = $('#parentMenuItemContainer');
                var $isInternalLink = $('input[name=isInternalLink]').filter('[value=1]');
                function handleMenuPosition() {
                        if ($menuPosition.val() === 'header') {
                                $parentMenuItemContainer.show();
-                               
-                               if (!$isDisabled.is(':checked')) {
-                                       $isLandingPageContainer.show();
-                               }
                        }
                        else {
                                $parentMenuItemContainer.hide();
-                               $isLandingPageContainer.hide();
                        }
                }
                
                        }
                }
                
-               function handleIsDisabled() {
-                       if ($isDisabled.is(':checked')) {
-                               $isLandingPageContainer.hide();
-                       }
-                       else {
-                               $isLandingPageContainer.show();
-                       }
-               }
-               
-               $isDisabled.change(handleIsDisabled);
                $menuPosition.change(handleMenuPosition);
                $('input[name=isInternalLink]').change(handleIsInternalLink);
                
-               handleIsDisabled();
                handleMenuPosition();
                handleIsInternalLink();
        });
                                        <label><input type="checkbox" name="isDisabled" id="isDisabled" value="1"{if $isDisabled} checked="checked"{/if} /> <span>{lang}wcf.acp.pageMenu.isDisabled{/lang}</span></label>
                                </dd>
                        </dl>
-                       
-                       <dl id="isLandingPageContainer">
-                               <dd>
-                                       <label><input type="checkbox" name="isLandingPage" id="isLandingPage" value="1"{if $isLandingPage} checked="checked"{/if} /> <span>{lang}wcf.acp.pageMenu.isLandingPage{/lang}</span></label>
-                                       <small>{lang}wcf.acp.pageMenu.isLandingPage.description{/lang}</small>
-                               </dd>
-                       </dl>
                </fieldset>
                
                <div class="formSubmit">
index 54d21f3dd599b5af3549db7afdcbb9fd597afb51..f007468d03c330335d7c2e1d35dcfed14dc6dad2 100644 (file)
@@ -42,12 +42,6 @@ class PageMenuItemAddForm extends ACPForm {
         */
        public $isInternalLink = false;
        
-       /**
-        * true, if menu item is landing page
-        * @var boolean
-        */
-       public $isLandingPage = false;
-       
        /**
         * menu item controller
         * @var string
@@ -131,7 +125,6 @@ class PageMenuItemAddForm extends ACPForm {
                
                if (isset($_POST['isDisabled'])) $this->isDisabled = true;
                if (isset($_POST['isInternalLink'])) $this->isInternalLink = (bool) $_POST['isInternalLink'];
-               if (isset($_POST['isLandingPage'])) $this->isLandingPage = true;
                if (isset($_POST['menuItemController'])) $this->menuItemController = StringUtil::trim($_POST['menuItemController']);
                if (isset($_POST['menuPosition'])) $this->menuPosition = StringUtil::trim($_POST['menuPosition']);
                if (isset($_POST['parentMenuItem'])) $this->parentMenuItem = StringUtil::trim($_POST['parentMenuItem']);
@@ -198,14 +191,6 @@ class PageMenuItemAddForm extends ACPForm {
                                throw new UserInputException('parentMenuItem', 'notValid');
                        }
                }
-               
-               // validate landing page
-               if ($this->isDisabled) {
-                       $this->isLandingPage = false;
-               }
-               else if ($this->menuPosition == 'footer' || !empty($this->parentMenuItem)) {
-                       $this->isLandingPage = false;
-               }
        }
        
        /**
@@ -216,7 +201,6 @@ class PageMenuItemAddForm extends ACPForm {
                
                $this->objectAction = new PageMenuItemAction(array(), 'create', array('data' => array(
                        'isDisabled' => ($this->isDisabled) ? 1 : 0,
-                       'isLandingPage' => ($this->isLandingPage) ? 1 : 0,
                        'menuItem' => $this->pageMenuItem,
                        'menuItemController' => $this->menuItemController,
                        'menuItemLink' => $this->menuItemLink,
@@ -249,7 +233,7 @@ class PageMenuItemAddForm extends ACPForm {
                WCF::getTPL()->assign('success', true);
                
                // reset variables
-               $this->isDisabled = $this->isInternalLink = $this->isLandingPage = false;
+               $this->isDisabled = $this->isInternalLink = false;
                $this->menuPosition = 'header';
                $this->menuItemController = $this->menuItemLink = $this->pageMenuItem = $this->parentMenuItem = '';
                $this->showOrder = 0;
@@ -273,7 +257,6 @@ class PageMenuItemAddForm extends ACPForm {
                        'availableParentMenuItems' => $this->availableParentMenuItems,
                        'isDisabled' => $this->isDisabled,
                        'isInternalLink' => $this->isInternalLink,
-                       'isLandingPage' => $this->isLandingPage,
                        'menuItemController' => $this->menuItemController,
                        'menuItemLink' => $this->menuItemLink,
                        'menuPosition' => $this->menuPosition,
index 0699c7362dcc3242527466a75472b0de896c0ebe..7833d8c704ca76cf5948092fba5f9c10d0921a3b 100644 (file)
@@ -69,7 +69,6 @@ class PageMenuItemEditForm extends PageMenuItemAddForm {
                if (empty($_POST)) {
                        $this->isDisabled = ($this->menuItem->isDisabled) ? true : false;
                        $this->isInternalLink = ($this->menuItem->menuItemController) ? true : false;
-                       $this->isLandingPage = ($this->menuItem->isLandingPage) ? true : false;
                        $this->menuItemController = $this->menuItem->menuItemController;
                        $this->menuItemLink = $this->menuItem->menuItemLink;
                        $this->menuPosition = $this->menuItem->menuPosition;
@@ -101,7 +100,6 @@ class PageMenuItemEditForm extends PageMenuItemAddForm {
                // save menu item
                $this->objectAction = new PageMenuItemAction(array($this->menuItem), 'update', array('data' => array(
                        'isDisabled' => ($this->isDisabled) ? 1 : 0,
-                       'isLandingPage' => ($this->isLandingPage) ? 1 : 0,
                        'menuItemController' => $this->menuItemController,
                        'menuItemLink' => $this->menuItemLink,
                        'parentMenuItem' => ($this->menuItem->menuPosition == 'header' ? $this->parentMenuItem : ''),