Overhauled 'Add Box' UI
authorMarcel Werk <burntime@woltlab.com>
Sun, 22 May 2016 19:54:48 +0000 (21:54 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sun, 22 May 2016 19:54:48 +0000 (21:54 +0200)
wcfsetup/install/files/acp/templates/boxAdd.tpl
wcfsetup/install/files/acp/templates/boxAddDialog.tpl [new file with mode: 0644]
wcfsetup/install/files/acp/templates/boxList.tpl
wcfsetup/install/files/acp/templates/pageAddDialog.tpl
wcfsetup/install/files/js/WoltLab/WCF/Acp/Ui/Box/Add.js [new file with mode: 0644]
wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php
wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php
wcfsetup/install/files/lib/acp/page/BoxListPage.class.php

index 7881269c786d08834bc405327feb0c3ff3e424d5..13e07bf18ebd03b6d6a48f0f2066c45202579a5b 100644 (file)
 {/if}
 
 <form method="post" action="{if $action == 'add'}{link controller='BoxAdd'}{/link}{else}{link controller='BoxEdit' id=$boxID}{/link}{/if}">
-       <section class="section">
-               <h2 class="sectionTitle">{lang}wcf.global.form.data{/lang}</h2>
+       <div class="section tabMenuContainer" data-active="{$activeTabMenuItem}" data-store="activeTabMenuItem" id="pageTabMenuContainer">
+               <nav class="tabMenu">
+                       <ul>
+                               <li><a href="{@$__wcf->getAnchor('general')}">{lang}wcf.acp.box.general{/lang}</a></li>
+                               <li><a href="{@$__wcf->getAnchor('contents')}">{lang}wcf.acp.box.contents{/lang}</a></li>
+                               <li><a href="{@$__wcf->getAnchor('pages')}">{lang}wcf.acp.box.pages{/lang}</a></li>
+                               
+                               {event name='tabMenuTabs'}
+                       </ul>
+               </nav>
                
-               <dl{if $errorField == 'name'} class="formError"{/if}>
-                       <dt><label for="name">{lang}wcf.global.name{/lang}</label></dt>
-                       <dd>
-                               <input type="text" id="name" name="name" value="{$name}" required="required" autofocus="autofocus" class="long" />
-                               {if $errorField == 'name'}
-                                       <small class="innerError">
-                                               {if $errorType == 'empty'}
-                                                       {lang}wcf.global.form.error.empty{/lang}
-                                               {else}
-                                                       {lang}wcf.acp.box.name.error.{@$errorType}{/lang}
+               <div id="general" class="tabMenuContent">
+                       <div class="section">
+                               <dl{if $errorField == 'name'} class="formError"{/if}>
+                                       <dt><label for="name">{lang}wcf.global.name{/lang}</label></dt>
+                                       <dd>
+                                               <input type="text" id="name" name="name" value="{$name}" required="required" autofocus="autofocus" class="long" />
+                                               {if $errorField == 'name'}
+                                                       <small class="innerError">
+                                                               {if $errorType == 'empty'}
+                                                                       {lang}wcf.global.form.error.empty{/lang}
+                                                               {else}
+                                                                       {lang}wcf.acp.box.name.error.{@$errorType}{/lang}
+                                                               {/if}
+                                                       </small>
                                                {/if}
-                                       </small>
-                               {/if}
-                       </dd>
-               </dl>
-               
-               <dl{if $errorField == 'boxType'} class="formError"{/if}>
-                       <dt><label for="boxType">{lang}wcf.acp.box.boxType{/lang}</label></dt>
-                       <dd>
-                               <select name="boxType" id="boxType">
-                                       {foreach from=$availableBoxTypes item=availableBoxType}
-                                               <option value="{@$availableBoxType}"{if $availableBoxType == $boxType} selected="selected"{/if}>{lang}wcf.acp.box.boxType.{@$availableBoxType}{/lang}</option>
-                                       {/foreach}
-                               </select>
+                                       </dd>
+                               </dl>
                                
-                               {if $errorField == 'boxType'}
-                                       <small class="innerError">
-                                               {if $errorType == 'empty'}
-                                                       {lang}wcf.global.form.error.empty{/lang}
-                                               {else}
-                                                       {lang}wcf.acp.box.boxType.error.{@$errorType}{/lang}
+                               <dl{if $errorField == 'boxType'} class="formError"{/if}>
+                                       <dt><label for="boxType">{lang}wcf.acp.box.boxType{/lang}</label></dt>
+                                       <dd>
+                                               <select name="boxType" id="boxType" readonly="readonly">
+                                                       {foreach from=$availableBoxTypes item=availableBoxType}
+                                                               <option value="{@$availableBoxType}"{if $availableBoxType == $boxType} selected="selected"{/if}>{lang}wcf.acp.box.boxType.{@$availableBoxType}{/lang}</option>
+                                                       {/foreach}
+                                               </select>
+                                               
+                                               {if $errorField == 'boxType'}
+                                                       <small class="innerError">
+                                                               {if $errorType == 'empty'}
+                                                                       {lang}wcf.global.form.error.empty{/lang}
+                                                               {else}
+                                                                       {lang}wcf.acp.box.boxType.error.{@$errorType}{/lang}
+                                                               {/if}
+                                                       </small>
                                                {/if}
-                                       </small>
-                               {/if}
-                       </dd>
-               </dl>
-               
-               <dl id="boxControllerContainer"{if $errorField == 'boxControllerID'} class="formError"{/if}{if !$boxController} style="display: none;"{/if}>
-                       <dt><label for="boxControllerID">{lang}wcf.acp.box.boxController{/lang}</label></dt>
-                       <dd>
-                               <select name="boxControllerID" id="boxControllerID">
-                                       {foreach from=$availableBoxControllers item=availableBoxController}
-                                               <option value="{@$availableBoxController->objectTypeID}"{if $boxController && $availableBoxController->objectTypeID == $boxController->objectTypeID} selected="selected"{/if}>{lang}wcf.acp.box.boxController.{@$availableBoxController->objectType}{/lang}</option>
-                                       {/foreach}
-                               </select>
+                                       </dd>
+                               </dl>
                                
-                               {if $errorField == 'boxType'}
-                                       <small class="innerError">
-                                               {if $errorType == 'empty'}
-                                                       {lang}wcf.global.form.error.empty{/lang}
-                                               {else}
-                                                       {lang}wcf.acp.box.boxController.error.{@$errorType}{/lang}
+                               <dl id="boxControllerContainer"{if $errorField == 'boxControllerID'} class="formError"{/if}{if !$boxController} style="display: none;"{/if}>
+                                       <dt><label for="boxControllerID">{lang}wcf.acp.box.boxController{/lang}</label></dt>
+                                       <dd>
+                                               <select name="boxControllerID" id="boxControllerID">
+                                                       {foreach from=$availableBoxControllers item=availableBoxController}
+                                                               <option value="{@$availableBoxController->objectTypeID}"{if $boxController && $availableBoxController->objectTypeID == $boxController->objectTypeID} selected="selected"{/if}>{lang}wcf.acp.box.boxController.{@$availableBoxController->objectType}{/lang}</option>
+                                                       {/foreach}
+                                               </select>
+                                               
+                                               {if $errorField == 'boxType'}
+                                                       <small class="innerError">
+                                                               {if $errorType == 'empty'}
+                                                                       {lang}wcf.global.form.error.empty{/lang}
+                                                               {else}
+                                                                       {lang}wcf.acp.box.boxController.error.{@$errorType}{/lang}
+                                                               {/if}
+                                                       </small>
                                                {/if}
-                                       </small>
-                               {/if}
-                       </dd>
-               </dl>
-               
-               <dl{if $errorField == 'position'} class="formError"{/if}>
-                       <dt><label for="position">{lang}wcf.acp.box.position{/lang}</label></dt>
-                       <dd>
-                               <select name="position" id="position">
-                                       {foreach from=$availablePositions item=availablePosition}
-                                               <option value="{@$availablePosition}"{if $availablePosition == $position} selected="selected"{/if}>{lang}wcf.acp.box.position.{@$availablePosition}{/lang}</option>
-                                       {/foreach}
-                               </select>
+                                       </dd>
+                               </dl>
                                
-                               {if $errorField == 'position'}
-                                       <small class="innerError">
-                                               {if $errorType == 'empty'}
-                                                       {lang}wcf.global.form.error.empty{/lang}
-                                               {else}
-                                                       {lang}wcf.acp.box.position.error.{@$errorType}{/lang}
-                                               {/if}
-                                       </small>
-                               {/if}
-                       </dd>
-               </dl>
-               
-               <dl>
-                       <dt><label for="showOrder">{lang}wcf.acp.box.showOrder{/lang}</label></dt>
-                       <dd>
-                               <input type="number" id="showOrder" name="showOrder" value="{@$showOrder}" class="tiny" min="0" />
-                       </dd>
-               </dl>
-               
-               <dl{if $errorField == 'cssClassName'} class="formError"{/if}>
-                       <dt><label for="cssClassName">{lang}wcf.acp.box.cssClassName{/lang}</label></dt>
-                       <dd>
-                               <input type="text" id="cssClassName" name="cssClassName" value="{$cssClassName}" class="long" />
-                               {if $errorField == 'cssClassName'}
-                                       <small class="innerError">
-                                               {if $errorType == 'empty'}
-                                                       {lang}wcf.global.form.error.empty{/lang}
-                                               {else}
-                                                       {lang}wcf.acp.box.cssClassName.error.{@$errorType}{/lang}
-                                               {/if}
-                                       </small>
-                               {/if}
-                       </dd>
-               </dl>
-               
-               <dl>
-                       <dt></dt>
-                       <dd>
-                               <label><input type="checkbox" id="showHeader" name="showHeader" value="1" {if $showHeader}checked="checked" {/if}/> {lang}wcf.acp.box.showHeader{/lang}</label>
-                       </dd>
-               </dl>
-               
-               <dl>
-                       <dt></dt>
-                       <dd>
-                               <label><input type="checkbox" id="visibleEverywhere" name="visibleEverywhere" value="1" {if $visibleEverywhere}checked="checked" {/if}/> {lang}wcf.acp.box.visibleEverywhere{/lang}</label>
-                       </dd>
-               </dl>
-               
-               <dl>
-                       <dt>{lang}wcf.acp.box.pageIDs{/lang}</dt>
-                       <dd>
-                               <ul class="scrollableCheckboxList">
-                                       {foreach from=$pageNodeList item=pageNode}
-                                               <li{if $pageNode->getDepth() > 1} style="padding-left: {$pageNode->getDepth()*20-20}px"{/if}>
-                                                       <label><input type="checkbox" name="pageIDs[]" value="{@$pageNode->pageID}"{if $pageNode->pageID|in_array:$pageIDs} checked="checked"{/if} /> {$pageNode->name}</label>
-                                               </li>
-                                       {/foreach}
-                               </ul>
-                       </dd>
-               </dl>
-               
-               {event name='dataFields'}
-       </section>
-       
-       <section class="section">
-               <h2 class="sectionTitle">{lang}wcf.acp.box.link{/lang}</h2>
-               
-               <dl>
-                       <dt></dt>
-                       <dd class="floated">
-                               <label><input type="radio" name="linkType" value="none"{if $linkType == 'none'} checked="checked"{/if} /> {lang}wcf.acp.box.linkType.none{/lang}</label>
-                               <label><input type="radio" name="linkType" value="internal"{if $linkType == 'internal'} checked="checked"{/if} /> {lang}wcf.acp.box.linkType.internal{/lang}</label>
-                               <label><input type="radio" name="linkType" value="external"{if $linkType == 'external'} checked="checked"{/if} /> {lang}wcf.acp.box.linkType.external{/lang}</label>
-                       </dd>
-               </dl>
-               
-               <dl id="linkPageIDContainer"{if $errorField == 'linkPageID'} class="formError"{/if}{if $linkType != 'internal'} style="display: none;"{/if}>
-                       <dt><label for="linkPageID">{lang}wcf.acp.box.linkPageID{/lang}</label></dt>
-                       <dd>
-                               <select name="linkPageID" id="linkPageID">
-                                       <option value="0">{lang}wcf.global.noSelection{/lang}</option>
-                                       
-                                       {foreach from=$pageNodeList item=pageNode}
-                                               <option value="{@$pageNode->pageID}"{if $pageNode->pageID == $linkPageID} selected="selected"{/if}>{if $pageNode->getDepth() > 1}{@"&nbsp;&nbsp;&nbsp;&nbsp;"|str_repeat:($pageNode->getDepth() - 1)}{/if}{$pageNode->name}</option>
-                                       {/foreach}
-                               </select>
-                               {if $errorField == 'linkPageID'}
-                                       <small class="innerError">
-                                               {if $errorType == 'empty'}
-                                                       {lang}wcf.global.form.error.empty{/lang}
-                                               {else}
-                                                       {lang}wcf.acp.box.linkPageID.error.{@$errorType}{/lang}
-                                               {/if}
-                                       </small>
-                               {/if}
-                       </dd>
-               </dl>
-               
-               <dl id="linkPageObjectIDContainer"{if $errorField == 'linkPageObjectID'} class="formError"{/if}{if !$linkPageID || !$pageHandler[$linkPageID]|isset} style="display: none;"{/if}>
-                       <dt><label for="linkPageObjectID">{lang}wcf.acp.box.linkPageObjectID{/lang}</label></dt>
-                       <dd>
-                               <div class="inputAddon">
-                                       <input type="text" id="linkPageObjectID" name="linkPageObjectID" value="{$linkPageObjectID}" class="short">
-                                       <a href="#" id="searchLinkPageObjectID" class="inputSuffix button jsTooltip" title="{lang}wcf.acp.page.objectID.search{/lang}"><span class="icon icon16 fa-search"></span></a>
-                               </div>
-                               {if $errorField == 'linkPageObjectID'}
-                                       <small class="innerError">
-                                               {if $errorType == 'empty'}
-                                                       {lang}wcf.global.form.error.empty{/lang}
-                                               {else}
-                                                       {lang}wcf.acp.box.linkPageObjectID.error.{@$errorType}{/lang}
+                               <dl{if $errorField == 'position'} class="formError"{/if}>
+                                       <dt><label for="position">{lang}wcf.acp.box.position{/lang}</label></dt>
+                                       <dd>
+                                               <select name="position" id="position">
+                                                       {foreach from=$availablePositions item=availablePosition}
+                                                               <option value="{@$availablePosition}"{if $availablePosition == $position} selected="selected"{/if}>{lang}wcf.acp.box.position.{@$availablePosition}{/lang}</option>
+                                                       {/foreach}
+                                               </select>
+                                               
+                                               {if $errorField == 'position'}
+                                                       <small class="innerError">
+                                                               {if $errorType == 'empty'}
+                                                                       {lang}wcf.global.form.error.empty{/lang}
+                                                               {else}
+                                                                       {lang}wcf.acp.box.position.error.{@$errorType}{/lang}
+                                                               {/if}
+                                                       </small>
                                                {/if}
-                                       </small>
-                               {/if}
-                       </dd>
-               </dl>
-               
-               <dl id="externalURLContainer"{if $errorField == 'externalURL'} class="formError"{/if}{if $linkType != 'external'} style="display: none;"{/if}>
-                       <dt><label for="externalURL">{lang}wcf.acp.box.link.externalURL{/lang}</label></dt>
-                       <dd>
-                               <input type="text" name="externalURL" id="externalURL" value="{$externalURL}" class="long" />
-                               {if $errorField == 'externalURL'}
-                                       <small class="innerError">
-                                               {if $errorType == 'empty'}
-                                                       {lang}wcf.global.form.error.empty{/lang}
-                                               {else}
-                                                       {lang}wcf.acp.box.link.externalURL.error.{$errorType}{/lang}
+                                       </dd>
+                               </dl>
+                               
+                               <dl>
+                                       <dt><label for="showOrder">{lang}wcf.acp.box.showOrder{/lang}</label></dt>
+                                       <dd>
+                                               <input type="number" id="showOrder" name="showOrder" value="{@$showOrder}" class="tiny" min="0" />
+                                       </dd>
+                               </dl>
+                               
+                               <dl{if $errorField == 'cssClassName'} class="formError"{/if}>
+                                       <dt><label for="cssClassName">{lang}wcf.acp.box.cssClassName{/lang}</label></dt>
+                                       <dd>
+                                               <input type="text" id="cssClassName" name="cssClassName" value="{$cssClassName}" class="long" />
+                                               {if $errorField == 'cssClassName'}
+                                                       <small class="innerError">
+                                                               {if $errorType == 'empty'}
+                                                                       {lang}wcf.global.form.error.empty{/lang}
+                                                               {else}
+                                                                       {lang}wcf.acp.box.cssClassName.error.{@$errorType}{/lang}
+                                                               {/if}
+                                                       </small>
                                                {/if}
-                                       </small>
-                               {/if}
-                       </dd>
-               </dl>
-               
-               {event name='linkFields'}
-       </section>
-       
-       <div id="boxConditions">
-               {if $boxController && $boxController->getProcessor()|is_subclass_of:'wcf\system\box\IConditionBoxController'}
-                       {@$boxController->getProcessor()->getConditionsTemplate()}
-               {/if}
-       </div>
-       
-       {if !$isMultilingual}
-               <section class="section">
-                       <h2 class="sectionTitle">{* TODO *}content</h2>
+                                       </dd>
+                               </dl>
+                               
+                               <dl>
+                                       <dt></dt>
+                                       <dd>
+                                               <label><input type="checkbox" id="showHeader" name="showHeader" value="1" {if $showHeader}checked="checked" {/if}/> {lang}wcf.acp.box.showHeader{/lang}</label>
+                                       </dd>
+                               </dl>
+                       </div>
                        
-                       {if $__wcf->session->getPermission('admin.content.cms.canUseMedia')}
-                               <dl{if $errorField == 'image'} class="formError"{/if}>
-                                       <dt><label for="image">{lang}wcf.acp.box.image{/lang}</label></dt>
+                       <section class="section">
+                               <h2 class="sectionTitle">{lang}wcf.acp.box.link{/lang}</h2>
+                               
+                               <dl>
+                                       <dt></dt>
+                                       <dd class="floated">
+                                               <label><input type="radio" name="linkType" value="none"{if $linkType == 'none'} checked="checked"{/if} /> {lang}wcf.acp.box.linkType.none{/lang}</label>
+                                               <label><input type="radio" name="linkType" value="internal"{if $linkType == 'internal'} checked="checked"{/if} /> {lang}wcf.acp.box.linkType.internal{/lang}</label>
+                                               <label><input type="radio" name="linkType" value="external"{if $linkType == 'external'} checked="checked"{/if} /> {lang}wcf.acp.box.linkType.external{/lang}</label>
+                                       </dd>
+                               </dl>
+                               
+                               <dl id="linkPageIDContainer"{if $errorField == 'linkPageID'} class="formError"{/if}{if $linkType != 'internal'} style="display: none;"{/if}>
+                                       <dt><label for="linkPageID">{lang}wcf.acp.box.linkPageID{/lang}</label></dt>
                                        <dd>
-                                               <div id="imageDisplay">
-                                                       {if $images[0]|isset}
-                                                               {@$images[0]->getThumbnailTag('small')}
-                                                       {/if}
+                                               <select name="linkPageID" id="linkPageID">
+                                                       <option value="0">{lang}wcf.global.noSelection{/lang}</option>
+                                                       
+                                                       {foreach from=$pageNodeList item=pageNode}
+                                                               <option value="{@$pageNode->pageID}"{if $pageNode->pageID == $linkPageID} selected="selected"{/if}>{if $pageNode->getDepth() > 1}{@"&nbsp;&nbsp;&nbsp;&nbsp;"|str_repeat:($pageNode->getDepth() - 1)}{/if}{$pageNode->name}</option>
+                                                       {/foreach}
+                                               </select>
+                                               {if $errorField == 'linkPageID'}
+                                                       <small class="innerError">
+                                                               {if $errorType == 'empty'}
+                                                                       {lang}wcf.global.form.error.empty{/lang}
+                                                               {else}
+                                                                       {lang}wcf.acp.box.linkPageID.error.{@$errorType}{/lang}
+                                                               {/if}
+                                                       </small>
+                                               {/if}
+                                       </dd>
+                               </dl>
+                               
+                               <dl id="linkPageObjectIDContainer"{if $errorField == 'linkPageObjectID'} class="formError"{/if}{if !$linkPageID || !$pageHandler[$linkPageID]|isset} style="display: none;"{/if}>
+                                       <dt><label for="linkPageObjectID">{lang}wcf.acp.box.linkPageObjectID{/lang}</label></dt>
+                                       <dd>
+                                               <div class="inputAddon">
+                                                       <input type="text" id="linkPageObjectID" name="linkPageObjectID" value="{$linkPageObjectID}" class="short">
+                                                       <a href="#" id="searchLinkPageObjectID" class="inputSuffix button jsTooltip" title="{lang}wcf.acp.page.objectID.search{/lang}"><span class="icon icon16 fa-search"></span></a>
                                                </div>
-                                               <p class="button jsMediaSelectButton" data-store="imageID0" data-display="imageDisplay">{lang}wcf.acp.box.image.button.chooseImage{/lang}</p>
-                                               <input type="hidden" name="imageID[0]" id="imageID0"{if $imageID[0]|isset} value="{@$imageID[0]}"{/if} />
-                                               {if $errorField == 'image'}
-                                                       <small class="innerError">{lang}wcf.acp.box.image.error.{@$errorType}{/lang}</small>
+                                               {if $errorField == 'linkPageObjectID'}
+                                                       <small class="innerError">
+                                                               {if $errorType == 'empty'}
+                                                                       {lang}wcf.global.form.error.empty{/lang}
+                                                               {else}
+                                                                       {lang}wcf.acp.box.linkPageObjectID.error.{@$errorType}{/lang}
+                                                               {/if}
+                                                       </small>
                                                {/if}
                                        </dd>
                                </dl>
-                       {elseif $action == 'edit' && $images[0]|isset}
-                               <dl>
-                                       <dt>{lang}wcf.acp.box.image{/lang}</dt>
+                               
+                               <dl id="externalURLContainer"{if $errorField == 'externalURL'} class="formError"{/if}{if $linkType != 'external'} style="display: none;"{/if}>
+                                       <dt><label for="externalURL">{lang}wcf.acp.box.link.externalURL{/lang}</label></dt>
                                        <dd>
-                                               <div id="imageDisplay">{@$images[0]->getThumbnailTag('small')}</div>
+                                               <input type="text" name="externalURL" id="externalURL" value="{$externalURL}" class="long" />
+                                               {if $errorField == 'externalURL'}
+                                                       <small class="innerError">
+                                                               {if $errorType == 'empty'}
+                                                                       {lang}wcf.global.form.error.empty{/lang}
+                                                               {else}
+                                                                       {lang}wcf.acp.box.link.externalURL.error.{$errorType}{/lang}
+                                                               {/if}
+                                                       </small>
+                                               {/if}
                                        </dd>
                                </dl>
-                       {/if}
-                       
-                       <dl{if $errorField == 'title'} class="formError"{/if}>
-                               <dt><label for="title">{lang}wcf.acp.box.title{/lang}</label></dt>
-                               <dd>
-                                       <input type="text" id="title0" name="title[0]" value="{if !$title[0]|empty}{$title[0]}{/if}" class="long" />
-                                       {if $errorField == 'title'}
-                                               <small class="innerError">
-                                                       {if $errorType == 'empty'}
-                                                               {lang}wcf.global.form.error.empty{/lang}
-                                                       {else}
-                                                               {lang}wcf.acp.box.title.error.{@$errorType}{/lang}
-                                                       {/if}
-                                               </small>
-                                       {/if}
-                               </dd>
-                       </dl>
-                       
-                       <dl{if $errorField == 'content'} class="formError"{/if}>
-                               <dt><label for="content0">{lang}wcf.acp.box.content{/lang}</label></dt>
-                               <dd>
-                                       <textarea name="content[0]" id="content0" rows="10">{if !$content[0]|empty}{$content[0]}{/if}</textarea>
-                                       {if $errorField == 'content'}
-                                               <small class="innerError">
-                                                       {if $errorType == 'empty'}
-                                                               {lang}wcf.global.form.error.empty{/lang}
-                                                       {else}
-                                                               {lang}wcf.acp.box.content.error.{@$errorType}{/lang}
-                                                       {/if}
-                                               </small>
-                                       {/if}
-                               </dd>
-                       </dl>
-               </section>
-       {else}
-               <div class="section tabMenuContainer">
-                       <nav class="tabMenu">
-                               <ul>
-                                       {foreach from=$availableLanguages item=availableLanguage}
-                                               {assign var='containerID' value='language'|concat:$availableLanguage->languageID}
-                                               <li><a href="{@$__wcf->getAnchor($containerID)}">{$availableLanguage->languageName}</a></li>
-                                       {/foreach}
-                               </ul>
-                       </nav>
+                               
+                               {event name='linkFields'}
+                       </section>
                        
-                       {foreach from=$availableLanguages item=availableLanguage}
-                               <div id="language{@$availableLanguage->languageID}" class="tabMenuContent">
-                                       <div class="section">
-                                               {if $__wcf->session->getPermission('admin.content.cms.canUseMedia')}
-                                                       <dl{if $errorField == 'image'|concat:$availableLanguage->languageID} class="formError"{/if}>
-                                                               <dt><label for="image{@$availableLanguage->languageID}">{lang}wcf.acp.box.image{/lang}</label></dt>
-                                                               <dd>
-                                                                       <div id="imageDisplay{@$availableLanguage->languageID}">
-                                                                               {if $images[$availableLanguage->languageID]|isset}
-                                                                                       {@$images[$availableLanguage->languageID]->getThumbnailTag('small')}
-                                                                               {/if}
-                                                                       </div>
-                                                                       <p class="button jsMediaSelectButton" data-store="imageID{@$availableLanguage->languageID}" data-display="imageDisplay{@$availableLanguage->languageID}">{lang}wcf.acp.box.image.button.chooseImage{/lang}</p>
-                                                                       <input type="hidden" name="imageID[{@$availableLanguage->languageID}]" id="imageID{@$availableLanguage->languageID}"{if $imageID[$availableLanguage->languageID]|isset} value="{@$imageID[$availableLanguage->languageID]}"{/if} />
-                                                                       {if $errorField == 'image'|concat:$availableLanguage->languageID}
-                                                                               <small class="innerError">{lang}wcf.acp.box.image.error.{@$errorType}{/lang}</small>
-                                                                       {/if}
-                                                               </dd>
-                                                       </dl>
-                                               {elseif $action == 'edit' && $images[$availableLanguage->languageID]|isset}
-                                                       <dl>
-                                                               <dt>{lang}wcf.acp.box.image{/lang}</dt>
-                                                               <dd>
-                                                                       <div id="imageDisplay">{@$images[$availableLanguage->languageID]->getThumbnailTag('small')}</div>
-                                                               </dd>
-                                                       </dl>
-                                               {/if}
-                                               
-                                               <dl{if $errorField == 'title'|concat:$availableLanguage->languageID} class="formError"{/if}>
-                                                       <dt><label for="title{@$availableLanguage->languageID}">{lang}wcf.acp.box.title{/lang}</label></dt>
+                       <div id="boxConditions">
+                               {if $boxController && $boxController->getProcessor()|is_subclass_of:'wcf\system\box\IConditionBoxController'}
+                                       {@$boxController->getProcessor()->getConditionsTemplate()}
+                               {/if}
+                       </div>
+               </div>
+               
+               <div id="contents" class="tabMenuContent">
+                       {if !$isMultilingual && $boxType != 'system'}
+                               <div class="section">
+                                       {if $__wcf->session->getPermission('admin.content.cms.canUseMedia')}
+                                               <dl{if $errorField == 'image'} class="formError"{/if}>
+                                                       <dt><label for="image">{lang}wcf.acp.box.image{/lang}</label></dt>
                                                        <dd>
-                                                               <input type="text" id="title{@$availableLanguage->languageID}" name="title[{@$availableLanguage->languageID}]" value="{if !$title[$availableLanguage->languageID]|empty}{$title[$availableLanguage->languageID]}{/if}" class="long" />
-                                                               {if $errorField == 'title'|concat:$availableLanguage->languageID}
-                                                                       <small class="innerError">
-                                                                               {if $errorType == 'empty'}
-                                                                                       {lang}wcf.global.form.error.empty{/lang}
-                                                                               {else}
-                                                                                       {lang}wcf.acp.box.title.error.{@$errorType}{/lang}
-                                                                               {/if}
-                                                                       </small>
+                                                               <div id="imageDisplay">
+                                                                       {if $images[0]|isset}
+                                                                               {@$images[0]->getThumbnailTag('small')}
+                                                                       {/if}
+                                                               </div>
+                                                               <p class="button jsMediaSelectButton" data-store="imageID0" data-display="imageDisplay">{lang}wcf.acp.box.image.button.chooseImage{/lang}</p>
+                                                               <input type="hidden" name="imageID[0]" id="imageID0"{if $imageID[0]|isset} value="{@$imageID[0]}"{/if} />
+                                                               {if $errorField == 'image'}
+                                                                       <small class="innerError">{lang}wcf.acp.box.image.error.{@$errorType}{/lang}</small>
                                                                {/if}
                                                        </dd>
                                                </dl>
-                                               
-                                               <dl{if $errorField == 'content'|concat:$availableLanguage->languageID} class="formError"{/if}>
-                                                       <dt><label for="content{@$availableLanguage->languageID}">{lang}wcf.acp.box.content{/lang}</label></dt>
+                                       {elseif $action == 'edit' && $images[0]|isset}
+                                               <dl>
+                                                       <dt>{lang}wcf.acp.box.image{/lang}</dt>
                                                        <dd>
-                                                               <textarea name="content[{@$availableLanguage->languageID}]" id="content{@$availableLanguage->languageID}">{if !$content[$availableLanguage->languageID]|empty}{$content[$availableLanguage->languageID]}{/if}</textarea>
-                                                               {if $errorField == 'content'|concat:$availableLanguage->languageID}
-                                                                       <small class="innerError">
-                                                                               {if $errorType == 'empty'}
-                                                                                       {lang}wcf.global.form.error.empty{/lang}
-                                                                               {else}
-                                                                                       {lang}wcf.acp.box.content.error.{@$errorType}{/lang}
-                                                                               {/if}
-                                                                       </small>
-                                                               {/if}
+                                                               <div id="imageDisplay">{@$images[0]->getThumbnailTag('small')}</div>
                                                        </dd>
                                                </dl>
-                                       </div>
+                                       {/if}
+                                       
+                                       <dl{if $errorField == 'title'} class="formError"{/if}>
+                                               <dt><label for="title">{lang}wcf.acp.box.title{/lang}</label></dt>
+                                               <dd>
+                                                       <input type="text" id="title0" name="title[0]" value="{if !$title[0]|empty}{$title[0]}{/if}" class="long" />
+                                                       {if $errorField == 'title'}
+                                                               <small class="innerError">
+                                                                       {if $errorType == 'empty'}
+                                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                                       {else}
+                                                                               {lang}wcf.acp.box.title.error.{@$errorType}{/lang}
+                                                                       {/if}
+                                                               </small>
+                                                       {/if}
+                                               </dd>
+                                       </dl>
+                                       
+                                       <dl{if $errorField == 'content'} class="formError"{/if}>
+                                               <dt><label for="content0">{lang}wcf.acp.box.content{/lang}</label></dt>
+                                               <dd>
+                                                       <textarea name="content[0]" id="content0" rows="10">{if !$content[0]|empty}{$content[0]}{/if}</textarea>
+                                                       {if $errorField == 'content'}
+                                                               <small class="innerError">
+                                                                       {if $errorType == 'empty'}
+                                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                                       {else}
+                                                                               {lang}wcf.acp.box.content.error.{@$errorType}{/lang}
+                                                                       {/if}
+                                                               </small>
+                                                       {/if}
+                                               </dd>
+                                       </dl>
                                </div>
-                       {/foreach}
+                       {else}
+                               <div class="tabMenuContainer">
+                                       <nav class="menu">
+                                               <ul>
+                                                       {foreach from=$availableLanguages item=availableLanguage}
+                                                               {assign var='containerID' value='language'|concat:$availableLanguage->languageID}
+                                                               <li><a href="{@$__wcf->getAnchor($containerID)}">{$availableLanguage->languageName}</a></li>
+                                                       {/foreach}
+                                               </ul>
+                                       </nav>
+                                       
+                                       {foreach from=$availableLanguages item=availableLanguage}
+                                               <div id="language{@$availableLanguage->languageID}" class="tabMenuContent">
+                                                       <div class="section">
+                                                               {if $boxType != 'system'}
+                                                                       {if $__wcf->session->getPermission('admin.content.cms.canUseMedia')}
+                                                                               <dl{if $errorField == 'image'|concat:$availableLanguage->languageID} class="formError"{/if}>
+                                                                                       <dt><label for="image{@$availableLanguage->languageID}">{lang}wcf.acp.box.image{/lang}</label></dt>
+                                                                                       <dd>
+                                                                                               <div id="imageDisplay{@$availableLanguage->languageID}">
+                                                                                                       {if $images[$availableLanguage->languageID]|isset}
+                                                                                                               {@$images[$availableLanguage->languageID]->getThumbnailTag('small')}
+                                                                                                       {/if}
+                                                                                               </div>
+                                                                                               <p class="button jsMediaSelectButton" data-store="imageID{@$availableLanguage->languageID}" data-display="imageDisplay{@$availableLanguage->languageID}">{lang}wcf.acp.box.image.button.chooseImage{/lang}</p>
+                                                                                               <input type="hidden" name="imageID[{@$availableLanguage->languageID}]" id="imageID{@$availableLanguage->languageID}"{if $imageID[$availableLanguage->languageID]|isset} value="{@$imageID[$availableLanguage->languageID]}"{/if} />
+                                                                                               {if $errorField == 'image'|concat:$availableLanguage->languageID}
+                                                                                                       <small class="innerError">{lang}wcf.acp.box.image.error.{@$errorType}{/lang}</small>
+                                                                                               {/if}
+                                                                                       </dd>
+                                                                               </dl>
+                                                                       {elseif $action == 'edit' && $images[$availableLanguage->languageID]|isset}
+                                                                               <dl>
+                                                                                       <dt>{lang}wcf.acp.box.image{/lang}</dt>
+                                                                                       <dd>
+                                                                                               <div id="imageDisplay">{@$images[$availableLanguage->languageID]->getThumbnailTag('small')}</div>
+                                                                                       </dd>
+                                                                               </dl>
+                                                                       {/if}
+                                                               {/if}
+                                                               
+                                                               <dl{if $errorField == 'title'|concat:$availableLanguage->languageID} class="formError"{/if}>
+                                                                       <dt><label for="title{@$availableLanguage->languageID}">{lang}wcf.acp.box.title{/lang}</label></dt>
+                                                                       <dd>
+                                                                               <input type="text" id="title{@$availableLanguage->languageID}" name="title[{@$availableLanguage->languageID}]" value="{if !$title[$availableLanguage->languageID]|empty}{$title[$availableLanguage->languageID]}{/if}" class="long" />
+                                                                               {if $errorField == 'title'|concat:$availableLanguage->languageID}
+                                                                                       <small class="innerError">
+                                                                                               {if $errorType == 'empty'}
+                                                                                                       {lang}wcf.global.form.error.empty{/lang}
+                                                                                               {else}
+                                                                                                       {lang}wcf.acp.box.title.error.{@$errorType}{/lang}
+                                                                                               {/if}
+                                                                                       </small>
+                                                                               {/if}
+                                                                       </dd>
+                                                               </dl>
+                                                               
+                                                               {if $boxType != 'system'}
+                                                                       <dl{if $errorField == 'content'|concat:$availableLanguage->languageID} class="formError"{/if}>
+                                                                               <dt><label for="content{@$availableLanguage->languageID}">{lang}wcf.acp.box.content{/lang}</label></dt>
+                                                                               <dd>
+                                                                                       <textarea name="content[{@$availableLanguage->languageID}]" id="content{@$availableLanguage->languageID}">{if !$content[$availableLanguage->languageID]|empty}{$content[$availableLanguage->languageID]}{/if}</textarea>
+                                                                                       {if $errorField == 'content'|concat:$availableLanguage->languageID}
+                                                                                               <small class="innerError">
+                                                                                                       {if $errorType == 'empty'}
+                                                                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                                                                       {else}
+                                                                                                               {lang}wcf.acp.box.content.error.{@$errorType}{/lang}
+                                                                                                       {/if}
+                                                                                               </small>
+                                                                                       {/if}
+                                                                               </dd>
+                                                                       </dl>
+                                                               {/if}
+                                                       </div>
+                                               </div>
+                                       {/foreach}
+                               </div>
+                       {/if}
                </div>
-       {/if}
-       
-       {event name='sections'}
+               
+               <div id="pages" class="tabMenuContent">
+                       <div class="section">
+                               <dl>
+                                       <dt></dt>
+                                       <dd>
+                                               <label><input type="checkbox" id="visibleEverywhere" name="visibleEverywhere" value="1" {if $visibleEverywhere}checked="checked" {/if}/> {lang}wcf.acp.box.visibleEverywhere{/lang}</label>
+                                       </dd>
+                               </dl>
+                               
+                               <dl>
+                                       <dt>{lang}wcf.acp.box.pageIDs{/lang}</dt>
+                                       <dd>
+                                               <ul class="scrollableCheckboxList">
+                                                       {foreach from=$pageNodeList item=pageNode}
+                                                               <li{if $pageNode->getDepth() > 1} style="padding-left: {$pageNode->getDepth()*20-20}px"{/if}>
+                                                                       <label><input type="checkbox" name="pageIDs[]" value="{@$pageNode->pageID}"{if $pageNode->pageID|in_array:$pageIDs} checked="checked"{/if} /> {$pageNode->name}</label>
+                                                               </li>
+                                                       {/foreach}
+                                               </ul>
+                                       </dd>
+                               </dl>
+                       </div>
+               </div>
+       </div>
        
        <div class="formSubmit">
                <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
diff --git a/wcfsetup/install/files/acp/templates/boxAddDialog.tpl b/wcfsetup/install/files/acp/templates/boxAddDialog.tpl
new file mode 100644 (file)
index 0000000..09306be
--- /dev/null
@@ -0,0 +1,42 @@
+<div id="boxAddDialog" style="display: none">
+       <div class="section">
+               <dl>
+                       <dt>{lang}wcf.acp.box.type{/lang}</dt>
+                       <dd>
+                               <label><input type="radio" name="boxType" value="text" checked> {lang}wcf.acp.box.type.text{/lang}</label>
+                               <small>{lang}wcf.acp.box.type.text.description{/lang}</small>
+                               <label><input type="radio" name="boxType" value="html"> {lang}wcf.acp.box.type.html{/lang}</label>
+                               <small>{lang}wcf.acp.box.type.html.description{/lang}</small>
+                               <label><input type="radio" name="boxType" value="tpl"> {lang}wcf.acp.box.type.tpl{/lang}</label>
+                               <small>{lang}wcf.acp.box.type.tpl.description{/lang}</small>
+                               <label><input type="radio" name="boxType" value="system"> {lang}wcf.acp.box.type.system{/lang}</label>
+                               <small>{lang}wcf.acp.box.type.system.description{/lang}</small>
+                       </dd>
+               </dl>
+               
+               <dl>
+                       <dt>{lang}wcf.acp.box.i18n{/lang}</dt>
+                       <dd>
+                               <label><input type="radio" name="isMultilingual" value="0" checked> {lang}wcf.acp.box.i18n.none{/lang}</label>
+                               <small>{lang}wcf.acp.box.i18n.none.description{/lang}</small>
+                               <label><input type="radio" name="isMultilingual" value="1"> {lang}wcf.acp.box.i18n.i18n{/lang}</label>
+                               <small>{lang}wcf.acp.box.i18n.i18n.description{/lang}</small>
+                       </dd>
+               </dl>
+               
+               <div class="formSubmit">
+                       <button class="buttonPrimary">{lang}wcf.global.button.next{/lang}</button>
+               </div>
+       </div>
+</div>
+<script data-relocate="true">
+       require(['WoltLab/WCF/Acp/Ui/Box/Add'], function(AcpUiBoxAdd) {
+               AcpUiBoxAdd.init('{link controller='BoxAdd' encode=false}{literal}boxType={$boxType}&isMultilingual={$isMultilingual}{/literal}{/link}');
+               
+               {if $showBoxAddDialog}
+                       window.setTimeout(function() {
+                               AcpUiBoxAdd.openDialog();
+                       }, 10);
+               {/if}
+       });
+</script>
index 51edbbe122264242fee21eb8cd2d0c0eace527df..10acae3af44aaa6885a25fae1613d752628661f3 100644 (file)
@@ -15,8 +15,7 @@
        
        <nav class="contentHeaderNavigation">
                <ul>
-                       <li><a href="{link controller='BoxAdd'}{/link}" class="button"><span class="icon icon16 fa-plus"></span> <span>{lang}wcf.acp.box.add{/lang}</span></a></li>
-                       <li><a href="{link controller='BoxAdd'}isMultilingual=1{/link}" class="button"><span class="icon icon16 fa-plus"></span> <span>{lang}wcf.acp.box.addMultilingual{/lang}</span></a></li>
+                       <li><a href="#" class="button jsButtonBoxAdd"><span class="icon icon16 fa-plus"></span> <span>{lang}wcf.acp.box.add{/lang}</span></a></li>
                        
                        {event name='contentHeaderNavigation'}
                </ul>
                
                <nav class="contentFooterNavigation">
                        <ul>
-                               <li><a href="{link controller='BoxAdd'}{/link}" class="button"><span class="icon icon16 fa-plus"></span> <span>{lang}wcf.acp.box.add{/lang}</span></a></li>
-                               <li><a href="{link controller='BoxAdd'}isMultilingual=1{/link}" class="button"><span class="icon icon16 fa-plus"></span> <span>{lang}wcf.acp.box.addMultilingual{/lang}</span></a></li>
+                               <li><a href="#" class="button jsButtonBoxAdd"><span class="icon icon16 fa-plus"></span> <span>{lang}wcf.acp.box.add{/lang}</span></a></li>
                                
                                {event name='contentFooterNavigation'}
                        </ul>
        <p class="info">{lang}wcf.global.noItems{/lang}</p>
 {/if}
 
+{include file='boxAddDialog'}
+
 {include file='footer'}
index 088687fc21f983474647da7a093ee8c886944b86..39dc3b1c202ebbe5da091abd089c7b07b6cadf60 100644 (file)
@@ -4,7 +4,7 @@
                        <dt>{lang}wcf.acp.page.type{/lang}</dt>
                        <dd>
                                <label><input type="radio" name="pageType" value="text" checked> {lang}wcf.acp.page.type.text{/lang}</label>
-                               <small>{lang}wcf.acp.page.type.wysiwyg.description{/lang}</small>
+                               <small>{lang}wcf.acp.page.type.text.description{/lang}</small>
                                <label><input type="radio" name="pageType" value="html"> {lang}wcf.acp.page.type.html{/lang}</label>
                                <small>{lang}wcf.acp.page.type.html.description{/lang}</small>
                                <label><input type="radio" name="pageType" value="tpl"> {lang}wcf.acp.page.type.tpl{/lang}</label>
diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Acp/Ui/Box/Add.js b/wcfsetup/install/files/js/WoltLab/WCF/Acp/Ui/Box/Add.js
new file mode 100644 (file)
index 0000000..a0cf341
--- /dev/null
@@ -0,0 +1,64 @@
+/**
+ * Provides the dialog overlay to add a new box.
+ * 
+ * @author     Alexander Ebert
+ * @copyright  2001-2016 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @module     WoltLab/WCF/Acp/Ui/Box/Add
+ */
+define(['Core', 'Language', 'Ui/Dialog'], function(Core, Language, UiDialog) {
+       "use strict";
+       
+       var _link;
+       
+       /**
+        * @exports     WoltLab/WCF/Acp/Ui/Box/Add
+        */
+       return {
+               /**
+                * Initializes the box add handler.
+                * 
+                * @param       {string}        link    redirect URL
+                */
+               init: function(link) {
+                       _link = link;
+                       
+                       var buttons = elBySelAll('.jsButtonBoxAdd');
+                       for (var i = 0, length = buttons.length; i < length; i++) {
+                               buttons[i].addEventListener(WCF_CLICK_EVENT, this.openDialog.bind(this));
+                       }
+               },
+               
+               /**
+                * Opens the 'Add Box' dialog.
+                * 
+                * @param       {Event=}        event   event object
+                */
+               openDialog: function(event) {
+                       if (event instanceof Event) {
+                               event.preventDefault();
+                       }
+                       
+                       UiDialog.open(this);
+               },
+               
+               _dialogSetup: function() {
+                       return {
+                               id: 'boxAddDialog',
+                               options: {
+                                       onSetup: function(content) {
+                                               elBySel('button', content).addEventListener(WCF_CLICK_EVENT, function(event) {
+                                                       event.preventDefault();
+                                                       
+                                                       var boxType = elBySel('input[name="boxType"]:checked', content).value;
+                                                       var isMultilingual = elBySel('input[name="isMultilingual"]:checked', content).value;
+                                                       
+                                                       window.location = _link.replace(/{\$boxType}/, boxType).replace(/{\$isMultilingual}/, isMultilingual);
+                                               });
+                                       },
+                                       title: Language.get('wcf.acp.box.add')
+                               }
+                       };
+               }
+       }
+});
index fdcef64183c4c7a7e65a979963f894e04b1c03ab..9d8aeb27312b1be3b8dedd2e9026559e118f2e63 100644 (file)
@@ -12,11 +12,14 @@ use wcf\data\page\PageNodeTree;
 use wcf\form\AbstractForm;
 use wcf\system\box\IConditionBoxController;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
+use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\UserInputException;
 use wcf\system\language\LanguageFactory;
 use wcf\system\page\handler\ILookupPageHandler;
+use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 use wcf\util\ArrayUtil;
+use wcf\util\HeaderUtil;
 use wcf\util\StringUtil;
 
 /**
@@ -172,8 +175,8 @@ class BoxAddForm extends AbstractForm {
         */
        public function readParameters() {
                parent::readParameters();
-       
-               if (!empty($_REQUEST['isMultilingual'])) $this->isMultilingual = 1;
+               
+               $this->readBoxType();
                
                $this->pageNodeList = (new PageNodeTree())->getNodeList();
                
@@ -188,6 +191,27 @@ class BoxAddForm extends AbstractForm {
                }
        }
        
+       /**
+        * Reads basic page parameters controlling type and i18n.
+        *
+        * @throws      IllegalLinkException
+        */
+       protected function readBoxType() {
+               if (!empty($_REQUEST['isMultilingual'])) $this->isMultilingual = 1;
+               if (!empty($_REQUEST['boxType'])) $this->boxType = $_REQUEST['boxType'];
+               
+               // work-around to force adding boxes via dialog overlay
+               if (empty($_POST) && $this->boxType == '') {
+                       HeaderUtil::redirect(LinkHandler::getInstance()->getLink('BoxList', ['showBoxAddDialog' => 1]));
+                       exit;
+               }
+               
+               // validate box type
+               if (!in_array($this->boxType, Box::$availableBoxTypes)) {
+                       throw new IllegalLinkException();
+               }
+       }
+       
        /**
         * @inheritDoc
         */
@@ -247,11 +271,7 @@ class BoxAddForm extends AbstractForm {
                // validate name
                $this->validateName();
                
-               // validate box type
-               if (!in_array($this->boxType, Box::$availableBoxTypes)) {
-                       throw new UserInputException('boxType');
-               }
-               
+               // validate controller
                if ($this->boxType === 'system') {
                        $this->boxController = ObjectTypeCache::getInstance()->getObjectType($this->boxControllerID);
                        if ($this->boxController === null || $this->boxController->getDefinition()->definitionName != 'com.woltlab.wcf.boxController') {
index fca8e320ba7cdaa29be5aef5d33ff0d39a4e2e7a..2e640f979da722c2c24874eca3896b9ce6fa10dd 100644 (file)
@@ -56,6 +56,13 @@ class BoxEditForm extends BoxAddForm {
                if ($this->box->isMultilingual) $this->isMultilingual = 1;
        }
        
+       /**
+        * @inheritDoc
+        */
+       protected function readBoxType() {
+               // not required for editing
+       }
+       
        /**
         * @inheritDoc
         */
index 41b573105bff921480315c63c383b433178e8441..43e55fab7549fa1d59c4b580b23fa71a1914b527 100644 (file)
@@ -67,7 +67,7 @@ class BoxListPage extends SortablePage {
         * box type
         * @var string
         */
-       public $boxType = '';
+       public $boxType = 'static';
        
        /**
         * box position
@@ -75,6 +75,12 @@ class BoxListPage extends SortablePage {
         */
        public $position = '';
        
+       /**
+        * display 'Add Box' dialog on load
+        * @var integer
+        */
+       public $showBoxAddDialog = 0;
+       
        /**
         * @inheritdoc
         */
@@ -86,6 +92,7 @@ class BoxListPage extends SortablePage {
                if (!empty($_REQUEST['content'])) $this->content = StringUtil::trim($_REQUEST['content']);
                if (!empty($_REQUEST['boxType'])) $this->boxType = $_REQUEST['boxType'];
                if (!empty($_REQUEST['position'])) $this->position = $_REQUEST['position'];
+               if (!empty($_REQUEST['showBoxAddDialog'])) $this->showBoxAddDialog = 1;
        }
        
        /**
@@ -129,7 +136,8 @@ class BoxListPage extends SortablePage {
                        'content' => $this->content,
                        'boxType' => $this->boxType,
                        'position' => $this->position,
-                       'availablePositions' => Box::$availablePositions
+                       'availablePositions' => Box::$availablePositions,
+                       'showBoxAddDialog' => $this->showBoxAddDialog
                ]);
        }
 }