<classname><![CDATA[wcf\system\search\acp\PackageACPSearchResultProvider]]></classname>
<showorder>5</showorder>
</acpsearchprovider>
+ <acpsearchprovider name="com.woltlab.wcf.page">
+ <classname><![CDATA[wcf\system\search\acp\PageACPSearchResultProvider]]></classname>
+ <showorder>6</showorder>
+ </acpsearchprovider>
+ <acpsearchprovider name="com.woltlab.wcf.box">
+ <classname><![CDATA[wcf\system\search\acp\BoxACPSearchResultProvider]]></classname>
+ <showorder>7</showorder>
+ </acpsearchprovider>
+ <acpsearchprovider name="com.woltlab.wcf.article">
+ <classname><![CDATA[wcf\system\search\acp\ArticleACPSearchResultProvider]]></classname>
+ <showorder>8</showorder>
+ </acpsearchprovider>
</import>
</data>
--- /dev/null
+<?php
+namespace wcf\system\search\acp;
+use wcf\data\article\content\ArticleContentList;
+use wcf\system\request\LinkHandler;
+use wcf\system\WCF;
+
+/**
+ * ACP search result provider implementation for cms articles.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2016 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Search\Acp
+ */
+class ArticleACPSearchResultProvider implements IACPSearchResultProvider {
+ /**
+ * @inheritDoc
+ */
+ public function search($query) {
+ if (!WCF::getSession()->getPermission('admin.content.article.canManageArticle')) {
+ return [];
+ }
+
+ $results = [];
+
+ $contentList = new ArticleContentList();
+ $contentList->getConditionBuilder()->add('article_content.title LIKE ?', ['%'.$query.'%']);
+ $contentList->sqlLimit = 10;
+ $contentList->sqlOrderBy = 'article_content.title';
+ $contentList->readObjects();
+ foreach ($contentList as $content) {
+ $results[] = new ACPSearchResult($content->title, LinkHandler::getInstance()->getLink('ArticleEdit', [
+ 'id' => $content->articleID,
+ ]));
+ }
+
+ return $results;
+ }
+}
--- /dev/null
+<?php
+namespace wcf\system\search\acp;
+use wcf\data\box\BoxList;
+use wcf\system\request\LinkHandler;
+use wcf\system\WCF;
+
+/**
+ * ACP search result provider implementation for cms boxes.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2016 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Search\Acp
+ */
+class BoxACPSearchResultProvider implements IACPSearchResultProvider {
+ /**
+ * @inheritDoc
+ */
+ public function search($query) {
+ if (!WCF::getSession()->getPermission('admin.content.cms.canManageBox')) {
+ return [];
+ }
+
+ $results = [];
+
+ $boxList = new BoxList();
+ $boxList->getConditionBuilder()->add('box.name LIKE ?', ['%'.$query.'%']);
+ $boxList->sqlLimit = 10;
+ $boxList->sqlOrderBy = 'box.name';
+ $boxList->readObjects();
+ foreach ($boxList as $box) {
+ $results[] = new ACPSearchResult($box->name, LinkHandler::getInstance()->getLink('BoxEdit', [
+ 'id' => $box->boxID,
+ ]));
+ }
+
+ return $results;
+ }
+}
--- /dev/null
+<?php
+namespace wcf\system\search\acp;
+use wcf\data\page\PageList;
+use wcf\system\request\LinkHandler;
+use wcf\system\WCF;
+
+/**
+ * ACP search result provider implementation for cms pages.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2016 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Search\Acp
+ */
+class PageACPSearchResultProvider implements IACPSearchResultProvider {
+ /**
+ * @inheritDoc
+ */
+ public function search($query) {
+ if (!WCF::getSession()->getPermission('admin.content.cms.canManagePage')) {
+ return [];
+ }
+
+ $results = [];
+
+ $pageList = new PageList();
+ $pageList->getConditionBuilder()->add('page.name LIKE ?', ['%'.$query.'%']);
+ $pageList->sqlLimit = 10;
+ $pageList->sqlOrderBy = 'page.name';
+ $pageList->readObjects();
+ foreach ($pageList as $page) {
+ $results[] = new ACPSearchResult($page->name, LinkHandler::getInstance()->getLink('PageEdit', [
+ 'id' => $page->pageID,
+ ]));
+ }
+
+ return $results;
+ }
+}
<category name="wcf.acp.search">
<item name="wcf.acp.search.noResults"><![CDATA[Keine Treffer]]></item>
- <item name="wcf.acp.search.provider.com.woltlab.wcf.menuItem"><![CDATA[Seiten]]></item>
+ <item name="wcf.acp.search.provider.com.woltlab.wcf.menuItem"><![CDATA[Administrationsmenü]]></item>
<item name="wcf.acp.search.provider.com.woltlab.wcf.option"><![CDATA[Optionen]]></item>
<item name="wcf.acp.search.provider.com.woltlab.wcf.package"><![CDATA[Pakete]]></item>
<item name="wcf.acp.search.provider.com.woltlab.wcf.user"><![CDATA[Benutzer]]></item>
<item name="wcf.acp.search.provider.com.woltlab.wcf.userGroupOption"><![CDATA[Berechtigungen]]></item>
+ <item name="wcf.acp.search.provider.com.woltlab.wcf.page"><![CDATA[Seiten]]></item>
+ <item name="wcf.acp.search.provider.com.woltlab.wcf.article"><![CDATA[Artikel]]></item>
+ <item name="wcf.acp.search.provider.com.woltlab.wcf.box"><![CDATA[Boxen]]></item>
<item name="wcf.acp.search.result.subtitle"><![CDATA[{implode from=$pieces item=piece glue=' » '}{$piece|language}{/implode}]]></item>
</category>
<item name="wcf.acp.search.provider.com.woltlab.wcf.package"><![CDATA[Packages]]></item>
<item name="wcf.acp.search.provider.com.woltlab.wcf.user"><![CDATA[Users]]></item>
<item name="wcf.acp.search.provider.com.woltlab.wcf.userGroupOption"><![CDATA[Permissions]]></item>
+ <item name="wcf.acp.search.provider.com.woltlab.wcf.page"><![CDATA[Pages]]></item>
+ <item name="wcf.acp.search.provider.com.woltlab.wcf.article"><![CDATA[Articles]]></item>
+ <item name="wcf.acp.search.provider.com.woltlab.wcf.box"><![CDATA[Boxes]]></item>
<item name="wcf.acp.search.result.subtitle"><![CDATA[{implode from=$pieces item=piece glue=' » '}{$piece|language}{/implode}]]></item>
</category>