{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">
_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);
});
* @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;
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;
},
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>'
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;
/**
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;
+ }
+ }
+ }
}
/**
'isDisabled' => ($this->isDisabled) ? 1 : 0,
'title' => $this->title,
'pageID' => $this->pageID,
+ 'pageObjectID' => ($this->pageObjectID ?: 0),
'externalURL' => $this->externalURL,
'parentItemID' => $this->parentItemID,
'showOrder' => $this->showOrder
$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;