Added proper phrases (yet missing in .xml-PIPs)
authorAlexander Ebert <ebert@woltlab.com>
Fri, 11 Mar 2016 13:07:27 +0000 (14:07 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 11 Mar 2016 13:07:27 +0000 (14:07 +0100)
wcfsetup/install/files/acp/templates/menuItemAdd.tpl
wcfsetup/install/files/js/WoltLab/WCF/Acp/Ui/Menu/Item/Handler.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Page/Search/Handler.js
wcfsetup/install/files/lib/acp/form/MenuItemEditForm.class.php

index 580f50014154d757948aad0dac5d5eb77872d11d..fb6552e8d90bf130604e26b26d8c4f43b6ff86a5 100644 (file)
@@ -1,7 +1,15 @@
 {include file='header' pageTitle='wcf.acp.menu.item.'|concat:$action}
 
 <script data-relocate="true">
-       require(['Dictionary', 'WoltLab/WCF/Acp/Ui/Menu/Item/Handler'], function(Dictionary, AcpUiMenuItemHandler) {
+       require(['Dictionary', 'Language', 'WoltLab/WCF/Acp/Ui/Menu/Item/Handler'], function(Dictionary, Language, AcpUiMenuItemHandler) {
+               Language.addObject({
+                       'wcf.page.pageObjectID.search.noResults': '{lang}wcf.page.pageObjectID.search.noResults{/lang}',
+                       'wcf.page.pageObjectID.search.results': '{lang}wcf.page.pageObjectID.search.results{/lang}',
+                       'wcf.page.pageObjectID.search.results.description': '{lang}wcf.page.pageObjectID.search.results.description{/lang}',
+                       'wcf.page.pageObjectID.search.terms': '{lang}wcf.page.pageObjectID.search.terms{/lang}',
+                       'wcf.page.pageObjectID.search.terms.description': '{lang}wcf.page.pageObjectID.search.terms.description{/lang}'
+               });
+               
                var handlers = new Dictionary();
                {foreach from=$pageHandlers key=handlerPageID item=requireObjectID}
                        handlers.set({@$handlerPageID}, {if $requireObjectID}true{else}false{/if});
                        <dd>
                                <div class="inputAddon">
                                        <input type="text" id="pageObjectID" name="pageObjectID" value="{$pageObjectID}" class="short">
-                                       <a href="#" id="searchPageObjectID" class="inputSuffix button jsTooltip" title="TODO: Search"><span class="icon icon16 fa-search"></span></a>
+                                       <a href="#" id="searchPageObjectID" class="inputSuffix button jsTooltip" title="{lang}wcf.acp.page.objectID.search{/lang}"><span class="icon icon16 fa-search"></span></a>
                                </div>
                                {if $errorField == 'pageObjectID'}
                                        <small class="innerError">
index 7d1072798d378738dae76ed6ab09d61ad84d0cf5..d83826fbcb2b1bc5d56adf133a7b61f6643dc764 100644 (file)
@@ -110,7 +110,7 @@ define(['Dictionary', 'WoltLab/Wcf/Ui/Page/Search/Handler'], function(Dictionary
                _openSearch: function(event) {
                        event.preventDefault();
                        
-                       UiPageSearchHandler.open(_activePageId, 'foo', function(objectId) {
+                       UiPageSearchHandler.open(_activePageId, _pageId.options[_pageId.selectedIndex].textContent, function(objectId) {
                                _pageObjectId.value = objectId;
                                _cache.set(_activePageId, objectId);
                        });
index a9074288cf4d1a714ccab179385477a8251bb015..78d696495ca6f97584f8a2d69cc8f8f313c8a5bb 100644 (file)
@@ -7,7 +7,7 @@
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @module     WoltLab/WCF/Ui/Page/Search/Handler
  */
-define(['StringUtil', 'Dom/Util', 'Ui/Dialog', './Input'], function(StringUtil, DomUtil, UiDialog, UiPageSearchInput) {
+define(['Language', 'StringUtil', 'Dom/Util', 'Ui/Dialog', './Input'], function(Language, StringUtil, DomUtil, UiDialog, UiPageSearchInput) {
        "use strict";
        
        var _callback = null;
@@ -49,7 +49,7 @@ define(['StringUtil', 'Dom/Util', 'Ui/Dialog', './Input'], function(StringUtil,
                        if (!Array.isArray(data.returnValues) || data.returnValues.length === 0) {
                                var innerError = elCreate('small');
                                innerError.className = 'innerError';
-                               innerError.textContent = 'TODO: no matches';
+                               innerError.textContent = Language.get('wcf.page.pageObjectID.search.noResults');
                                DomUtil.insertAfter(innerError, _searchInput);
                                
                                return;
@@ -156,17 +156,17 @@ define(['StringUtil', 'Dom/Util', 'Ui/Dialog', './Input'], function(StringUtil,
                                },
                                source: '<div class="section">'
                                                + '<dl>'
-                                                       + '<dt><label for="wcfUiPageSearchInput">TODO: Search terms</label></dt>'
+                                                       + '<dt><label for="wcfUiPageSearchInput">' + Language.get('wcf.page.pageObjectID.search.terms') + '</label></dt>'
                                                        + '<dd>'
                                                                + '<input type="text" id="wcfUiPageSearchInput" class="long">'
-                                                               + '<small>TODO: Enter at least 3 characters to search</small>'
+                                                               + '<small>' + Language.get('wcf.page.pageObjectID.search.terms.description') + '</small>'
                                                        + '</dd>'
                                                + '</dl>'
                                        + '</div>'
                                        + '<section id="wcfUiPageSearchResultListContainer" class="section sectionContainerList">'
                                                + '<header class="sectionHeader">'
-                                                       + '<h2 class="sectionTitle">TODO: results</h2>'
-                                                       + '<small class="sectionDescription">TODO: click on a result to select it</small>'
+                                                       + '<h2 class="sectionTitle">' + Language.get('wcf.page.pageObjectID.search.results') + '</h2>'
+                                                       + '<small class="sectionDescription">' + Language.get('wcf.page.pageObjectID.search.results.description') + '</small>'
                                                + '</header>'
                                                + '<ul id="wcfUiPageSearchResultList" class="containerList wcfUiPageSearchResultList"></ul>'
                                        + '</section>'
index b6123e3c02b21da44cf2443a2972af2095ce0259..9942216532dd1d0ea31d26a1b955f118b387119c 100644 (file)
@@ -3,9 +3,11 @@ namespace wcf\acp\form;
 use wcf\data\menu\item\MenuItem;
 use wcf\data\menu\item\MenuItemAction;
 use wcf\data\menu\Menu;
+use wcf\data\page\PageNodeTree;
 use wcf\form\AbstractForm;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\language\I18nHandler;
+use wcf\system\page\handler\ILookupPageHandler;
 use wcf\system\WCF;
 
 /**
@@ -49,6 +51,18 @@ class MenuItemEditForm extends MenuItemAddForm {
                
                I18nHandler::getInstance()->register('title');
                I18nHandler::getInstance()->register('externalURL');
+               
+               $this->pageNodeList = (new PageNodeTree())->getNodeList();
+               
+               // fetch page handlers
+               foreach ($this->pageNodeList as $pageNode) {
+                       $handler = $pageNode->getPage()->getHandler();
+                       if ($handler !== null) {
+                               if ($handler instanceof ILookupPageHandler) {
+                                       $this->pageHandlers[$pageNode->getPage()->pageID] = $pageNode->getPage()->requireObjectID;
+                               }
+                       }
+               }
        }
        
        /**
@@ -79,6 +93,7 @@ class MenuItemEditForm extends MenuItemAddForm {
                        'isDisabled' => ($this->isDisabled) ? 1 : 0,
                        'title' => $this->title,
                        'pageID' => $this->pageID,
+                       'pageObjectID' => ($this->pageObjectID ?: 0),
                        'externalURL' => $this->externalURL,
                        'parentItemID' => $this->parentItemID,
                        'showOrder' => $this->showOrder
@@ -105,6 +120,7 @@ class MenuItemEditForm extends MenuItemAddForm {
                        $this->parentItemID = $this->menuItem->parentItemID;
                        $this->title = $this->menuItem->title;
                        $this->pageID = $this->menuItem->pageID;
+                       $this->pageObjectID = $this->menuItem->pageObjectID;
                        $this->externalURL = $this->menuItem->externalURL;
                        $this->showOrder = $this->menuItem->showOrder;
                        $this->isDisabled = $this->menuItem->isDisabled;